/* ── Online Exam Plugin – Public CSS ── */
:root {
    --oe-primary: #dc2626;
    --oe-primary-dark: #b91c1c;
    --oe-success: #059669;
    --oe-warning: #d97706;
    --oe-danger: #dc2626;
    --oe-info: #0284c7;
    --oe-bg: #f8fafc;
    --oe-border: #e2e8f0;
    --oe-radius: 10px;
    --oe-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

/* ── Wraps ── */
.oe-rules-wrap {
    max-width: 780px;
    line-height: 1.8;
}

.oe-leaderboard-wrap,
.oe-hof-wrap,
#oe-register-section {
    max-width: 860px;
    margin: 0 auto;
}

/* ── Notice ── */
.oe-notice {
    padding: 10px 14px;
    border-radius: 6px;
    background: #f0f9ff;
    border-left: 4px solid var(--oe-info);
    margin-bottom: 16px;
}

.oe-notice--warn {
    background: #fffbeb;
    border-color: var(--oe-warning);
}

.oe-notice--error {
    background: #fef2f2;
    border-color: var(--oe-danger);
}

.oe-notice--success {
    background: #f0fdf4;
    border-color: var(--oe-success);
}

/* ── Buttons ── */
.oe-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 15px;
    transition: all .2s;
}

.oe-btn--primary {
    background: var(--oe-primary);
    color: #fff;
}

.oe-btn--primary:hover {
    background: var(--oe-primary-dark);
}

.oe-btn--success {
    background: var(--oe-success);
    color: #fff;
}

.oe-btn--success:hover {
    background: #047857;
}

.oe-btn--lg {
    padding: 14px 32px;
    font-size: 17px;
}

.oe-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ── Exam list cards ── */
.oe-exam-filter-wrap {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 15px !important;
    margin-bottom: 24px !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
    height: auto !important;
    padding: 0 !important;
}

.oe-page-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    color: var(--oe-primary) !important;
    border-bottom: none !important;
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    line-height: 1 !important;
}

.oe-sort-controls {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
}

.oe-sort-controls label {
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #475569 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    display: inline-block !important;
    line-height: 1 !important;
}

.oe-sort-select {
    width: 240px !important;
    max-width: 100% !important;
    padding: 8px 14px !important;
    margin: 0 !important;
    border: 1.5px solid var(--oe-border) !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background-color: #fff !important;
    cursor: pointer;
    outline: none !important;
    transition: all 0.2s;
    height: 38px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

.oe-sort-select:focus {
    border-color: var(--oe-primary) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .12) !important;
}

.oe-exam-list {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.oe-exam-card {
    background: #fff;
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius);
    padding: 20px;
    box-shadow: var(--oe-shadow);
}

.oe-exam-thumb-wrap {
    width: 100%;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.oe-exam-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.oe-exam-card:hover .oe-exam-thumb-wrap img {
    transform: scale(1.05);
}

.oe-exam-card h3 { margin: 0 0 8px; font-size: 17px; transition: color 0.2s ease; }
.oe-exam-title-link { text-decoration: none !important; color: inherit !important; display: block; }
.oe-exam-title-link:hover h3 { color: var(--oe-primary) !important; }

.oe-exam-countdown-btn-placeholder {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    color: #dc2626;
    border: 1.5px dashed #fca5a5;
    background-color: #fef2f2;
    border-radius: 8px;
    box-sizing: border-box;
}

.oe-exam-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    font-size: 13px;
    color: #64748b;
    justify-content: space-between;
}

.oe-exam-excerpt {
    font-size: 14px;
    color: #475569;
    margin-bottom: 14px;
}

.oe-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.oe-badge--quiz {
    background: #ede9fe;
    color: #6d28d9;
}

.oe-badge--essay {
    background: #dcfce7;
    color: #15803d;
}

.oe-badge--mixed {
    background: #fef3c7;
    color: #b45309;
}

.oe-badge--status-open {
    background: #dcfce7;
    color: #15803d;
}

.oe-badge--status-upcoming {
    background: #e0f2fe;
    color: #0369a1;
}

.oe-badge--status-closed {
    background: #fee2e2;
    color: #b91c1c;
}

.oe-badge--status-grading {
    background: #fef3c7;
    color: #b45309;
}

.oe-badge--status-finished {
    background: #f3f4f6;
    color: #374151;
}

/* ── Section title ── */
.oe-section-title {
    font-size: 22px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--oe-primary);
    color: var(--oe-primary);
}

/* ── Form ── */
.oe-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

.oe-col-2 {
    grid-column: 1 / -1;
}

.oe-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.oe-form-group input,
.oe-form-group select,
.oe-form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--oe-border);
    border-radius: 7px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color .2s;
}

.oe-form-group input:focus,
.oe-form-group select:focus,
.oe-form-group textarea:focus {
    outline: none;
    border-color: var(--oe-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}

.req {
    color: var(--oe-danger);
}

.oe-form-actions {
    margin-top: 6px;
}

/* ── Timer ── */
.oe-exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.oe-timer-wrap {
    text-align: center;
    background: var(--oe-bg);
    padding: 10px 18px;
    border-radius: 8px;
    border: 2px solid var(--oe-border);
}

.oe-timer-label {
    display: block;
    font-size: 12px;
    color: #64748b;
}

.oe-timer {
    font-size: 28px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.oe-timer.warning {
    color: var(--oe-warning);
}

.oe-timer.danger {
    color: var(--oe-danger);
    animation: oe-blink .8s infinite;
}

@keyframes oe-blink {
    50% {
        opacity: .4;
    }
}

/* ── Question cards ── */
.oe-question-card {
    background: #fff;
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--oe-shadow);
}

.oe-question-num {
    font-size: 12px;
    font-weight: 600;
    color: var(--oe-primary);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
}

.oe-question-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 14px;
}

