/* aiedu-olympia.css */
:root {
    --olympia-font-size: 24px;
}

.aiedu-olympia-container {
    --olympia-font-size: 24px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: transparent;
    border-radius: 12px;
    padding: 8px 0;
    color: #1f2937;
    box-sizing: border-box;
    width: 100%;
}

/* Setup Screen */
.aiedu-olympia-setup {
    max-width: 1080px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: 4px solid #dc2626;
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 4px 10px -4px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
}

.aiedu-premium-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.3;
    margin-top: 0;
}

.aiedu-olympia-setup .aiedu-form-group {
    margin-bottom: 16px;
}

.aiedu-olympia-setup label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    color: #1e293b;
}

.aiedu-olympia-setup input,
.aiedu-olympia-setup select,
.aiedu-premium-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    background-color: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 44px;
}

.aiedu-olympia-setup input:focus,
.aiedu-olympia-setup select:focus,
.aiedu-premium-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Olympia Horizontal Form Layouts */
.olympia-2col-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.olympia-reps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.olympia-rep-col {
    background: #ffffff;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid #e9d5ff;
    box-shadow: 0 2px 4px rgba(134,25,143,0.05);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.olympia-rep-col:hover {
    border-color: #c084fc;
    box-shadow: 0 4px 8px rgba(134,25,143,0.1);
}

@media (max-width: 992px) {
    .olympia-reps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .olympia-2col-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 540px) {
    .olympia-reps-grid {
        grid-template-columns: 1fr;
    }
}

/* Header */
.olympia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.olympia-question-counter {
    font-size: calc(var(--aiedu-base-font-size, 16px) * 2.0);
    font-weight: bold;
    color: #2563eb;
}

.olympia-timer {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    border-radius: 50%;
    background: #fee2e2;
    border: 4px solid #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--aiedu-base-font-size, 16px) * 2.2);
    font-weight: 900;
    color: #b91c1c;
    text-align: center;
    overflow: hidden;
    box-sizing: border-box;
    padding: 2px;
    line-height: 1;
    flex-shrink: 0;
}

.olympia-timer.time-up {
    background: #fef2f2;
    border-color: #dc2626;
    box-shadow: 0 0 14px rgba(220, 38, 38, 0.45);
}

.olympia-timer.time-up #olympia-time-text {
    font-size: 13px !important;
    font-weight: 900;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: -0.2px;
    color: #dc2626;
    display: block;
    max-width: 66px;
    word-break: break-word;
    text-align: center;
}

.olympia-actions button {
    margin-left: 10px;
    padding: 10px 15px;
    border-radius: 6px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
}

/* Question Area */
.olympia-question-box {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.olympia-question-title {
    font-size: var(--olympia-font-size, 24px);
    font-weight: bold;
    color: #111827;
    margin-bottom: 20px;
    line-height: 1.4;
}

.olympia-option-item {
    font-size: calc(var(--olympia-font-size, 24px) * 0.9);
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #f3f4f6;
    border-radius: 8px;
    border: 2px solid transparent;
}

/* Modern Generate Button */
.olympia-btn-generate-modern {
    width: 100%;
    margin-top: 20px;
    padding: 16px 24px;
    font-size: 19px;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4), 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
}
.olympia-btn-generate-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -4px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
}
.olympia-btn-generate-modern:active {
    transform: translateY(1px);
    box-shadow: 0 6px 15px -2px rgba(37, 99, 235, 0.4);
}

/* Teams Panel */
.olympia-teams-panel {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.olympia-teams-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.olympia-team-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px 22px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.olympia-team-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

/* Viền màu hổ phách khi học viên/đội đã nộp hoặc chọn đáp án (bảo mật) */
.olympia-team-card.team-has-answered {
    border: 3.5px solid #f59e0b !important;
    background: #fffbeb !important;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.35) !important;
    transform: translateY(-2px);
}

.olympia-team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1.5px solid #f1f5f9;
}

/* Tăng gấp đôi kích thước font chữ trong các ô đội */
.olympia-team-name {
    font-size: 34px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin: 0;
    line-height: 1.2;
}

.olympia-team-score {
    font-size: 24px;
    font-weight: 800;
    color: #1e40af;
    background: #eff6ff;
    padding: 6px 18px;
    border-radius: 24px;
    border: 1.5px solid #bfdbfe;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.olympia-team-score span {
    font-size: 34px;
    font-weight: 900;
    color: #2563eb;
    line-height: 1;
}

.olympia-team-rep-bar {
    font-size: 20px !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    border: 1.5px solid #e2e8f0 !important;
}

.olympia-rep-name-text {
    font-size: 20px !important;
    font-weight: 900 !important;
}

.olympia-btn-change-rep-inline {
    font-size: 15px !important;
    padding: 4px 12px !important;
    font-weight: 800 !important;
    border-radius: 6px !important;
}

.olympia-team-sub-status {
    font-size: 20px !important;
    font-weight: 800 !important;
    min-height: 32px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.olympia-team-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
}

.olympia-opt-btn {
    width: 66px;
    height: 66px;
    font-size: 34px;
    border-radius: 14px;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.olympia-opt-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.olympia-opt-btn.selected {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    transform: scale(1.05);
}

/* Grading effects */
.olympia-team-card.correct-ans {
    border-color: #22c55e !important;
    background: #f0fdf4 !important;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.3) !important;
}
.olympia-team-card.wrong-ans {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.3) !important;
}
.olympia-team-card .highlight-correct {
    background: #22c55e !important;
    color: #ffffff !important;
    border-color: #16a34a !important;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5) !important;
}
.olympia-team-card .highlight-wrong {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5) !important;
}

/* Explanation */
.olympia-explanation {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    padding: 15px;
    margin-top: 20px;
    border-radius: 0 8px 8px 0;
}

/* Hide specific controls on student screen */
[data-role="student"] .aiedu-student-hidden {
    display: none !important;
}
[data-role="student"] .olympia-opt-btn {
    pointer-events: none !important;
}

.olympia-btn-grade {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    margin: 0;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 15px;
    color: #ffffff;
    cursor: pointer;
    text-transform: uppercase;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.olympia-btn-grade:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}
.olympia-btn-grade:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}
