/* ACT Science Passage - Shared Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
}

/* Top bar */
.act-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.act-header h1 {
    font-size: 1.1rem;
    font-weight: 600;
}

.act-header .passage-type {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.timer {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    background: rgba(0,0,0,0.2);
    padding: 6px 14px;
    border-radius: 8px;
}

.back-link {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.back-link:hover { opacity: 1; }

/* Main layout: passage left, questions right */
.act-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    height: calc(100vh - 52px);
}

/* Passage panel */
.passage-panel {
    background: white;
    border-right: 2px solid #e2e8f0;
    overflow-y: auto;
    padding: 24px 28px;
}

.passage-panel h2 {
    font-size: 1.3rem;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #667eea;
}

.passage-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #334155;
    margin-bottom: 20px;
}

.passage-text p {
    margin-bottom: 14px;
}

/* Figures */
.figure-container {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
}

.figure-container h3 {
    font-size: 0.95rem;
    color: #475569;
    text-align: center;
    margin-bottom: 12px;
    font-weight: 600;
}

.figure-container canvas {
    max-width: 100%;
    max-height: 300px;
}

/* Data tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 8px 0;
}

.data-table th {
    background: #667eea;
    color: white;
    padding: 10px 14px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.data-table td {
    padding: 8px 14px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}

.data-table tr:nth-child(even) {
    background: #f8fafc;
}

.data-table tr:hover {
    background: #eef2ff;
}

/* Apparatus diagram (styled box description) */
.apparatus-diagram {
    background: #fefce8;
    border: 2px solid #fbbf24;
    border-radius: 10px;
    padding: 16px 20px;
    margin: 12px 0;
}

.apparatus-diagram h4 {
    font-size: 0.9rem;
    color: #92400e;
    margin-bottom: 8px;
}

.apparatus-diagram ul {
    list-style: none;
    padding: 0;
}

.apparatus-diagram li {
    padding: 4px 0;
    font-size: 0.88rem;
    color: #78350f;
}

.apparatus-diagram li::before {
    content: '▸ ';
    color: #d97706;
    font-weight: bold;
}

/* Scientist viewpoints (conflicting viewpoints) */
.scientist-view {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    border-radius: 0 10px 10px 0;
    padding: 16px 20px;
    margin: 16px 0;
}

.scientist-view:nth-of-type(even) {
    background: #eff6ff;
    border-left-color: #3b82f6;
}

.scientist-view:nth-of-type(3) {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.scientist-view:nth-of-type(4) {
    background: #fce7f3;
    border-left-color: #ec4899;
}

.scientist-view h3 {
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 8px;
}

.scientist-view p {
    font-size: 0.92rem;
    line-height: 1.65;
    color: #334155;
}

/* Questions panel */
.questions-panel {
    background: #fafbfc;
    overflow-y: auto;
    padding: 24px 28px;
}

.question-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #64748b;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Question card */
.question-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.question-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.question-number {
    font-weight: 700;
    color: #667eea;
    font-size: 0.85rem;
}

.crs-badge {
    background: #eef2ff;
    color: #667eea;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.question-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #1e293b;
    margin-bottom: 16px;
    font-weight: 500;
}

/* Answer options */
.options-list {
    list-style: none;
    padding: 0;
}

.option-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 0.95rem;
    color: #334155;
    transition: all 0.2s;
    font-family: inherit;
}

.option-btn:hover {
    border-color: #667eea;
    background: #eef2ff;
}

.option-btn.selected {
    border-color: #667eea;
    background: #eef2ff;
    font-weight: 600;
}

.option-btn.correct {
    border-color: #22c55e;
    background: #dcfce7;
    color: #166534;
}

.option-btn.incorrect {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}

.option-btn .option-letter {
    font-weight: 700;
    margin-right: 8px;
    color: #667eea;
}

.option-btn.correct .option-letter { color: #22c55e; }
.option-btn.incorrect .option-letter { color: #ef4444; }

/* Explanation */
.explanation {
    display: none;
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-top: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #166534;
}

.explanation.show { display: block; }

/* Navigation */
.question-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: inherit;
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-btn.prev {
    background: #f1f5f9;
    color: #475569;
}

.nav-btn.prev:hover:not(:disabled) { background: #e2e8f0; }

.nav-btn.next {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nav-btn.next:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-btn.submit {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.nav-btn.submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* Question dots */
.question-dots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.q-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}

.q-dot.active {
    border-color: #667eea;
    color: #667eea;
    background: #eef2ff;
}

.q-dot.answered {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.q-dot.correct-dot {
    border-color: #22c55e;
    background: #22c55e;
    color: white;
}

.q-dot.incorrect-dot {
    border-color: #ef4444;
    background: #ef4444;
    color: white;
}

/* Results overlay */
.results-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.results-overlay.show {
    display: flex;
}

.results-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.results-card h2 {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 8px;
}

.results-card .score-big {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 16px 0;
}

.results-card .score-detail {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 24px;
}

.results-card .crs-summary {
    text-align: left;
    margin: 20px 0;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
}

.results-card .crs-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9rem;
    color: #475569;
}

.results-card .btn-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.results-card .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
}

.results-card .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.results-card .btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* Mobile responsive */
@media (max-width: 900px) {
    .act-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .passage-panel {
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
        max-height: 50vh;
    }

    .questions-panel {
        max-height: none;
    }
}
