/* Custom Styles for Mock O-NET Grade 6 Exam */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Prompt:wght@400;500;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --onet-navy: #1e3a8a;
    --onet-amber: #d97706;
    --onet-bg: #f8fafc;
}

body {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--onet-bg);
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-heading {
    font-family: 'Prompt', 'Sarabun', sans-serif;
}

/* O-NET Bubble Sheet Styling */
.bubble-option {
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
}

.bubble-option:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.bubble-option.selected {
    background-color: #1e3a8a;
    color: #ffffff;
    border-color: #1e3a8a;
    box-shadow: 0 4px 6px -1px rgba(30, 58, 138, 0.2);
}

.bubble-option.selected .bubble-circle {
    background-color: #ffffff;
    color: #1e3a8a;
    font-weight: 700;
}

.bubble-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #cbd5e1;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Numeric 3-Digit Grid for Part 2 */
.digit-column {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.digit-header-box {
    background-color: #f1f5f9;
    border: 2px solid #94a3b8;
    border-radius: 0.5rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.digit-bubble {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    border: 1.5px solid #94a3b8;
    background: #ffffff;
    color: #334155;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.25rem auto;
    cursor: pointer;
    transition: all 0.15s ease;
}

.digit-bubble:hover {
    border-color: #2563eb;
    background-color: #dbeafe;
}

.digit-bubble.filled {
    background-color: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

/* Question Palette item state */
.palette-btn {
    transition: all 0.15s ease;
    font-family: 'Prompt', sans-serif;
}

.palette-btn.current {
    ring: 2px;
    ring-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.25);
}

.palette-btn.answered {
    background-color: #10b981;
    color: #ffffff;
    border-color: #059669;
}

.palette-btn.unanswered {
    background-color: #ffffff;
    color: #475569;
    border-color: #cbd5e1;
}

.palette-btn.flagged {
    background-color: #f59e0b;
    color: #ffffff;
    border-color: #d97706;
}

/* KaTeX equations in thai text */
.katex {
    font-size: 1.15em !important;
    text-rendering: auto;
}

.katex-display {
    margin: 0.5em 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 0;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Pulse animation for timer warning */
@keyframes urgent-pulse {
    0%, 100% { background-color: #fee2e2; border-color: #ef4444; color: #b91c1c; }
    50% { background-color: #fca5a5; border-color: #dc2626; color: #7f1d1d; }
}

.timer-warning {
    animation: urgent-pulse 1.5s infinite;
}
