/* カスタムスタイル */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* 選択的スクレイピング用スタイル */
.class-item {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.class-item:hover {
    background-color: #f8f9fa;
}

.class-item .form-check-input:checked + .form-check-label {
    color: #0d6efd;
}

.class-item .form-check-input:checked + .form-check-label .fw-bold {
    color: #0d6efd;
}

#class-list-container {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.modal-fullscreen .modal-body {
    padding: 1.5rem;
}

.selection-summary {
    font-size: 0.9rem;
}

.jumbotron {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.btn {
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border: none;
    font-weight: 600;
    color: #495057;
}

.badge {
    font-size: 0.85em;
    padding: 0.5em 0.8em;
}

.alert {
    border: none;
    border-radius: 10px;
}

.modal-content {
    border-radius: 15px;
    border: none;
}

.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* チャート用のスタイル */
.chart-container {
    position: relative;
    height: 300px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .jumbotron {
        padding: 2rem 1rem;
    }
    
    .jumbotron h1 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* アニメーション */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ローディングスピナー */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 統計カード */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
}

.stat-card .opacity-75 {
    opacity: 0.75;
}

/* テーブルの行ホバー効果 */
.table tbody tr:hover {
    background-color: rgba(0,123,255,0.05);
    transition: background-color 0.3s ease;
}

/* ナビゲーションリンクのアクティブ状態 */
.navbar-nav .nav-link.active {
    font-weight: bold;
    color: #fff !important;
}

/* フッター */
footer {
    margin-top: auto;
}

/* ボタングループ */
.btn-group .btn {
    border-radius: 5px;
    margin-right: 2px;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* パンくずリスト */
.breadcrumb {
    background-color: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #6c757d;
}

/* プログレスバー */
.progress {
    height: 8px;
    border-radius: 10px;
}

.progress-bar {
    border-radius: 10px;
}

/* カスタムアラート */
.alert-custom {
    border-left: 4px solid #007bff;
    background-color: #f8f9fa;
    border-radius: 0 10px 10px 0;
}

/* 影の効果 */
.shadow-custom {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* テキストの色 */
.text-primary-custom {
    color: #667eea !important;
}

.text-secondary-custom {
    color: #6c757d !important;
}

/* 成績カード表示スタイル */
.subject-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    justify-items: start;
    align-items: start;
}

.subject-card-stack {
    position: relative;
    width: 120px;
    height: 40px;
    margin-bottom: 4px;
}

.subject-card {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    border: 1px solid transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subject-card.latest {
    z-index: 10;
    transform: translateY(0) translateX(0);
}

.subject-card.stacked {
    z-index: 5;
    transform: translateY(3px) translateX(3px);
    opacity: 0.7;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.subject-card:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 20;
}

.subject-card.stacked:hover {
    transform: translateY(-2px) translateX(3px) scale(1.05);
}

/* 評価別の色分け */
.subject-card.grade-s {
    /* ゴールド系のメタリック表現 */
    border-color: #d4af37;
    background: linear-gradient(135deg,
        #b8860b 0%,
        #d4af37 40%,
        #f5d76e 55%,
        #d4af37 75%,
        #b8860b 100%
    );
    color: #ffffff;
    text-shadow: 0 1px 0 rgba(0,0,0,0.25);
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.3);
}

.subject-card.grade-a {
    border-color: #007bff;
    background: #007bff;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subject-card.grade-b {
    border-color: #28a745;
    background: #28a745;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subject-card.grade-c {
    border-color: #ffc107;
    background: #ffc107;
    color: #212529;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subject-card.grade-f {
    border-color: #dc3545;
    background: #dc3545;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subject-card.grade-n {
    border-color: #6c757d;
    background: #6c757d;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subject-card.grade-r {
    border-color: #6c757d;
    background: #6c757d;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subject-card.grade-x {
    border-color: #20c997;
    background: #20c997;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subject-card.grade-unknown {
    border-color: #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
}

/* 凡例用バッジのカスタム色 */
.badge-grade-s {
    border: 1px solid #d4af37;
    background: linear-gradient(135deg,
        #b8860b 0%,
        #d4af37 40%,
        #f5d76e 55%,
        #d4af37 75%,
        #b8860b 100%
    );
    color: #fff;
    text-shadow: 0 1px 0 rgba(0,0,0,0.25);
}

.badge-grade-b {
    border: 1px solid #28a745;
    background: #28a745;
    color: #fff;
}

.card-content {
    padding: 4px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
}

.subject-name {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    max-width: 100%;
}

.subject-code {
    display: none;
}

.grade-badge {
    display: none;
}

.credit-info {
    display: none;
}

.stack-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 8px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 1px;
}

.stack-indicator i {
    font-size: 10px;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .subject-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
    .subject-card-stack {
        width: 110px;
        height: 35px;
    }
}

@media (max-width: 768px) {
    .subject-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 6px;
    }
    
    .subject-card-stack {
        width: 100px;
        height: 30px;
    }
    
    .subject-card.stacked {
        transform: translateY(2px) translateX(2px);
    }
    
    .card-content {
        padding: 2px;
    }
    
    .subject-name {
        font-size: 10px;
    }
}

