/* 全体のスタイル */
body {
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'メイリオ', Meiryo, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

.navbar {
    padding-top: calc(0.5rem + env(safe-area-inset-top));
    padding-left: calc(1rem + env(safe-area-inset-left));
    padding-right: calc(1rem + env(safe-area-inset-right));
}

button, .btn, a.nav-link, .navbar-brand {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: none) {
    .btn:hover,
    .btn-evaluation:hover,
    .class-card:hover,
    .nav-link:hover {
        transform: none;
        box-shadow: none;
    }
}

/* ビュー切り替え */
.view {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* カードスタイル */
.card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
    margin-bottom: 2rem;
}

.card-header {
    font-weight: bold;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

/* 抽選結果画面のスタイル */
.selected-student-info {
    padding: 2rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 10px;
    margin-bottom: 2rem;
}

#studentName {
    color: #0d6efd;
    font-size: 4rem;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

#studentKana {
    color: #6c757d;
    font-size: 2rem;
    font-weight: 600;
}

/* 評価ボタン */
.btn-evaluation {
    min-width: 150px;
    height: 60px;
    font-size: 1.2rem;
    margin: 0 0.5rem;
    transition: all 0.3s;
}

.btn-evaluation:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-evaluation i {
    font-size: 1.5rem;
}

/* プログレスバー */
.progress {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    font-size: 1.2rem;
    font-weight: bold;
    transition: width 0.6s ease;
}

/* 状態表示 */
.alert-info {
    background-color: #e7f3ff;
    border-color: #b3d9ff;
    color: #004085;
}

/* テーブルスタイル */
.table {
    background-color: white;
}

.table thead {
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: #f1f3f5;
    cursor: pointer;
}

/* クラスカード */
.class-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background-color: white;
    transition: all 0.3s;
}

.class-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.class-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.class-card-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #0d6efd;
    margin: 0;
}

.class-card-actions {
    display: flex;
    gap: 0.5rem;
}

.class-card-info {
    color: #6c757d;
    font-size: 0.9rem;
}

.class-card-info p {
    margin: 0.25rem 0;
}

/* ボタンスタイル */
.btn {
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.25rem;
}

/* トーストメッセージ */
.toast {
    min-width: 300px;
}

.toast-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.toast-error {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.toast-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #997404;
}

/* モーダル */
.modal-content {
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 評価バッジ */
.badge-evaluation {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

.badge-evaluation-A {
    background-color: #198754;
}

.badge-evaluation-B {
    background-color: #0d6efd;
}

.badge-evaluation-C {
    background-color: #ffc107;
    color: #000;
}

/* ナビゲーションバー */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-link {
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    #studentName {
        font-size: 2.5rem;
    }

    #studentKana {
        font-size: 1.5rem;
    }

    .btn-evaluation {
        min-width: 100px;
        height: 56px;
        font-size: 1rem;
        margin: 0.25rem;
    }

    .selected-student-info {
        padding: 1rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .btn {
        min-height: 44px;
    }

    .nav-link {
        padding: 0.75rem 1rem !important;
    }

    /* iOS Safari: font-size 16px未満でフォーカス時にズームしてしまうのを防ぐ */
    input.form-control,
    select.form-select,
    textarea.form-control {
        font-size: 16px;
    }
}

/* ローディング表示 */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* ファイル選択 */
.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 252, 0.25);
}

/* スクロールバーのカスタマイズ（Webkit系ブラウザ） */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 印刷対応 */
@media print {
    .navbar,
    .btn,
    .card-header {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #000;
    }

    body {
        background-color: white;
    }
}

/* アクセシビリティ対応 */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* アニメーション */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse-animation {
    animation: pulse 0.5s ease-in-out;
}

/* エラー表示 */
.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.is-invalid {
    border-color: #dc3545;
}

/* 成功表示 */
.success-message {
    color: #198754;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.is-valid {
    border-color: #198754;
}

/* 空の状態表示 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
}

/* ステータス表示 */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-indicator-active {
    background-color: #198754;
}

.status-indicator-inactive {
    background-color: #6c757d;
}
