/* static/css/main.css */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

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

/* Timer styling */
.timer {
    font-variant-numeric: tabular-nums;
    font-family: monospace;
}

.timer.warning {
    color: #dc2626;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Answer choice styling - Updated */
.answer-choice {
    transition: all 0.2s ease-in-out;
    border: 2px solid transparent;  /* Changed from 1px to 2px */
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
}

.answer-choice:hover {
    background-color: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.1);
}

.answer-choice.selected {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgb(59, 130, 246);
}

/* Star button - Updated */
.star-button {
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.star-button:active {
    transform: scale(0.95);
}

.star-button.starred {
    color: #fbbf24;
    fill: currentColor;
}

.star-button.starred span {
    color: #f59e0b;
}

.star-button:hover {
    transform: scale(1.05);
    background-color: rgba(251, 191, 36, 0.1);
}

/* Navigation buttons */
.nav-button {
    transition: all 0.2s ease;
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-button:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Progress bar */
.progress-bar {
    transition: width 0.3s ease;
}

/* Passage container */
.passage-container {
    max-height: 50vh;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background-color: #f9fafb;
}

/* Question navigation indicators - New */
.question-nav {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
    padding: 1rem 0;
}

.question-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #e5e7eb;
    transition: all 0.2s ease;
}

.question-indicator.answered {
    background-color: #3b82f6;
}

.question-indicator.starred {
    background-color: #fbbf24;
}

.question-indicator.current {
    border: 2px solid #3b82f6;
}

/* Loading states - New */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
    
    .print-break {
        page-break-before: always;
    }
    
    body {
        padding: 2cm;
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .passage-container {
        max-height: 40vh;
    }
    
    .answer-choice {
        padding: 0.75rem;
    }
    
    .nav-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .question-nav {
        gap: 0.25rem;
    }
}

/* ============================================
   Q-Region Highlight Styles (Inline Markup)
   {{Qn}}...{{/Qn}} passage markup rendered by
   parse_passage_markup(). Lives here (not act-style.css)
   because both the test interface and the attempt review
   page render marked-up passages; main.css is loaded by both.
   ============================================ */

/* Q-Region base styles (always visible) */
.q-region {
    position: relative;
    display: inline;
}

.q-underline {
    text-decoration: underline solid #374151;
    text-decoration-thickness: 2px;
}

.q-number {
    font-size: 0.7em;
    vertical-align: super;
    color: #6b7280;
    margin-left: 1px;
    font-weight: normal;
}

/* Active highlight (current question only) */
.q-region.active .q-underline {
    background-color: #fef3c7;
    padding: 1px 2px;
    border-radius: 2px;
}

.q-region.active .q-number {
    color: #f59e0b;
    font-weight: bold;
}

/* Hover effect for all q-regions */
.q-region:hover .q-underline {
    background-color: #fef9c3;
}

/* Print styles - ensure highlights show in printed tests */
@media print {
    .q-underline {
        text-decoration: underline;
        text-decoration-color: black;
        background-color: transparent !important;
    }

    .q-region.active .q-underline {
        background-color: transparent !important;
    }

    .q-number {
        color: black;
    }
}

/* Dark mode (html.act-dark is set by both the test page and
   base.html from the shared act_dark_mode preference). */
html.act-dark .q-underline {
    text-decoration-color: #d1d5db;
}

html.act-dark .q-number {
    color: #9ca3af;
}

html.act-dark .q-region.active .q-underline {
    background-color: rgba(245, 158, 11, 0.25);
}

html.act-dark .q-region.active .q-number {
    color: #fbbf24;
}

html.act-dark .q-region:hover .q-underline {
    background-color: rgba(245, 158, 11, 0.15);
}
