/* AP Chemistry Rescue - Main Stylesheet */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
    font-family: 'Inter', sans-serif;
}

body {
    background: #ffffff;
    color: #1a1a1a;
}

/* Bluebook Color Scheme */
:root {
    --bluebook-primary: #003087;
    --bluebook-secondary: #0066cc;
    --bluebook-accent: #4d94ff;
    --bluebook-success: #00a651;
    --bluebook-error: #d32f2f;
    --bluebook-warning: #ff9800;
    --bluebook-gray: #f5f5f5;
    --bluebook-dark: #1a1a1a;
    --rescue-orange: #ff6b35;
    --rescue-blue: #004e89;
}

/* Brand Logo Styling */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 20px;
    color: white;
}

.lifebuoy-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rescue-orange);
    border-radius: 50%;
    border: 3px solid white;
    position: relative;
}

.lifebuoy-icon::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
}

.lifebuoy-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 2px solid white;
    border-radius: 50%;
}

/* Main container */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Header */
.exam-header {
    background: var(--bluebook-primary);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Content Area */
.exam-content {
    flex: 1;
    display: flex;
    background: #fafafa;
    min-height: calc(100vh - 140px);
}

/* Question Navigation Sidebar */
.question-nav {
    width: 280px;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
}

/* Main Question Area */
.question-area {
    flex: 1;
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* Footer */
.exam-footer {
    background: white;
    border-top: 2px solid #e0e0e0;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Question Grid for Navigation */
.question-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 20px;
}

.question-box {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.2s;
}

.question-box:hover {
    border-color: var(--bluebook-accent);
    background: #f0f7ff;
}

.question-box.current {
    background: var(--bluebook-primary);
    color: white;
    border-color: var(--bluebook-primary);
}

.question-box.answered {
    background: var(--bluebook-success);
    color: white;
    border-color: var(--bluebook-success);
}

.question-box.flagged {
    position: relative;
}

.question-box.flagged::after {
    content: "🚩";
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 16px;
}

/* Answer Options */
.answer-option {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.answer-option:hover {
    border-color: var(--bluebook-accent);
    background: #fafafa;
}

.answer-option.selected {
    border-color: var(--bluebook-primary);
    background: #f0f7ff;
}

.answer-option.correct {
    border-color: var(--bluebook-success);
    background: #e8f5e9;
}

.answer-option.incorrect {
    border-color: var(--bluebook-error);
    background: #ffebee;
}

.answer-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Explanation Box */
.explanation-box {
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 2px solid;
    display: none;
}

.explanation-box.show {
    display: block;
}

.explanation-box.correct {
    background: #e8f5e9;
    border-color: var(--bluebook-success);
    color: #1b5e20;
}

.explanation-box.incorrect {
    background: #ffebee;
    border-color: var(--bluebook-error);
    color: #b71c1c;
}

/* Timer Display */
.timer-display {
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 20px;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 4px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 15px;
}

.btn-primary {
    background: var(--bluebook-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--bluebook-secondary);
}

.btn-secondary {
    background: white;
    color: var(--bluebook-primary);
    border: 2px solid var(--bluebook-primary);
}

.btn-secondary:hover {
    background: #f0f7ff;
}

.btn-success {
    background: var(--bluebook-success);
    color: white;
}

.btn-danger {
    background: var(--bluebook-error);
    color: white;
}

.btn-rescue {
    background: var(--rescue-orange);
    color: white;
}

.btn-rescue:hover {
    background: #ff8555;
}

/* Setup Screen */
.setup-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #004e89 0%, #ff6b35 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.setup-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Results Screen */
.results-screen {
    min-height: 100vh;
    background: #f5f5f5;
    padding: 40px 20px;
}

.results-card {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Strike-through for answer elimination */
.strikethrough {
    text-decoration: line-through;
    opacity: 0.5;
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background: #e0e0e0;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--bluebook-success);
    transition: width 0.3s ease;
}

/* Unit Checkbox */
.unit-checkbox {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f0f7ff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.unit-checkbox:hover {
    border-color: var(--bluebook-accent);
}

.unit-checkbox.selected {
    border-color: var(--bluebook-primary);
    background: #e3f2fd;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .question-nav {
        display: none;
    }
    
    .question-area {
        padding: 20px;
    }

    .exam-footer {
        flex-direction: column;
        gap: 10px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .brand-logo {
        color: black;
    }
}