.oe-options {
    display: grid;
    gap: 8px;
}

.oe-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid var(--oe-border);
    border-radius: 7px;
    cursor: pointer;
    transition: all .15s;
    font-size: 15px;
}

.oe-option-label:hover {
    border-color: var(--oe-primary);
    background: #f5f3ff;
}

.oe-option-label input {
    accent-color: var(--oe-primary);
    width: 17px;
    height: 17px;
}

.oe-option-label.selected {
    border-color: var(--oe-primary);
    background: #ede9fe;
}

/* ── Essay ── */
.oe-essay-wrap {
    background: #fff;
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius);
    padding: 20px;
    margin-bottom: 16px;
}

.oe-essay-wrap h3 {
    margin-top: 0;
}

#oe-essay-text {
    width: 100%;
    font-size: 15px;
    border: 1.5px solid var(--oe-border);
    border-radius: 7px;
    padding: 12px;
    box-sizing: border-box;
    resize: vertical;
}

.oe-upload-area {
    margin-top: 14px;
}

.oe-upload-area label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

/* ── Submit wrap ── */
.oe-submit-wrap {
    text-align: center;
    padding: 20px 0;
}

/* ── Msg ── */
.oe-msg {
    padding: 12px 16px;
    border-radius: 7px;
    margin-top: 14px;
}

.oe-msg.success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.oe-msg.error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* ── Result card ── */
.oe-result-card {
    text-align: center;
    background: #fff;
    border-radius: 14px;
    padding: 40px 30px;
    box-shadow: var(--oe-shadow);
}

.oe-result-icon {
    font-size: 56px;
    margin-bottom: 12px;
}

.oe-result-score {
    font-size: 52px;
    font-weight: 800;
    color: var(--oe-primary);
    margin: 10px 0;
}

.oe-result-detail {
    max-width: 500px;
    margin: 16px auto 0;
    text-align: left;
}

/* ── Tabs ── */
.oe-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 2px solid var(--oe-border);
    padding-bottom: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.oe-tab {
    background: none;
    border: 1.5px solid var(--oe-border);
    padding: 7px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    transition: all .15s;
}

.oe-tab.active,
.oe-tab:hover {
    background: var(--oe-primary);
    color: #fff;
    border-color: var(--oe-primary);
}

.oe-tab-content {
    display: none;
}

.oe-tab-content.active {
    display: block;
}

.oe-tab-exam-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.oe-tab-exam-select select {
    padding: 7px 10px;
    border: 1.5px solid var(--oe-border);
    border-radius: 6px;
    font-size: 14px;
}

/* ── Leaderboard table ── */
.oe-lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.oe-lb-table th {
    background: var(--oe-primary);
    color: #fff;
    padding: 10px 14px;
    text-align: left;
}

.oe-lb-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--oe-border);
}

.oe-lb-table tr:last-child td {
    border-bottom: none;
}

.oe-top-1 td {
    background: #fef9c3;
    font-weight: 700;
}

.oe-top-2 td {
    background: #f1f5f9;
}

.oe-top-3 td {
    background: #fef3c7;
}

.oe-rank {
    font-size: 20px;
    width: 40px;
}

.oe-score {
    font-weight: 700;
    font-size: 16px;
    color: var(--oe-primary);
}

.oe-honor-badge {
    background: #fbbf24;
    color: #78350f;
    border-radius: 20px;
    font-size: 11px;
    padding: 1px 7px;
    margin-left: 6px;
}

.oe-lb-caption {
    color: #64748b;
    font-size: 13px;
    text-align: right;
    margin-top: 6px;
}

/* ── Hall of Fame ── */
.oe-hof-wrap {
    max-width: 940px;
    margin: 0 auto;
}

.oe-hof-header {
    text-align: center;
    margin-bottom: 28px;
}

.oe-hof-icon {
    font-size: 52px;
    display: block;
}

.oe-hof-header h2 {
    font-size: 28px;
    margin: 8px 0 4px;
}

.oe-hof-header p {
    color: #64748b;
}

.oe-hof-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.oe-hof-card {
    background: #fff;
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius);
    padding: 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    box-shadow: var(--oe-shadow);
    position: relative;
    transition: transform .15s;
}

.oe-hof-card:hover {
    transform: translateY(-2px);
}

.oe-hof-top {
    border-top: 3px solid #fbbf24;
}

.oe-hof-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--oe-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.oe-hof-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.oe-hof-name {
    font-size: 15px;
    font-weight: 700;
}

.oe-hof-exam {
    font-size: 12px;
    color: #64748b;
}

.oe-hof-score {
    font-size: 13px;
    color: var(--oe-primary);
    font-weight: 600;
}

.oe-hof-week {
    font-size: 11px;
    color: #94a3b8;
}

.oe-hof-crown {
    position: absolute;
    top: -10px;
    right: 12px;
    font-size: 22px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .oe-form-grid {
        grid-template-columns: 1fr;
    }

    .oe-exam-list {
        grid-template-columns: 1fr;
    }

    .oe-hof-grid {
        grid-template-columns: 1fr;
    }

    .oe-exam-header {
        flex-direction: column;
        gap: 12px;
    }
}