:root {
    --primary: #4a00e0;
    --secondary: #8e2de2;
    --accent: #00c9ff;
    --dark: #121212;
    --light: #f8f9fa;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --transition: all 0.3s ease;
    --card-bg: rgba(30, 30, 46, 0.7);
    --light-card-bg: rgba(255, 255, 255, 0.95);
    --light-text: #333;
    --light-secondary: #666;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--dark), #1a1a2e);
    color: var(--light);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    background-attachment: fixed;
}

body.light-theme {
    background: linear-gradient(135deg, #f0f2f5, #e6e9ef);
    color: var(--light-text);
}

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark), #1a1a2e);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.atom-container {
    position: relative;
    width: 200px;
    height: 200px;
}

.nucleus {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 201, 255, 0.7);
    animation: pulse 2s infinite;
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.orbit-1 {
    width: 100px;
    height: 100px;
    animation: rotate 12s linear infinite;
}

.orbit-2 {
    width: 150px;
    height: 150px;
    animation: rotate 16s linear infinite reverse;
}

.orbit-3 {
    width: 200px;
    height: 200px;
    animation: rotate 20s linear infinite;
}

.electron {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(142, 45, 226, 0.8);
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.orbit-1 .electron {
    background: var(--accent);
    width: 10px;
    height: 10px;
}

.orbit-2 .electron {
    background: var(--primary);
    width: 14px;
    height: 14px;
}

.orbit-3 .electron {
    background: var(--secondary);
    width: 12px;
    height: 12px;
}

@keyframes rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0 rgba(0, 201, 255, 0.7);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 0 10px rgba(0, 201, 255, 0);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0 rgba(0, 201, 255, 0);
    }
}

.preloader-text {
    margin-top: 30px;
    font-size: 1.2rem;
    text-align: center;
    color: var(--accent);
    font-weight: 500;
    letter-spacing: 1px;
}

