/* AP Biology Practice Test - Teal/Emerald Theme (distinct from CollegeBoard navy) */

:root {
    --apbio-primary: #0d7a5f;
    --apbio-primary-dark: #095c47;
    --apbio-primary-light: #e6f5f1;
    --apbio-secondary: #1a9e7a;
    --apbio-accent: #f0a500;
    --apbio-accent-light: #fff8e6;
    --apbio-success: #16a34a;
    --apbio-success-light: #dcfce7;
    --apbio-danger: #dc2626;
    --apbio-danger-light: #fee2e2;
    --apbio-neutral: #64748b;
    --apbio-border: #e2e8f0;
    --apbio-bg: #f0faf6;
    --apbio-surface: #ffffff;
    --apbio-text: #1e293b;
    --apbio-text-muted: #64748b;
    --apbio-radius: 12px;
    --apbio-shadow: 0 4px 16px rgba(13, 122, 95, 0.1);
    --apbio-shadow-hover: 0 8px 24px rgba(13, 122, 95, 0.18);
}

.apbio-container * { box-sizing: border-box; }

.apbio-container {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    max-width: 860px;
    margin: 0 auto;
    background: var(--apbio-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(13,122,95,0.1), var(--apbio-shadow);
}

/* ═══ HEADER ═══ */
.apbio-header {
    background: linear-gradient(135deg, var(--apbio-primary) 0%, #0a5c46 50%, #0d6e5b 100%);
    padding: 20px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.apbio-header-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.apbio-logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.apbio-logo-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1;
}

.apbio-logo-subtitle {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 2px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.apbio-header-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.apbio-badge {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 600;
}

.apbio-timer {
    font-size: 16px;
    font-weight: 600;
    background: rgba(255,255,255,0.15);
    padding: 6px 14px;
    border-radius: 20px;
}

/* ═══ SCREENS ═══ */
.apbio-screen {
    padding: 28px;
    min-height: 480px;
}

/* ═══ SETUP SCREEN ═══ */
.apbio-setup-card {
    max-width: 600px;
    margin: 0 auto;
}

.apbio-setup-card h2 {
    color: var(--apbio-primary-dark);
    font-size: 24px;
    margin: 0 0 8px;
}

.apbio-setup-desc {
    color: var(--apbio-text-muted);
    margin-bottom: 28px;
    font-size: 15px;
}

.apbio-form-group {
    margin-bottom: 20px;
}

.apbio-form-group label {
    display: block;
    font-weight: 600;
    color: var(--apbio-text);
    margin-bottom: 8px;
    font-size: 14px;
}

.apbio-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--apbio-border);
    border-radius: var(--apbio-radius);
    font-size: 15px;
    color: var(--apbio-text);
    background: var(--apbio-surface);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color 0.2s;
}

.apbio-select:focus {
    outline: none;
    border-color: var(--apbio-primary);
    box-shadow: 0 0 0 3px rgba(13,122,95,0.12);
}

.apbio-exam-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.apbio-info-item {
    background: var(--apbio-primary-light);
    border: 1px solid rgba(13,122,95,0.15);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--apbio-text);
}

.apbio-info-item strong { display: block; color: var(--apbio-primary-dark); }
.apbio-info-icon { font-size: 20px; }

/* ═══ BUTTONS ═══ */
.apbio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--apbio-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
}

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

.apbio-btn-primary {
    background: var(--apbio-primary);
    color: white;
    border-color: var(--apbio-primary);
    width: 100%;
    font-size: 16px;
    padding: 14px;
}

.apbio-btn-primary:hover:not(:disabled) {
    background: var(--apbio-primary-dark);
    border-color: var(--apbio-primary-dark);
    box-shadow: var(--apbio-shadow-hover);
    transform: translateY(-1px);
}

.apbio-btn-secondary {
    background: white;
    color: var(--apbio-primary);
    border-color: var(--apbio-border);
}

.apbio-btn-secondary:hover:not(:disabled) {
    border-color: var(--apbio-primary);
    background: var(--apbio-primary-light);
}

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

.apbio-btn-success:hover:not(:disabled) {
    background: #15803d;
}

/* ═══ LOADING SCREEN ═══ */
.apbio-loading-card {
    text-align: center;
    padding: 60px 20px;
}

.apbio-loading-card h3 {
    color: var(--apbio-primary-dark);
    font-size: 22px;
    margin-bottom: 8px;
}

.apbio-loading-card p {
    color: var(--apbio-text-muted);
}

/* DNA Loader */
.apbio-dna-loader {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0 auto 32px;
    height: 60px;
}

