@charset "utf-8";


/* ==========================================
       1. 基本スタイル・カラー設定
       ========================================== */
:root {
    --card-bg: #1e293b;
    /* カード・枠線の背景 */
    --accent-color: #f59e0b;
    /* アクセント（アンバー/イエロー） */
    --text-sub: #d8dce2;
    /* 補足テキスト */
    --hover-bg: #334155;
    /* ホバー時背景 */
    --active-border: #f59e0b;
    /* 選択中の枠線 */
}

.video-and-list {
    display: flex;
    margin: 10px 0px;
    height: calc( 100vh - 280px );
    min-height: 420px;
}

@media (max-width: 768px) {
    .video-and-list {
        display: block;
    }
}

/* ==========================================
       2. メインプレイヤーエリア（左側）
       ========================================== */
.player-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-right: 0.5rem;
    width: 100%;
}

@media (max-width: 768px) {

    /* プレイヤーエリアを上部に固定 */
    .player-section {
        /* position: sticky;
        top: 0;
        z-index: 100;
        background-color: var(--bg-color);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); */
        margin-right: 0rem;
        margin-bottom: 1rem;
    }
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {

    /* プレイヤー角丸をスマホでは解除して横幅いっぱいに */
    .video-wrapper {
        border-radius: 0;
    }
}

.video-wrapper iframe {
    aspect-ratio: 16 / 9;
}

@media (max-width: 768px) {
    .video-wrapper iframe {
        width: 100%;
    }
}

.video-info {
    background-color: var(--card-bg);
    padding: 1.25rem;
    border-radius: 12px;
}

.video-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: bold;
}

.tag-category {
    background-color: #3b82f6;
    color: #fff;
}

.tag-series {
    background-color: #334155;
    color: #fff;
}

.video-info h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.video-info p {
    font-size: 0.9rem;
    color: var(--text-sub);
}

/* ==========================================
       3. 形式リスト・カテゴリフィルター（右側）
       ========================================== */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: calc(100vh - 120px);
    /* 画面の高さに合わせる */
}

/* フィルタータブ */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    background-color: var(--card-bg);
    padding: 0.4rem;
    border-radius: 8px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-sub);
    padding: 0.5rem;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #fff;
}

.tab-btn.active {
    background-color: var(--accent-color);
    color: #000;
}

/* 形式リスト（スクロール領域） */
.train-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.25rem;
    min-width: 20rem;
}

/* スクロールバーのカスタマイズ */
.train-list::-webkit-scrollbar {
    width: 6px;
}

.train-list::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

/* リストアイテム */
.list-item {
    display: flex;
    gap: 0.75rem;
    background-color: var(--card-bg);
    padding: 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.list-item:hover {
    background-color: var(--hover-bg);
}

.list-item.active {
    border-color: var(--active-border);
    background-color: var(--hover-bg);
}

/* サムネイル */
.item-thumb {
    width: 100px;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    flex-shrink: 0;
}

/* アイテムテキスト情報 */
.item-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.item-company {
    font-size: 0.75rem;
    color: var(--text-sub);
}

.item-title {
    font-size: 0.85rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================
       4. レスポンシブ対応（スマホ向け）
       ========================================== */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        /* 1カラムに変更 */
    }

    .sidebar-section {
        height: auto;
    }

    .train-list {
        max-height: 400px;
        /* スマホでは最大高さを指定 */
    }
}

@media (max-width: 768px) {

    /* ヘッダーをコンパクトに */
    header {
        padding: 0.75rem 1rem;
    }

    /* 全体コンテナの余白を詰める */
    .container {
        grid-template-columns: 1fr;
        padding: 0;
        /* 端までプレイヤーを広げる */
        gap: 0;
    }

    .video-info {
        padding: 0.75rem 1rem;
        border-radius: 0;
    }

    .video-info h2 {
        font-size: 1rem;
        /* スマホ用にタイトル文字を少し小さく */
    }

    /* サイドバー（下部エリア）の調整 */
    .sidebar-section {
        height: auto;
        padding: 1rem;
    }

    /* ★カテゴリタブの横スクロール対応 */
    .filter-tabs {
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
        /* 折り返さない */
        -webkit-overflow-scrolling: touch;
        /* iOSでのスクロールをなめらかに */
        padding: 0.5rem;
    }

    .tab-btn {
        flex: 0 0 auto;
        /* ボタンの幅を自動調整 */
        padding: 0.5rem 1rem;
    }

    /* ★リスト領域のスクロール設定 */
    .train-list {
        max-height: 50vh;
        /* 画面高さの半分のサイズで固定スクロール */
    }

    /* リストアイテムのタップ領域確保 */
    .list-item {
        min-height: 52px;
        padding: 0.75rem;
    }
}