/* ツールチップのカスタマイズ */
.tooltip {
    font-size: 13px;
}

.tooltip-inner {
    max-width: 300px;
    text-align: left;
    background-color: rgba(0,0,0,0.9);
    border-radius: 8px;
    padding: 12px;
}

/* 表示切り替えボタン */
#viewToggleBtn {
    transition: all 0.3s ease;
}


/* 学生アイコン関連スタイル */
.student-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 8px;
    cursor: pointer;
}

.student-icon-mini {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    transition: transform 0.2s ease;
}

.student-icon-hover-container {
    position: absolute;
    left: 35px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2000;
    display: none;
    pointer-events: none;
}

.student-icon-hover {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    border: 3px solid #fff;
    background-color: #fff;
}

.student-icon-wrapper:hover .student-icon-hover-container {
    display: block;
}

/* リスト内のテキストとの位置調整 */
.table td {
    vertical-align: middle;
}

/* 時間割（曜日分割） */
.timetable-room-table td {
    vertical-align: top;
}

.timetable-lesson-card {
    position: relative;
    padding: 4px 12px 4px 2px;
}

.timetable-zoom-lesson {
    cursor: pointer;
}

.timetable-zoom-lesson:hover,
.timetable-zoom-lesson:focus,
.timetable-empty-slot:hover,
.timetable-empty-slot:focus {
    background: #f8f9fa;
    outline: 2px solid rgba(13, 110, 253, 0.25);
    outline-offset: 2px;
}

.timetable-empty-slot {
    cursor: pointer;
    min-height: 40px;
    padding: 4px 6px;
}

.timetable-fill-bar {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    width: 6px;
    border-radius: 999px;
    background: var(--fill-color, #6c757d);
}

.timetable-heatmap-cell {
    min-width: 120px;
    min-height: 56px;
    vertical-align: middle !important;
}

.timetable-forecast-cell {
    min-width: 170px;
    vertical-align: top !important;
}

.timetable-forecast-card {
    position: relative;
    padding: 2px 12px 2px 2px;
}

.movement-day-card .card-body {
    padding: 0.75rem;
}

.movement-svg {
    width: 100%;
    height: auto;
    display: block;
}

.movement-route-text {
    font-size: 0.82rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movement-aggregate-card .card-header {
    background: #f8fafc;
}

.text-attention {
    color: #b45309 !important;
}

@media (max-width: 768px) {
    .timetable-lesson-card {
        padding-right: 12px;
    }

    .timetable-fill-bar {
        width: 5px;
        right: 3px;
    }

    .timetable-heatmap-cell {
        min-width: 100px;
        min-height: 48px;
    }

    .timetable-forecast-cell {
        min-width: 145px;
    }

    .movement-route-text {
        font-size: 0.76rem;
    }
}