.loading-dots {
    display: inline-flex;
    margin-left: 10px;
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    margin: 0 3px;
    animation: loading 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Navbar */
.navbar {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-theme .navbar {
    background: rgb(0, 0, 0, 0.5);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--light);
    text-decoration: none;
}

.logo img {
    height: 30px;
    animation: float 3s ease-in-out infinite;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: var(--light);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    padding: 5px 12px;
    border-radius: 30px;
}

.nav-links a:hover,
.nav-links a.active {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 5px 15px rgba(142, 45, 226, 0.4);
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80vh;
    padding: 50px 0;
}

.hero-text {
    flex: 1;
    padding-right: 30px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(to right, var(--accent), #92fe9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #ccc;
    max-width: 600px;
}

body.light-theme .hero p {
    color: var(--light-secondary);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.logo-large {
    width: 300px;
    height: 300px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(74, 0, 224, 0.5));
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    position: relative;
    display: block;
    width: 100%;
}

body.light-theme .section-title {
    color: var(--primary);
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 2px;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-theme .feature-card {
    background: var(--light-card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    color: var(--light-text);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(142, 45, 226, 0.3);
}

body.light-theme .feature-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--accent);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

body.light-theme .feature-card h3 {
    color: var(--primary);
}

/* Enhanced Carousel */
.carousel-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
    height: 550px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.3);
}

body.light-theme .carousel-container {
    background: rgba(255, 255, 255, 0.1);
}

.carousel {
    display: flex;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    height: 100%;
}

.carousel-item {
    min-width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
}

@media (min-width: 768px) {
    .carousel-item {
        min-width: 50%;
    }
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.carousel-item img:hover {
    transform: scale(1.02);
}

body.light-theme .carousel-item img {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.carousel-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

body.light-theme .carousel-control {
    background: rgba(0, 0, 0, 0.2);
}

.carousel-control.active {
    background: var(--accent);
    transform: scale(1.2);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    color: white;
    font-size: 24px;
}

.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav-left {
    left: 15px;
}

.carousel-nav-right {
    right: 15px;
}

/* Build Page */
.build-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 15px;
    padding: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-theme .build-content {
    background: var(--light-card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--light-text);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.build-section {
    margin-bottom: 40px;
}

.build-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

body.light-theme .build-section h2 {
    color: var(--primary);
}

/* Downloads Page */
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.device-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-theme .device-card {
    background: var(--light-card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    color: var(--light-text);
}

.device-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

body.light-theme .device-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.device-image {
    height: 200px;
    background: linear-gradient(45deg, #2c3e50, #4ca1af);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

body.light-theme .device-image {
    background: linear-gradient(45deg, #e0e5ec, #c9d6ff);
}

.device-image img {
    max-width: 80%;
    max-height: 80%;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.5));
    transition: var(--transition);
}

body.light-theme .device-image img {
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.15));
}

.device-card:hover .device-image img {
    transform: scale(1.05);
}

.device-info {
    padding: 25px;
}

.device-info h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

body.light-theme .device-info h3 {
    color: var(--primary);
}

.device-info p {
    color: #aaa;
    margin-bottom: 20px;
}

body.light-theme .device-info p {
    color: var(--light-secondary);
}

/* Maintainer Info */
.maintainer-info {
    font-size: 0.95rem;
    color: #ccc;
    margin-bottom: 20px;
    text-align: left;
}

body.light-theme .maintainer-info {
    color: var(--light-secondary);
}

.maintainer-info a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

body.light-theme .maintainer-info a {
    color: var(--primary);
}

.device-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-block;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(142, 45, 226, 0.4);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(142, 45, 226, 0.6);
}

.btn i {
    margin-right: 8px;
}

/* Specific style for download button on Downloads page */
.device-actions .btn-download {
    width: 100%;
    padding: 15px 30px;
    font-size: 1.1rem;
    background: linear-gradient(to right, var(--accent), #92fe9d);
    box-shadow: 0 8px 25px rgba(0, 201, 255, 0.4);
    text-align: center;
}

.device-actions .btn-download:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 201, 255, 0.6);
}

.btn-download,
.btn-guide {
    background: linear-gradient(to right, var(--success), #00d2d3);
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

@keyframes wink {
    0%, 45%, 55%, 100% { transform: scale(1); }
    50% { transform: scale(0.8); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

@keyframes loading {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wink-emoji { display: inline-block; animation: wink 2s infinite; margin-left: 10px; }
.bounce-icon { display: inline-block; animation: bounce 1.5s infinite; margin-left: 10px; }
.sad-emoji { display: inline-block; animation: bounce 1.5s infinite; margin-left: 10px; }

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0 20px;
    color: #aaa;
    font-size: 1.1rem;
}

body.light-theme .footer {
    color: var(--light-secondary);
}

.great-day {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--accent);
    animation: float 4s ease-in-out infinite;
}

body.light-theme .great-day {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.credit {
    margin-top: 10px;
    font-size: 0.9rem;
}

.credit a {
    color: var(--accent);
    text-decoration: none;
}

body.light-theme .credit a {
    color: var(--primary);
}

/* Page Content */
/* New CSS for Collapsible Changelog */
#changelog-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

#changelog-container.expanded {
    max-height: 5000px;
}

#toggle-icon {
    transition: transform 0.3s ease-in-out;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

#changelog-toggle.expanded #toggle-icon {
    transform: rotate(180deg);
}

/* New CSS for Full Screen Sections */
.full-screen-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--dark), #1a1a2e);
    color: var(--light);
}

body.light-theme .full-screen-section {
    background: linear-gradient(135deg, #e0e5ec, #c9d6ff);
    color: var(--light-text);
}

#welcome-section p {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.4;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#welcome-section big {
    font-size: 1.2em;
}

#labs-image-section img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

body.light-theme #labs-image-section img {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

/* Scroll animation helper classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}


/* --- NEW STYLES FOR FLOATING ACTION BUTTON --- */
/* --- ADDED AT THE END OF THE ORIGINAL FILE --- */

.fab-menu-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: none; /* Hidden on desktop, shown on mobile */
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.fab-menu-button:hover {
    transform: scale(1.1);
}

.fab-menu-button #fab-icon {
    transition: transform 0.3s ease-in-out;
}

/* Rotates the FAB icon when the menu is active */
body.menu-active .fab-menu-button #fab-icon {
    transform: rotate(180deg);
}

/* --- Mobile Menu Overlay Styles --- */
@media (max-width: 900px) {
    /* Show the FAB on screens 900px or less */
    .fab-menu-button {
        display: flex;
    }
    /* Add this single rule inside your @media (max-width: 900px) block */
body.menu-active .navbar {
    backdrop-filter: none; /* This is the fix: temporarily disable the filter */
}
    
    /* Redefine nav-links as a full-screen overlay on mobile */
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(18, 18, 18, 0.98);
        backdrop-filter: blur(5px);
        
        /* Hide the menu by default */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: opacity 0.3s ease, visibility 0s 0.3s, transform 0.3s ease;
        
        /* Center the links */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        z-index: 1000;
    }
    
    /* Show the menu when body has the .menu-active class */
    body.menu-active .nav-links {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition: opacity 0.3s ease, visibility 0s 0s, transform 0.3s ease;
    }
    
    /* Make menu links larger on mobile */
    .nav-links a {
        font-size: 2rem;
        padding: 10px 20px;
    }

    /* Light theme styles for the overlay */
    body.light-theme .nav-links {
        background: rgba(0, 0, 0, 0.5);
    }
}

/* --- Mobile View Adjustments --- */
@media (max-width: 900px) {
    /* Hide the large logo image on mobile */
    .hero-image {
        display: none;
    }

    /* OPTIONAL: Center the text for a cleaner look */
    .hero {
        justify-content: center;
        text-align: center;
    }

    .hero-text {
        padding-right: 0;
    }
}