/* General Resets & Box-Sizing for Easier Layouts */
html {
    box-sizing: border-box;
    height: 100%;
    font-size: 16px;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    background: linear-gradient(135deg, #f0f4f8 0%, #e8f2f7 50%, #f0f4f8 100%);
    background-attachment: fixed;
    color: #333;
    font-family: "Inter", sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

/* Subtle animated background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(52, 152, 219, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(46, 204, 113, 0.02) 0%, transparent 50%);
    background-size: 800px 800px;
    animation: subtleFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes subtleFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-10px, -10px) rotate(1deg); }
    50% { transform: translate(10px, -5px) rotate(-1deg); }
    75% { transform: translate(-5px, 10px) rotate(0.5deg); }
}

/* --- ENHANCED HEADER STYLES --- */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    color: white;
    padding: 1.5em 1.2em;
    box-shadow: 
        0 4px 20px rgba(44, 62, 80, 0.3),
        0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

/* Subtle shine effect on header */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

header:hover::before {
    left: 100%;
}

/* NEW: Specific header styles for each lab page */
.header-coding {
    background-image: linear-gradient(to right, #5ca2ff, #034aa1);
}
.header-writing {
    background-image: linear-gradient(to right, #00ffc8, #01b4cc);
}
.header-music {
    background-image: linear-gradient(to right, #fffb00, #e7a428, #ff9900);
}
.header-robotics {
    background-image: linear-gradient(to right, #00920c, #a0f58b);
}
.header-language {
    background-image: linear-gradient(to right, #f450cb, #ff0040);
}


.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
}

.logo-link {
    display: inline-block;
    margin-bottom: 10px;
}

.quiz-container {
            background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
            padding: 30px;
            border-radius: 20px;    
            box-shadow: 
                0 10px 30px rgba(0, 0, 0, 0.1),
                0 1px 8px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
            width: 100%;
            max-width: 700px;
            text-align: center;
            animation: fadeInUp 0.8s ease-out;
            border: 1px solid rgba(52, 152, 219, 0.1);
            position: relative;
            overflow: hidden;
        }

        .quiz-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #3498db, #2ecc71, #3498db);
            background-size: 200% 100%;
            animation: shimmer 3s ease-in-out infinite;
        }

        @keyframes shimmer {
            0%, 100% { background-position: -200% 0; }
            50% { background-position: 200% 0; }
        }

        #question-display {
            font-size: 1.3em;
            margin-bottom: 30px;
            color: #34495e;
            min-height: 60px; /* Ensure space for longer questions */
        }

        .options-container {
            display: grid;
            gap: 12px;
            margin-bottom: 30px;
        }

        .option-button {
            width: 100%;
            padding: 15px 20px;
            font-size: 1.1em;
            background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
            color: white;
            border: none;
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
        }

        .option-button:hover {
            background: linear-gradient(135deg, #2980b9 0%, #1f4e79 100%);
            transform: translateY(-3px) scale(1.02);
            box-shadow: 0 12px 25px rgba(41, 128, 185, 0.4);
        }

        .option-button:active {
            transform: translateY(-1px) scale(1.01);
            box-shadow: 0 6px 15px rgba(52, 152, 219, 0.3);
        }

        .option-button.selected {
            background-color: #27ae60; /* Green for selected */
        }

        #navigation-buttons {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-top: 20px;
        }

        #navigation-buttons button {
            padding: 12px 25px;
            font-size: 1.1em;
            background-color: #f39c12; /* Orange for navigation */
            color: white;
            border: none;
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
        }

        #navigation-buttons button:hover {
            background-color: #e67e22;
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 8px 25px rgba(230, 126, 34, 0.4);
        }

        #results-display {
            margin-top: 40px;
            text-align: left;
            border-top: 2px solid #ecf0f1;
            padding-top: 20px;
            animation: slideIn 0.8s ease-out;
            display: none; /* Hidden by default */
        }

        #results-display h3 {
            color: #2c3e50;
            font-size: 1.6em;
            margin-bottom: 20px;
            text-align: center;
        }

        .character-result {
            margin-bottom: 10px;
            font-size: 1.1em;
            color: #34495e;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 0;
            border-bottom: 1px dotted #ccc;
        }

        .character-result:last-child {
            border-bottom: none;
        }

        .character-result span:first-child {
            font-weight: bold;
        }

        .character-result span:last-child {
            color: #27ae60;
            font-weight: bold;
        }

        #restart-button {
            background-color: #e74c3c;
            margin-top: 30px;
            border-radius: 20px;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
        }

        #restart-button:hover {
            background-color: #c0392b;
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 8px 25px rgba(192, 57, 43, 0.4);
        }
.header-content h1 {
    font-family: "Orbitron", sans-serif;
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    color: white; /* H1 color is now explicitly set to white */
}

.header-content h3 {
    font-family: "Orbitron", sans-serif;
    font-size: 1.8rem;
    margin: 0;
    color: white; /* H3 color is now explicitly set to white */
}

.header-logo {
    width: 150px;
    height: auto;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

nav ul li {
    margin: 0;
}

nav a {
    display: inline-block;
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.7em 1.2em;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1));
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::before {
    left: 100%;
}

nav a:hover::after {
    width: 80%;
}

nav a:hover {
    background: linear-gradient(135deg, #0053bd, #0071ff);
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 10px 30px rgba(0, 83, 189, 0.5);
    border-color: rgba(255,255,255,0.4);
}

nav a:active {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 83, 189, 0.4);
}

