/* aiedu-olympia.css */
:root {
    --olympia-font-size: 24px;
}

.aiedu-olympia-container {
    --olympia-font-size: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

/* Setup Screen */
.aiedu-olympia-setup .aiedu-form-group {
    margin-bottom: 15px;
}

.aiedu-olympia-setup label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #374151;
}

.aiedu-olympia-setup input, .aiedu-olympia-setup select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
}

/* 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;
    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.5);
    font-weight: bold;
    color: #b91c1c;
}

.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(260px, 1fr));
    gap: 20px;
}

.olympia-team-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
    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.03);
    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;
}

.olympia-team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.olympia-team-name {
    font-size: 19px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.2px;
    margin: 0;
}

.olympia-team-score {
    font-size: 15px;
    font-weight: 700;
    color: #1e40af;
    background: #eff6ff;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid #bfdbfe;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.olympia-team-score span {
    font-size: 18px;
    font-weight: 900;
    color: #2563eb;
}

.olympia-team-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.olympia-opt-btn {
    width: 48px;
    height: 48px;
    font-size: 20px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.olympia-opt-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.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;
    background: #f0fdf4;
}
.olympia-team-card.wrong-ans {
    border-color: #ef4444;
    background: #fef2f2;
}
.olympia-team-card .highlight-correct {
    background: #22c55e !important;
    color: #fff !important;
    border-color: #16a34a !important;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* 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;
    width: 100%;
    padding: 18px;
    margin-top: 25px;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    font-size: 22px;
    color: #fff;
    cursor: pointer;
    text-transform: uppercase;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
    letter-spacing: 1px;
}
.olympia-btn-grade:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}
.olympia-btn-grade:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}
