/* actress-detail.css - 新オキニリストのcss（修正版） */

body {
  touch-action: manipulation;
}

.cast-detail-container {
  padding: 15px;
  max-width: 600px;
  margin: 0 auto;
}

/* ★★★ 旧オキニリスト完全準拠：space-between ★★★ */
.cast-action-buttons {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

/* ★★★ 旧オキニリスト完全準拠：flex: 1, margin: 0 5px ★★★ */
.okini-button {
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  flex: 1;
  margin: 0 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f8f8f8;
  border: 1px solid #ff6b81;
  color: #ff6b81;
}

.okini-button.active {
  background-color: #ff6b81;
  color: white;
}

.okini-button::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 5px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6b81' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.okini-button.active::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white' stroke='white' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'%3E%3C/path%3E%3C/svg%3E");
}

.okini-button span {
  font-size: 1em;
}

/* ★★★ 旧オキニリスト完全準拠：flex: 1, margin: 0 5px ★★★ */
.tag-button {
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  flex: 1;
  margin: 0 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f8f8f8;
  border: 1px solid #7b68ee;
  color: #7b68ee;
}

.tag-button::before {
  content: "#";
  display: inline-block;
  font-size: 1.5em;
  margin-right: 5px;
  font-weight: bold;
  line-height: 1;
}

.cast-detail-profile {
  display: flex;
  margin-bottom: 15px;
}

.cast-detail-left {
  width: 120px;
  margin-right: 15px;
}

/* ★★★ 画像クリック問題解決用CSS ★★★ */
.cast-detail-left {
  position: relative;
  z-index: 10;
}

