/* static/css/modal.css - 全体を以下に置き換え */

/* モーダル基本スタイル */
.modal-xl {
  max-width: 90%;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  border: none;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  overflow: visible; /* 閉じるボタンが見えるように */
}

/* 独立した閉じるボタン */
.btn-close-custom {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 36px;
  height: 36px;
  background: #fff;
  border: 2px solid #dee2e6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 300;
  color: #6c757d;
  cursor: pointer;
  z-index: 1060;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transform-origin: center center;
}

.btn-close-custom span {
  padding-bottom:5px;
}

.btn-close-custom:hover {
  background: #f8f9fa;
  border-color: #6c757d;
  color: #000;
  transform: rotate(90deg);
}

.btn-close-custom:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.25);
}

/* モーダルボディのパディング最適化 */
.modal-body {
  padding: 0 !important;
}

.modal-body .row {
  margin: 0;
}

/* 左列（プレイヤー）のスタイル */
.modal-body .col-lg-8 {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px 0 0 0;
}

/* 右列（曲情報）のスタイル */
.modal-body .col-lg-4 {
  padding: 20px;
  max-height: 80vh;
  overflow-y: auto;
}

/* フッターのコンパクト化 */
.modal-footer {
  padding: 8px 20px !important;
  background: #f8f9fa;
  border-radius: 0 0 12px 12px;
}

.modal-footer .btn-sm {
  padding: 4px 12px;
  font-size: 0.875rem;
}

/* 投稿カード */
.post-card {
  transition: transform 0.2s;
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-5px);
}

/* 埋め込みコンテナ */
.embed-container {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.embed-container + div {
  margin-top: 1rem;
}

/* プレイヤーの高さ調整 */
#applePlayer {
  max-height: 175px;
}

/* スクロールバーのカスタマイズ */
.modal-body .col-lg-4::-webkit-scrollbar {
  width: 6px;
}

.modal-body .col-lg-4::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.modal-body .col-lg-4::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.modal-body .col-lg-4::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* タイトルエリア */
.modal-body h3 {
  font-size: 1.4rem;
  line-height: 1.3;
  word-break: break-word;
  margin-bottom: 0.5rem;
}

/* いいねボタン */
.modal-body .like-btn-lg {
  white-space: nowrap;
  min-width: fit-content;
}

/* フレックスコンテナ */
.modal-body .d-flex.justify-content-between {
  gap: 0.75rem;
}

/* シェアボタン */
.btn-dark {
  background-color: #000;
  border-color: #000;
  padding: 8px 16px;
}

.btn-dark:hover {
  background-color: #333;
  border-color: #333;
}

/* キーボードヒント */
.keyboard-hint {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  z-index: 1000;
  display: none;
}

.modal.show ~ .keyboard-hint {
  display: block;
}

/* モバイル対応 */
@media (max-width: 991px) {
  .modal-xl {
    max-width: 95%;
    margin: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
  }
  
  /* 独立した閉じるボタンの位置調整 */
  .btn-close-custom {
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    font-size: 20px;
    transform-origin: center center;
  }

  .btn-close-custom span {
    padding-top:2px;
  }
  
  /* モバイルでは列のパディングを減らす */
  .modal-body .col-lg-8,
  .modal-body .col-lg-4 {
    padding: 15px;
  }
  
  /* モバイルで左列の背景を調整 */
  .modal-body .col-lg-8 {
    background: #f8f9fa;
    border-radius: 0;
  }
  
  /* モバイルで曲情報が上に来た時の調整 */
  .modal-body .order-1 {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
    margin-bottom: 15px;
  }
  
  /* タイトルのフォントサイズ調整 */
  .modal-body h3 {
    font-size: 1.2rem;
  }
  
  /* いいねボタンのサイズ調整 */
  .modal-body .like-btn-lg {
    padding: 6px 10px;
    font-size: 0.875rem;
  }
  
  /* フッターの調整 */
  .modal-footer {
    padding: 6px 15px !important;
  }
  
  .keyboard-hint {
    display: none !important;
  }
}

/* タブレット用の中間サイズ */
@media (min-width: 768px) and (max-width: 991px) {
  .modal-xl {
    max-width: 95%;
    margin: 2rem;
  }
}

/* ダークモード対応（オプション） */
@media (prefers-color-scheme: dark) {
  .modal-content {
    background: #1a1a1a;
    color: #e0e0e0;
  }
  
  .btn-close-custom {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
  }
  
  .btn-close-custom:hover {
    background: #333;
    border-color: #666;
  }
  
  .modal-body .col-lg-8 {
    background: #0f0f0f;
  }
  
  .modal-footer {
    background: #0f0f0f;
  }
}