.apbio-dna-strand {
    width: 8px;
    height: 60px;
    background: linear-gradient(180deg, var(--apbio-primary), var(--apbio-accent));
    border-radius: 4px;
    animation: apbio-dna 1.2s ease-in-out infinite;
    transform-origin: center;
}

.apbio-dna-strand-2 {
    animation-delay: 0.6s;
    background: linear-gradient(180deg, var(--apbio-accent), var(--apbio-primary));
}

@keyframes apbio-dna {
    0%, 100% { transform: scaleY(0.4); opacity: 0.6; }
    50% { transform: scaleY(1); opacity: 1; }
}

/* Loading dots */
.apbio-loading-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.apbio-loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--apbio-primary);
    border-radius: 50%;
    animation: apbio-dots 1.4s ease-in-out infinite;
}

.apbio-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.apbio-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes apbio-dots {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ═══ TEST SCREEN ═══ */

/* Progress bar */
.apbio-progress-bar {
    height: 6px;
    background: var(--apbio-border);
    margin: -28px -28px 20px;
    overflow: hidden;
}

.apbio-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--apbio-primary), var(--apbio-accent));
    transition: width 0.4s ease;
    width: 0%;
}

/* Question navigation */
.apbio-question-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

#apbio-question-counter {
    font-weight: 700;
    color: var(--apbio-primary-dark);
    font-size: 15px;
    background: var(--apbio-primary-light);
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid rgba(13,122,95,0.2);
}

.apbio-nav-dots {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    max-width: 420px;
}

.apbio-nav-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--apbio-border);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.apbio-nav-dot.active { border-color: var(--apbio-primary); background: var(--apbio-primary); }
.apbio-nav-dot.answered-correct { border-color: var(--apbio-success); background: var(--apbio-success); }
.apbio-nav-dot.answered-incorrect { border-color: var(--apbio-danger); background: var(--apbio-danger); }
.apbio-nav-dot.answered-skipped { border-color: var(--apbio-accent); background: var(--apbio-accent); }

/* Question card */
.apbio-question-card {
    background: var(--apbio-surface);
    border: 1px solid var(--apbio-border);
    border-radius: var(--apbio-radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--apbio-shadow);
}

/* Tags */
.apbio-question-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.apbio-tag-qnum {
    background: var(--apbio-primary-dark);
    color: white;
    font-size: 13px;
    padding: 4px 14px;
    border-color: transparent;
    letter-spacing: 0.3px;
}

.apbio-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--apbio-primary-light);
    color: var(--apbio-primary-dark);
    border: 1px solid rgba(13,122,95,0.2);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.apbio-tag-skill {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: rgba(29,78,216,0.2);
}

.apbio-tag-difficulty {
    background: var(--apbio-accent-light);
    color: #92400e;
    border-color: rgba(240,165,0,0.3);
}

/* Question text */
.apbio-question-text {
    font-size: 17px;
    line-height: 1.7;
    color: var(--apbio-text);
    margin-bottom: 24px;
    font-weight: 500;
}

/* Choices */
.apbio-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.apbio-choice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border: 2px solid var(--apbio-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    background: white;
    text-align: left;
    width: 100%;
    font-size: 15px;
    color: var(--apbio-text);
    line-height: 1.5;
}

.apbio-choice:hover:not(:disabled) {
    border-color: var(--apbio-primary);
    background: var(--apbio-primary-light);
    transform: translateX(3px);
}

.apbio-choice.selected {
    border-color: var(--apbio-primary);
    background: var(--apbio-primary-light);
}

.apbio-choice.correct {
    border-color: var(--apbio-success);
    background: var(--apbio-success-light);
}

.apbio-choice.incorrect {
    border-color: var(--apbio-danger);
    background: var(--apbio-danger-light);
}

.apbio-choice-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--apbio-border);
    color: var(--apbio-neutral);
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    transition: all 0.15s;
}

.apbio-choice.selected .apbio-choice-letter {
    background: var(--apbio-primary);
    color: white;
}

.apbio-choice.correct .apbio-choice-letter {
    background: var(--apbio-success);
    color: white;
}

.apbio-choice.incorrect .apbio-choice-letter {
    background: var(--apbio-danger);
    color: white;
}

.apbio-choice-text { flex: 1; }

/* Explanation */
.apbio-explanation {
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
    animation: apbio-fadeIn 0.3s ease;
}

@keyframes apbio-fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.apbio-explanation-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    font-size: 15px;
}

