/**
 * 独自CSS
 * LMS（学習管理システム）
 */

/* ========================================
   カラーテーマ設定
   ======================================== */
:root {
    --bs-primary: #22304a;
    /* deep navy */
    --bs-primary-rgb: 34, 48, 74;

    --bs-secondary: #5b6472;
    /* blue gray */
    --bs-secondary-rgb: 91, 100, 114;

    --bs-success: #3a6b5a;
    /* sage green */
    --bs-success-rgb: 58, 107, 90;

    --bs-info: #355e66;
    /* muted teal */
    --bs-info-rgb: 53, 94, 102;

    --bs-warning: #9a7a3a;
    /* muted ochre */
    --bs-warning-rgb: 154, 122, 58;

    --bs-danger: #7c2f2f;
    /* brick red */
    --bs-danger-rgb: 124, 47, 47;
    /* 
     * カスタマイズ例:
     * プライマリを青緑に変更したい場合
     * --bs-primary: #17a2b8;
     * --bs-primary-rgb: 23, 162, 184;
     */
}

/* 全体のレイアウト */
body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background-color: #f8f9fa;
}

/* ナビゲーションバー */
.navbar {
    z-index: 1030;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* サイドバー */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    width: 250px;
    z-index: 1020;
    padding: 0;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
}

/* PC: デフォルトで表示 */
@media (min-width: 768px) {
    .sidebar.active {
        transform: translateX(0);
    }
}

/* スマホ: デフォルトで非表示、activeで表示 */
@media (max-width: 767px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
}

/* サイドバーオーバーレイ（スマホ用） */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1010;
}

@media (max-width: 767px) {
    .sidebar-overlay.active {
        display: block;
    }
}

.sidebar-sticky {
    position: sticky;
    top: 0;
    height: calc(100vh - 56px);
    padding-top: 0.5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

/* スマホの場合のみパディングを増やす */
@media (max-width: 767px) {
    .sidebar-sticky {
        padding-top: 1.5rem;
    }
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin: 0.25rem 0.5rem;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
}

.sidebar .nav-link.active {
    background-color: #0d6efd;
    color: #fff;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.05rem;
}

/* メインコンテンツ */
.main-content {
    padding: 1rem;
    min-height: calc(100vh - 56px);
    margin-top: 56px;
    width: 100%;
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out;
}

/* PC: サイドバーがある場合 */
@media (min-width: 768px) {
    .main-content.with-sidebar {
        margin-left: 250px;
        width: calc(100% - 250px);
    }
}

/* スマホ: サイドバーなし */
@media (max-width: 767px) {
    .main-content {
        margin-left: 0;
        margin-top: 56px;
        width: 100%;
        padding: 0.5rem;
    }
}

/* カード */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #0d6efd;
    font-weight: bold;
}

/* テーブル */
.table {
    background-color: #fff;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-top: none;
}

/* ボタン */
.btn {
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.btn i {
    margin-right: 0.25rem;
}

/* バッジ */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* ログイン画面 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    max-width: 400px;
    width: 100%;
}

.login-card .card {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.login-header {
    text-align: center;
    padding: 2rem 0 1rem;
}

.login-header i {
    font-size: 3rem;
    color: #0d6efd;
}

/* 動画プレイヤー */
.video-container {
    position: relative;
    background-color: #000;
    border-radius: 0.25rem;
    overflow: hidden;
}

.video-container iframe {
    width: 100%;
    height: 500px;
}

/* 進捗バー */
.progress {
    height: 1.5rem;
    font-size: 0.875rem;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* アラート */
.alert {
    border-radius: 0.25rem;
    border: none;
}

.alert i {
    margin-right: 0.5rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    /* .sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    } */

    .sidebar-sticky {
        height: auto;
    }

    .main-content {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* ステータスバッジ */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

.status-completed {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-in-progress {
    background-color: #fff3cd;
    color: #664d03;
}

.status-not-started {
    background-color: #f8d7da;
    color: #842029;
}

/* テスト結果 */
.test-result {
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.test-result.passed {
    background-color: #d1e7dd;
    border: 2px solid #0f5132;
}

.test-result.failed {
    background-color: #f8d7da;
    border: 2px solid #842029;
}

.test-score {
    font-size: 2rem;
    font-weight: bold;
}

/* 動画リスト */
.video-list-item {
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.video-list-item:hover {
    border-left-color: #0d6efd;
    background-color: #f8f9fa;
}

.video-list-item.completed {
    border-left-color: #198754;
}

.video-list-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ページネーション */
.pagination {
    margin-top: 1.5rem;
}

/* 空の状態 */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 動画番号バッジ */
.video-number-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
}