/* ===================================
   Vision Accessibility Simulation Lab
   Complete Stylesheet with Interactive Sliders
   Virginia Tech Branding
   =================================== */

/* ===================================
   CSS Reset & Base Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* VT Brand Colors - https://brand.vt.edu/identity/color.html */
    --vt-maroon: #861F41;        /* Chicago Maroon - Primary */
    --vt-maroon-dark: #5d1529;
    --vt-orange: #CF4420;         /* Burnt Orange - Secondary */
    
    /* Palette */
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #861F41;      /* VT Maroon */
    --text-color: #222222;
    --text-light: #555555;
    --background: #ffffff;
    --background-alt: #f8f9fa;
    --border-color: #dee2e6;
    --focus-color: #0066cc;
    --link-color: #0066cc;
    --link-hover: #004499;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 1.125rem; /* 18px for better readability */
    --line-height-base: 1.6;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-color);
    background-color: var(--background);
}

/* ===================================
   Accessibility Features
   =================================== */

/* Skip Link - Hidden until focused */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
}

/* Visually hidden but accessible to screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
}

/* ===================================
   Layout & Container
   =================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===================================
   Header with Logo Space
   =================================== */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.header-content {
    position: relative;
}

/* Logo space - reserved for VT logo */
.logo-space {
    margin-bottom: var(--spacing-md);
    min-height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.vt-logo {
    max-height: 60px;
    width: auto;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
}

.tagline {
    font-size: 1.25rem;
    opacity: 0.95;
    font-weight: 300;
    margin-bottom: var(--spacing-xs);
}

.institution {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* ===================================
   Navigation
   =================================== */
nav {
    background-color: var(--background-alt);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-sm) 0;
    gap: var(--spacing-sm);
}

.nav-list li {
    margin: 0;
}

.nav-list a {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.nav-list a:hover {
    background-color: rgba(134, 31, 65, 0.1);
    color: var(--accent-color);
}

.cta-link {
    background-color: var(--accent-color) !important;
    color: white !important;
    font-weight: 600;
}

.cta-link:hover {
    background-color: var(--vt-maroon-dark) !important;
}

/* ===================================
   Main Content
   =================================== */
main {
    padding: var(--spacing-xl) 0;
}

section {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
}

section h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: var(--spacing-sm);
}

section h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

section h4 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.lead {
    font-size: 1.3rem;
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: var(--spacing-lg);
}

.section-intro {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-light);
}

p {
    margin-bottom: var(--spacing-md);
}

/* ===================================
   Cards & Grid Layouts
   =================================== */
.features-grid,
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.feature-card,
.resource-card {
    background-color: var(--background-alt);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover,
.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.feature-card h3,
.resource-card h3 {
    color: var(--accent-color);
    margin-top: 0;
}

.full-width {
    grid-column: 1 / -1;
}

/* ===================================
   Statistics Boxes
   =================================== */
.stat-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.stat-box {
    background-color: var(--accent-color);
    color: white;
    padding: var(--spacing-lg);
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: var(--spacing-sm);
}

.stat-label {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 0;
}

/* ===================================
   Vision Comparison Slider Styles
   =================================== */

/* Vision Condition Section */
.vision-demo {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.vision-demo h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
    margin-top: 0;
}

.vision-demo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.acuity-label {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.vision-description {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    color: var(--text-light);
}

/* Before/After Comparison Container */
.comparison-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.comparison-container img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

/* Image wrapper for before/after */
.img-wrapper {
    position: relative;
    width: 100%;
}

/* After image (simulated vision) */
.img-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Clip-path will be controlled by JavaScript for reveal effect */
    clip-path: inset(0 50% 0 0); /* Start at 50% revealed */
}

.img-after img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Slider handle */
.slider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: white;
    cursor: ew-resize;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.slider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border: 3px solid var(--accent-color);
}

/* Arrow indicators on slider */
.slider::after {
    content: '◄►';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent-color);
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: -4px;
    z-index: 1;
}

/* Labels for before/after */
.comparison-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.label-before,
.label-after {
    padding: 0.5rem 1rem;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-weight: 600;
}

.label-before {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.label-after {
    background-color: #fff3e0;
    color: #e65100;
}

/* Stats box within vision demos */
.stats-box {
    background-color: var(--background-alt);
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-radius: 4px;
}

.stats-box h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    margin-top: 0;
}

