/* Bootstrapテーマに合わせたカスタムスタイル */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #17a2b8;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
}

/* カードスタイルの調整 */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* テーブルスタイル調整 */
.table th {
    font-weight: 600;
    white-space: nowrap;
}

/* 一覧テーブル：固定高さで内部スクロール（sticky header 有効化のため） */
#all-tab .table-responsive,
#popular-tab .table-responsive {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding: 0 !important; /* padding があると sticky header の上に行データが透けるため除去 */
}

/* テーブルヘッダー固定（スクロールコンテナ内で sticky） */
.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--bs-body-bg);
    box-shadow: 0 1px 0 var(--bs-border-color);
}

.table td {
    vertical-align: middle;
}

/* リプレイIDリンク */
.replay-link {
    color: var(--bs-primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.replay-link:hover {
    text-decoration: underline;
}

/* 結果バッジ */
.badge-win {
    background-color: var(--success-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.badge-loss {
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.badge-draw {
    background-color: var(--warning-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ステータスバッジの微調整 */
.badge.rounded-pill {
    padding: 0.5em 1em;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 背景色ごとの文字色強制設定（コントラスト確保） */
.bg-warning { background-color: #ffc107 !important; color: #212529 !important; } /* 待機中 */
.bg-secondary { background-color: #6c757d !important; color: #ffffff !important; }
.bg-info { background-color: #0dcaf0 !important; color: #212529 !important; }    /* 録画中 */
.bg-primary { background-color: #0d6efd !important; color: #ffffff !important; }  /* アップロード中 */
.bg-success { background-color: #198754 !important; color: #ffffff !important; }  /* 完了 */
.bg-dark { background-color: #212529 !important; color: #ffffff !important; }
.bg-danger { background-color: #dc3545 !important; color: #ffffff !important; }   /* エラー */



/* 動画コンテナ */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 詳細情報 */
.detail-info {
    font-size: 0.9rem;
}

.detail-info h6 {
    margin-bottom: 1rem;
    font-weight: 700;
}

.detail-info .mb-3 {
    margin-bottom: 0.75rem !important;
}

/* ローディングスピナー */
#loading {
    padding: 2rem;
}

/* 無限スクロール用の監視要素 */
#scroll-sentinel {
    height: 1px;
}

/* フォーム調整 */
.form-floating > label {
    padding: 0.5rem;
}

/* フッター調整 */
footer {
    border-top: 1px solid var(--bs-border-color);
}

/* モーダル調整 */
.modal-body {
    padding: 1.5rem;
}

/* レスポンシブ調整 */
@media (max-width: 767.98px) {
    .table-responsive {
        font-size: 0.85rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .detail-info {
        margin-top: 1rem;
    }

    /* モバイルではページ全体をスクロールさせる（コンテナ内スクロール無効化） */
    #all-tab .table-responsive,
    #popular-tab .table-responsive {
        max-height: none !important;
        overflow-y: auto !important;
    }

    /* overflow-x:auto と position:sticky は共存できないため、モバイルはstickyを無効化 */
    .table thead th {
        position: static;
    }
}

/* テーマ切り替えドロップダウン */
.dropdown-menu {
    min-width: 120px;
}

.dropdown-item i {
    margin-right: 0.5rem;
}

/* 検索結果ハイライト */
.search-highlight {
    background-color: rgba(255, 255, 0, 0.3);
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}