.cast-detail-left img {
  position: relative;
  z-index: 15;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* 画像の上に重なる可能性のある要素を修正 */
.cast-detail-profile {
  position: relative;
  z-index: 5;
}

.cast-detail-right {
  position: relative;
  z-index: 8;
}

/* テスト用：画像がクリック可能か視覚的に確認 */
.cast-detail-left img:hover {
  opacity: 0.8;
  transform: scale(1.02);
  transition: all 0.2s ease;
}

.cast-detail-left img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.cast-detail-right {
  flex: 1;
}

.cast-detail-name {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 28px;
  margin-bottom: 5px;
}

.cast-detail-name.with-animation {
  transition: padding-left 0.2s ease;
}

/* ハートがある時の女優名位置調整 */
.cast-detail-name.has-heart {
  padding-left: 25px;
}

.cast-detail-name.animating-slide {
  transition: padding-left 0.2s ease;
}

/* ★★★ 修正：ハートアニメーション制御の強化 ★★★ */
.okini-heart {
  z-index: 12 !important;
  pointer-events: none; /* ハートはクリック不可に */
  position: absolute;
  left: 0;
  top: 40%;
  transform: translateY(-35%);
  width: 20px;
  height: 20px;
  display: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff6b81' stroke='%23ff6b81' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* ★★★ 修正：デフォルトではアニメーション無効 ★★★ */
  transition: none;
  animation: none;
}

/* ★★★ 旧オキニリスト準拠：display制御 ★★★ */
.okini-heart.active {
  display: block;
}

/* ★★★ 修正：アニメーション制御の強化 ★★★ */
.okini-heart.no-transition {
  transition: none !important;
  animation: none !important;
}

/* ★★★ アニメーションが有効な場合のみtransitionを適用 ★★★ */
.okini-heart.with-animation {
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

/* ★★★ 追加：アニメーション付きクラス ★★★ */
.okini-heart.animating {
  animation: heartBounce 0.6s ease-out;
}

@keyframes heartBounce {
  0% {
    transform: translateY(-35%) scale(0);
    opacity: 0;
  }
  50% {
    transform: translateY(-35%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translateY(-35%) scale(1);
    opacity: 1;
  }
}

.cast-detail-name h2 {
  font-size: 1.5em;
  font-weight: bold;
  color: #333;
}

.cast-detail-info {
  font-size: 0.9em;
  line-height: 1.4;
  color: #555;
}

.cast-shifts {
  margin-bottom: 15px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.cast-shifts::-webkit-scrollbar {
  display: none;
}

.cast-shifts table {
  width: 100%;
  border-collapse: collapse;
}

.cast-shifts td {
  min-width: 90px;
  padding: 5px;
  text-align: center;
}

.shift-date {
  font-size: 0.9em;
  margin-bottom: 5px;
}

.shift-box {
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 5px;
  height: 60px;
  min-width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  box-shadow: 0 1px 4px 0 rgba(37, 44, 97, 0.15),
    0 1px 4px 0 rgba(93, 100, 148, 0.2);
}

.shift-time-block {
  line-height: 1.5;
}

/* ★★★ 追加：詳細画面タグスタイル（旧オキニリスト完全準拠） ★★★ */
.cast-tags .tag,
.actress-tags .tag {
  background-color: #f0f0f0;
  color: #888;
  padding: 10px 15px;
  border-radius: 20px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 10px;
  margin-bottom: 8px;
  white-space: nowrap;
  display: inline-block;
}

/* ★★★ 追加：タグのホバー効果 ★★★ */
.cast-tags .tag:hover,
.actress-tags .tag:hover {
  background-color: #e0e0e0 !important;
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* ★★★ 追加：女優画像のホバー効果 ★★★ */
.cast-detail-left img:hover {
  transform: scale(1.02);
  transition: transform 0.2s ease;
  cursor: pointer;
}

/* ★★★ 詳細画面のタグエリア ★★★ */
.actress-tags-section {
  margin-bottom: 20px;
}

.actress-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-x: auto;
  padding: 5px 0;
}

.cast-external-links {
  margin-top: 20px;
}

.cast-external-links h3 {
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.external-link-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.external-link {
  display: inline-flex;
  align-items: center;
  color: #ff6b81;
  text-decoration: none;
  font-size: 0.9em;
  width: auto;
}

.external-link svg {
  margin-left: 3px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* モーダルスタイル（既存のmodal CSSがない場合のみ追加） */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  overflow: hidden;
}

.modal-header {
  padding: 15px;
  background-color: #ff6b81;
  color: white;
  position: relative;
}

.modal-header h2 {
  text-align: center;
  margin: 0;
  font-size: 1.2em;
}

.close-modal-button {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 1.5em;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

.modal-body p {
  margin-bottom: 15px;
  line-height: 1.5;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

.login-modal-button {
  background-color: #ff6b81;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
}

.modal-footer {
  padding: 15px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.btn-save,
.btn-cancel {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  flex: 1;
  font-weight: bold;
}

.btn-save {
  background-color: #ff6b81;
  color: white;
}

.btn-cancel {
  background-color: #ccc;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  line-height: 1;
}

/* PC表示用のレイアウト */
@media (min-width: 768px) {
  .cast-detail-container {
    max-width: 480px;
    margin: 0 auto;
    background-color: white;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
  .okini-heart {
    transform: translateY(-50%);
  }

  @keyframes heartBounce {
  0% {
    transform: translateY(-50%) scale(0);
    opacity: 0;
  }
  50% {
    transform: translateY(-50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translateY(-50%) scale(1);
    opacity: 1;
  }
}

  .cast-shifts {
    overflow-x: auto;
    scrollbar-width: thin;
    -ms-overflow-style: auto;
  }

  .cast-shifts::-webkit-scrollbar {
    height: 4px;
    display: block;
  }

  .cast-shifts::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

  .cast-shifts::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
  }

  .cast-shifts table {
    width: 100%;
    border-collapse: collapse;
  }

  .cast-shifts td {
    min-width: 80px;
    width: calc(100% / 7);
  }

  .shift-box {
    height: 60px;
    min-width: 70px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cast-external-links {
    margin-top: 25px;
    border-top: 1px solid #eee;
    padding-top: 15px;
  }

  .external-link-list {
    display: block;
  }

  .external-link {
    margin-bottom: 10px;
    display: inline-block;
    margin-right: 15px;
  }
}

/* ========================================
   🎬 Phase 6.3: 女優詳細ページ作品表示CSS
   ======================================== */

/* 作品一覧グリッド表示 */
.works-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 15px;
}

/* 個別作品要素 */
.work-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.work-item:hover {
  transform: translateY(-2px);
}

/* 作品画像コンテナ */
.work-image-container {
  width: 90px;
  height: 128px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 5px;
}

/* 作品画像 */
.work-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

/* 作品タイトル */
.work-title {
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  color: #333;
  max-width: 90px;
  word-wrap: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* もっと見るボタン */
.load-more-btn {
  display: block;
  margin: 15px auto;
  padding: 10px 20px;
  background-color: #ff6b81;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

.load-more-btn:hover {
  background-color: #e55a73;
}

/* 作品なし表示 */
.no-works {
  text-align: center;
  color: #999;
  font-size: 14px;
  padding: 20px 0;
}

/* 作品セクション見出し */
.cast-shifts h3 {
  font-size: 1.1em;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
  border-bottom: 2px solid #ff6b81;
  padding-bottom: 5px;
}

/* レスポンシブ対応：スマホでも4列維持 */
@media (max-width: 400px) {
  .works-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px; /* より狭く */
  }
  
  .work-image-container {
    width: 65px;  /* より小さく */
    height: 92px;
  }
  
  .work-title {
    font-size: 9px;
    max-width: 65px;
    line-height: 1.1;
  }
}