/*
 * ACADEMIC NOIR - Premium Exam Reviewer
 * UI Components: Buttons, Panels, Forms, Modals
 */

/* ========================================
   BUTTONS & NAVIGATION CONTROLS
   ======================================== */

/* Navigation Buttons */
.nav-btn {
    background: transparent;
    border: var(--border-thin);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.3s var(--ease-smooth);
    z-index: -1;
}

.nav-btn:hover::before {
    opacity: 0.1;
}

.nav-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.nav-btn.prev, .nav-btn.next {
    background: rgba(212, 175, 55, 0.05);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 600;
}

.nav-btn.reset {
    border-color: var(--error);
    color: var(--error);
}

.nav-btn.reset:hover {
    background: rgba(196, 69, 69, 0.1);
}

.nav-btn.theme {
    padding: var(--space-sm) var(--space-md);
    font-size: 1.2rem;
}

.nav-btn.help {
    font-weight: 700;
    font-size: 1.1rem;
}

/* ========================================
   PANELS (Question & Rationalization)
   ======================================== */
.panel {
    background: var(--bg-panel);
    border: var(--border-thin);
    border-radius: 8px;
    padding: var(--space-xl);
    box-shadow: var(--shadow-deep);
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.6;
}

.panel-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: var(--border-thin);
}

.panel-badge {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-primary);
    background: rgba(212, 175, 55, 0.1);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 2px;
    margin-bottom: var(--space-sm);
}

/* Question Panel */
.question-text {
    font-family: var(--font-body);
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
    font-weight: 400;
}

/* ========================================
   OPTIONS & FORMS
   ======================================== */

/* Options List */
.options-container {
    margin-top: var(--space-lg);
}

.options-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin: 0;
    padding: 0;
}

.options-list li {
    background: var(--bg-primary);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 6px;
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    position: relative;
    overflow: hidden;
}

.options-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-primary);
    transform: scaleY(0);
    transition: transform 0.3s var(--ease-smooth);
}

.options-list li:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.options-list li:hover::before {
    transform: scaleY(1);
}

.options-list li input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
}

.options-list li input[type="radio"]:checked {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.options-list li label {
    cursor: pointer;
    flex: 1;
    font-size: 1.05rem;
    line-height: 1.5;
}

/* Answer States */
.options-list li.correct-answer {
    background: rgba(74, 158, 95, 0.15);
    border-color: var(--success);
}

.options-list li.correct-answer::before {
    background: var(--success);
    transform: scaleY(1);
}

.options-list li.wrong-answer {
    background: rgba(196, 69, 69, 0.15);
    border-color: var(--error);
    opacity: 0.8;
}

.options-list li.wrong-answer::before {
    background: var(--error);
    transform: scaleY(1);
}

.options-list li.selected-answer {
    border: 2px solid var(--accent-primary);
    background: rgba(212, 175, 55, 0.1);
    transform: translateX(6px);
}

.options-list li.disabled {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

/* ========================================
   RATIONALIZATION PANEL
   ======================================== */
.rationalization-panel {
    opacity: 0;
    transform: translateY(20px);
    max-height: 0;
    overflow: hidden;
    padding: 0;
    transition: all 0.6s var(--ease-smooth);
}

.rationalization-panel.visible {
    opacity: 1;
    transform: translateY(0);
    max-height: 2000px;
    padding: var(--space-xl);
}

.rationalization-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--accent-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rationalization-content {
    margin-top: var(--space-lg);
}

.rationalization-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    font-style: italic;
}

.correct-answer-box {
    background: rgba(74, 158, 95, 0.1);
    border: 1px solid var(--success);
    border-radius: 6px;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm) var(--space-md);
}

.correct-label {
    font-family: var(--font-display);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--success);
    white-space: nowrap;
}

.correct-answer-text {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

/* ========================================
   SCORE DISPLAY
   ======================================== */
.score-display {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(74, 158, 95, 0.1);
    padding: var(--space-sm) var(--space-md);
    border-radius: 4px;
    border: 1px solid rgba(74, 158, 95, 0.3);
}

.score-label {
    font-family: var(--font-display);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.score-value {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--success);
    font-size: 1rem;
}

.score-percentage {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========================================
   SPEECH CONTROLS
   ======================================== */
.speech-controls {
    margin-top: var(--space-lg);
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

.speech-btn {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.speech-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: translateY(-2px);
}

.speech-btn.stop {
    border-color: var(--error);
    color: var(--error);
    background: rgba(196, 69, 69, 0.1);
}

.speech-btn.stop:hover {
    background: rgba(196, 69, 69, 0.2);
}

/* ========================================
   CONFIRMATION MODAL
   ======================================== */
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease-smooth), visibility 0.3s;
}

.confirm-modal.visible {
    opacity: 1;
    visibility: visible;
}

.confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 5, 5, 0.85);
    backdrop-filter: blur(8px);
}

.confirm-dialog {
    position: relative;
    background: var(--bg-panel);
    border: 2px solid var(--accent-primary);
    border-radius: 12px;
    padding: var(--space-2xl);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 60px rgba(212, 175, 55, 0.2), var(--shadow-deep);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s var(--ease-bounce);
}

.confirm-modal.visible .confirm-dialog {
    transform: scale(1) translateY(0);
}

.confirm-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    color: var(--warning);
    animation: pulse 2s infinite;
}

.confirm-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--text-primary);
    margin: 0 0 var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.confirm-message {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 var(--space-xl);
}

.confirm-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.confirm-btn {
    padding: var(--space-sm) var(--space-xl);
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    min-width: 100px;
}

.confirm-btn.cancel {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
}

.confirm-btn.cancel:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.confirm-btn.confirm {
    background: linear-gradient(135deg, var(--error), #a33);
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(196, 69, 69, 0.3);
}

.confirm-btn.confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 69, 69, 0.4);
}

/* ========================================
   KEYBOARD SHORTCUTS MODAL
   ======================================== */
.shortcuts-dialog {
    max-width: 450px;
    text-align: left;
}

.shortcuts-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.shortcuts-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--accent-primary);
}

.shortcuts-list {
    margin-bottom: var(--space-xl);
}

.shortcuts-table {
    width: 100%;
    border-collapse: collapse;
}

.shortcuts-table tr {
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

.shortcuts-table tr:last-child {
    border-bottom: none;
}

.shortcuts-table td {
    padding: var(--space-sm) var(--space-xs);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.shortcuts-table .shortcut-key {
    text-align: right;
    padding-right: var(--space-md);
    white-space: nowrap;
    width: 45%;
}

kbd {
    display: inline-block;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.1) 100%);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-primary);
    box-shadow: 0 2px 0 rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
    min-width: 24px;
    text-align: center;
}

/* ========================================
   LOADING OVERLAY
   ======================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s var(--ease-smooth), visibility 0.5s;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-family: var(--font-display);
    color: var(--accent-primary);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}