nav a.active {
    background: linear-gradient(135deg, #0053bd, #0071ff);
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(0, 83, 189, 0.4);
    border-color: rgba(255,255,255,0.3);
    animation: activeButtonPulse 2s ease-in-out infinite;
}

nav a.active::after {
    width: 80%;
    background: linear-gradient(90deg, #ffffff, #cccccc);
}

@keyframes activeButtonPulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(0, 83, 189, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 25px rgba(0, 83, 189, 0.6);
        transform: scale(1.02);
    }
}
/* --- END REFACTORED HEADER STYLES --- */


/* Main Content Area */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Hero Section (from original index page) */
.hero {
    background-color: white;
    padding: 3rem;
    text-align: center;
    border-radius: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.hero h2 {
    font-family: "Orbitron", sans-serif;
    font-size: 2.8rem;
    margin-top: 0;
    color: #0053bd;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 1.5rem;
}

/* Generic Button styles */
.button {
    display: inline-block;
    background-color: #0053bd;
    color: white;
    padding: 0.8em 1.8em;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 83, 189, 0.3);
}



.button-secondary {
    background-color: transparent;
    color: #0053bd;
    border: 2px solid #0053bd;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 83, 189, 0.2);
}

.button-secondary:hover {
    background-color: #0053bd;
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 83, 189, 0.4);
}

.button:hover {
    background-color: #0071ff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 113, 255, 0.4);
}

.button:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 83, 189, 0.3);
}


/* About Section */
.about {
    background-color: white;
    padding: 2rem;
    border-radius: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.about p {
    font-family: "Inter", sans-serif;
    font-size: 1rem;
}


/* Labs Page Specifics (Directory Style) */
.labs-page-heading {
    font-family: "Orbitron", sans-serif;
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Grid container for the lab buttons */
.labs-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding-top: 1rem;
}

/* Styling for each lab button */
.lab-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 30px;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
    font-family: "Orbitron", sans-serif;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.lab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.lab-button:hover::before {
    left: 100%;
}

.lab-button:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

.lab-button:active {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Individual button colors with gradients - matching header gradients */
.lab-button-coding {
    background-image: linear-gradient(to right, #5ca2ff, #034aa1);
}
.lab-button-writing {
    background-image: linear-gradient(to right, #00ffc8, #01b4cc);
}
.lab-button-music {
    background-image: linear-gradient(to right, #fffb00, #e7a428, #ff9900);
}
.lab-button-robotics {
    background-image: linear-gradient(to right, #00920c, #a0f58b);
}
.lab-button-language {
    background-image: linear-gradient(to right, #f450cb, #ff0040);
}

/* Lab Section for Individual Lab Pages */
.lab-section {
    background-color: white;
    padding: 2rem;
    border-radius: 25px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 2rem;
}
.lab-section h3 {
    font-family: "Orbitron", sans-serif;
    font-size: 1.8rem;
    color: white; /* H3 inside the lab section is intentionally blue */
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: left;
}

/* Grid container for the project cards */
.project-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* Individual Project Card Styling */
.project-card {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.project-card h4 {
    font-family: "Orbitron", sans-serif;
    font-size: 1.4rem;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.project-card p {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: auto;
}

/* Footer */
footer {
    height: auto;
    min-height: 50px;
    background-color: #2c3e50;
    color: #bbb;
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    font-size: 0.9rem;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

/* Specific Font Families for other elements */
#myBoard,
#status,
#pgn-output,
.mono-font {
    font-family: "Roboto Mono", monospace;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
    nav ul {
        gap: 5px;
    }
    nav ul li {
        margin: 0;
    }
    .header-logo {
      width: 100px;
    }
    header {
      flex-direction: column;
      justify-content: center;
      align-items: center;
      padding-top: 50px;
    }
    .header-content {
      margin-top: 20px;
      gap: 10px;
    }
    .logo-link {
      margin-bottom: 5px;
    }
    .project-links .button {
        width: 100%;
        text-align: center;
    }
}
@media (max-width: 480px) {
    main {
        padding: 0.8rem;
    }
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    nav ul li {
        margin: 0;
    }
    .project-card {
        padding: 1rem;
    }
}

/* Enhanced Animations */
@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

@keyframes activeButtonPulse {
    0%, 100% { 
        box-shadow: 0 6px 20px rgba(0, 83, 189, 0.4);
    }
    50% { 
        box-shadow: 
            0 8px 25px rgba(0, 83, 189, 0.6),
            0 0 20px rgba(0, 83, 189, 0.3);
    }
}

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

/* Enhanced Homepage Styles */
.hero {
    padding: 4rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, rgba(46, 204, 113, 0.05) 100%);
    border-radius: 20px;
    margin: 2rem auto;
    max-width: 1000px;
    animation: fadeInUp 1s ease-out;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 700;
}

.highlight {
    background: linear-gradient(135deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #3498db;
    font-weight: 600;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #666;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.button {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.button.primary {
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.button.primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.button.secondary {
    background: transparent;
    color: #3498db;
    border-color: #3498db;
}

.button.secondary:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
}

.button.accent {
    background: linear-gradient(135deg, #2980b9, #1abc9c);
    color: white;
    box-shadow: 0 4px 15px rgba(41, 128, 185, 0.3);
    border: none;
}

.button.accent:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(41, 128, 185, 0.4);
    background: linear-gradient(135deg, #21618c, #148f77);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 1rem;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.about {
    padding: 3rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.about-content h3 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #2c3e50;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 3rem;
    color: #555;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(52, 152, 219, 0.1);
    display: block;
    text-decoration: none;
    color: inherit;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: inherit;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-content h2 {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-stats {
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}