.stats-box ul {
    list-style: none;
    padding-left: 0;
}

.stats-box li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.stats-box li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Instructions box */
.instructions {
    background-color: #e3f2fd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.instructions p {
    margin: 0;
    color: #1565c0;
    font-weight: 500;
}

/* ===================================
   Instruction List
   =================================== */
.instruction-list {
    counter-reset: step-counter;
    list-style: none;
    padding-left: 0;
}

.instruction-list > li {
    counter-increment: step-counter;
    margin-bottom: var(--spacing-lg);
    padding-left: 4rem;
    position: relative;
}

.instruction-list > li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 3rem;
    height: 3rem;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.instruction-list > li strong {
    font-size: 1.3rem;
    color: var(--primary-color);
    display: block;
    margin-bottom: var(--spacing-sm);
}

.instruction-list > li p {
    margin-bottom: var(--spacing-sm);
}

.instruction-list > li ul {
    margin-top: var(--spacing-sm);
    margin-left: var(--spacing-md);
}

.instruction-list > li ul li {
    margin-bottom: var(--spacing-xs);
}

/* ===================================
   Tips Box
   =================================== */
.tips-box {
    background-color: #fff9e6;
    border-left: 4px solid var(--vt-orange);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    border-radius: 4px;
}

.tips-box h4 {
    color: var(--vt-orange);
    margin-top: 0;
}

.tips-box ul {
    margin-left: var(--spacing-md);
}

.tips-box li {
    margin-bottom: var(--spacing-sm);
}

/* ===================================
   Resource Lists
   =================================== */
.resource-card ul {
    list-style: none;
    padding-left: 0;
}

.resource-card li {
    margin-bottom: var(--spacing-sm);
    padding-left: 1.5rem;
    position: relative;
}

.resource-card li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* ===================================
   Links
   =================================== */
a {
    color: var(--link-color);
    text-decoration: underline;
    transition: color 0.2s;
}

a:hover {
    color: var(--link-hover);
}

a:visited {
    color: #551A8B;
}

/* ===================================
   Call to Action Section
   =================================== */
.cta-section {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--vt-maroon-dark) 100%);
    color: white;
    padding: var(--spacing-xl);
    border-radius: 12px;
    text-align: center;
    margin-top: var(--spacing-xl);
}

.cta-section h2 {
    color: white;
    border-bottom: none;
    font-size: 2.2rem;
    margin-bottom: var(--spacing-md);
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.95;
}

.cta-button {
    display: inline-block;
    background-color: white;
    color: var(--accent-color);
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    color: var(--accent-color);
}

/* ===================================
   Footer
   =================================== */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-xl);
    text-align: center;
}

footer p {
    margin-bottom: var(--spacing-sm);
}

footer a {
    color: white;
    text-decoration: underline;
}

footer a:hover {
    color: rgba(255,255,255,0.8);
}

.disclaimer {
    font-size: 0.95rem;
    opacity: 0.9;
    font-style: italic;
    max-width: 900px;
    margin: var(--spacing-md) auto;
    line-height: 1.5;
}

.credit {
    font-size: 1rem;
    margin-top: var(--spacing-md);
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1.1rem;
    }
    
    .institution {
        font-size: 0.9rem;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-list li {
        width: 100%;
    }
    
    .nav-list a {
        text-align: center;
    }
    
    section h2 {
        font-size: 1.75rem;
    }
    
    .features-grid,
    .resources-grid,
    .stat-boxes {
        grid-template-columns: 1fr;
    }
    
    .instruction-list > li {
        padding-left: 3.5rem;
    }
    
    .instruction-list > li::before {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    /* Slider adjustments for mobile */
    .slider::before {
        width: 40px;
        height: 40px;
    }
    
    .comparison-labels {
        font-size: 0.85rem;
    }
    
    .vision-demo {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-xl: 2rem;
        --spacing-lg: 1.5rem;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    .cta-section h2 {
        font-size: 1.75rem;
    }
    
    .logo-space {
        min-height: 50px;
    }
    
    .vt-logo {
        max-height: 50px;
    }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    nav,
    .skip-link,
    .cta-section,
    .slider {
        display: none;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.9em;
    }
    
    section {
        page-break-inside: avoid;
    }
}
