:root {
    --primary-color: #b81822;
    --primary-hover: #9e151d;
    --bg-color: #f3f4f6;
    --surface-color: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation Bar */
.top-nav {
    background-color: var(--surface-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
    }
}

.logo-container .logo {
    max-height: 50px;
    object-fit: contain;
}

.selectors-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1rem;
}

@media (min-width: 768px) {
    .selectors-container {
        flex-direction: row;
        width: auto;
    }
}

.select-wrapper {
    position: relative;
    width: 100%;
}

@media (min-width: 768px) {
    .select-wrapper {
        width: 200px;
    }
}

.modern-select {
    width: 100%;
    appearance: none;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.modern-select:hover:not(:disabled) {
    border-color: #cbd5e1;
}

.modern-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(184, 24, 34, 0.1);
}

.modern-select:disabled {
    background-color: #f9fafb;
    color: var(--text-secondary);
    cursor: not-allowed;
}

.select-wrapper::after {
    content: '\f107'; /* FontAwesome angle-down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
    transition: var(--transition);
}

.modern-select:focus + .select-wrapper::after {
    transform: translateY(-50%) rotate(180deg);
}


/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 2rem;
    overflow: hidden;
}

.image-container {
    max-width: 1000px;
    width: 100%;
    min-height: 400px;
    background-color: var(--surface-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    position: relative;
}

#answerKeyImage {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

.placeholder-text {
    color: var(--text-secondary);
    font-size: 1.2rem;
    text-align: center;
}

/* Floating Navigation Buttons */
.nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.nav-btn:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.nav-btn:active:not(:disabled) {
    transform: translateY(-50%) scale(0.95);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f9fafb;
}

.left-btn {
    left: 2rem;
}

.right-btn {
    right: 2rem;
}

/* Loading Spinner */
.loading-spinner {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    .left-btn { left: 0.5rem; }
    .right-btn { right: 0.5rem; }
    .main-content { padding: 1rem 3rem; }
}