.apbio-explanation.apbio-correct-exp .apbio-explanation-header {
    background: var(--apbio-success);
    color: white;
}

.apbio-explanation.apbio-incorrect-exp .apbio-explanation-header {
    background: var(--apbio-danger);
    color: white;
}

.apbio-explanation #apbio-explanation-text {
    padding: 16px 18px;
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--apbio-text);
    background: #f8fafc;
    border: 1px solid var(--apbio-border);
    border-top: none;
}

/* Question actions */
.apbio-question-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.apbio-question-actions .apbio-btn {
    width: auto;
    flex: 1;
}

/* ═══ RESULTS SCREEN ═══ */
.apbio-results-card {
    background: var(--apbio-surface);
    border-radius: var(--apbio-radius);
    padding: 40px 32px;
    text-align: center;
    box-shadow: var(--apbio-shadow);
    margin-bottom: 24px;
}

.apbio-results-header { margin-bottom: 32px; }
.apbio-results-header h2 { color: var(--apbio-primary-dark); font-size: 26px; margin: 16px 0 8px; }
.apbio-results-header p { color: var(--apbio-text-muted); }

.apbio-score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(var(--apbio-primary) 0%, transparent 0%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    border: 10px solid var(--apbio-primary-light);
    outline: 4px solid var(--apbio-primary);
}

.apbio-score-pct {
    font-size: 30px;
    font-weight: 800;
    color: var(--apbio-primary-dark);
    line-height: 1;
}

.apbio-score-label {
    font-size: 12px;
    color: var(--apbio-neutral);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apbio-results-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.apbio-stat {
    background: #f8fafc;
    border: 1px solid var(--apbio-border);
    border-radius: 10px;
    padding: 16px 8px;
}

.apbio-stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.apbio-stat-label {
    font-size: 12px;
    color: var(--apbio-neutral);
    text-transform: uppercase;
}

.apbio-correct { color: var(--apbio-success); }
.apbio-incorrect { color: var(--apbio-danger); }
.apbio-skipped { color: var(--apbio-accent); }

.apbio-ap-score-estimate {
    background: var(--apbio-primary-light);
    border: 1px solid rgba(13,122,95,0.2);
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 24px;
    font-size: 15px;
}

.apbio-ap-score {
    font-size: 22px;
    font-weight: 800;
    color: var(--apbio-primary-dark);
    margin-left: 8px;
}

.apbio-results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.apbio-results-actions .apbio-btn {
    width: auto;
    flex: none;
    min-width: 160px;
}

/* Review Section */
.apbio-review-section { margin-top: 8px; }
.apbio-review-section h3 { color: var(--apbio-primary-dark); margin-bottom: 16px; font-size: 20px; }

.apbio-review-item {
    background: white;
    border: 1px solid var(--apbio-border);
    border-radius: var(--apbio-radius);
    padding: 20px;
    margin-bottom: 16px;
    border-left: 5px solid var(--apbio-border);
}

.apbio-review-item.review-correct { border-left-color: var(--apbio-success); }
.apbio-review-item.review-incorrect { border-left-color: var(--apbio-danger); }
.apbio-review-item.review-skipped { border-left-color: var(--apbio-accent); }

.apbio-review-q-num {
    font-size: 12px;
    font-weight: 600;
    color: var(--apbio-neutral);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.apbio-review-q-text {
    font-size: 15px;
    color: var(--apbio-text);
    margin-bottom: 12px;
    line-height: 1.6;
}

.apbio-review-answers {
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.apbio-review-your { color: var(--apbio-neutral); }
.apbio-review-correct-ans { color: var(--apbio-success); font-weight: 600; }
.apbio-review-exp {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    color: var(--apbio-text-muted);
    font-size: 13px;
    line-height: 1.6;
}

/* ═══ ERROR STATE ═══ */
.apbio-error {
    background: var(--apbio-danger-light);
    border: 1px solid rgba(220,38,38,0.3);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: #991b1b;
}

.apbio-error h3 { margin: 0 0 8px; }
.apbio-error p { margin: 0 0 16px; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 600px) {
    .apbio-screen { padding: 16px; }
    .apbio-progress-bar { margin: -16px -16px 16px; }
    .apbio-results-stats { grid-template-columns: repeat(2, 1fr); }
    .apbio-exam-info { grid-template-columns: 1fr; }
    .apbio-question-actions { flex-direction: column; }
    .apbio-results-actions { flex-direction: column; align-items: center; }
    .apbio-question-text { font-size: 15px; }
    .apbio-choice { font-size: 14px; }
}
