:root {
    /* Colors extracted from ContentView.swift */
    --accent-pink: rgb(255, 51, 153); /* Color(red: 1.0, green: 0.2, blue: 0.6) */
    --bg-start: #1a1a1f; /* Color(red: 0.1, green: 0.1, blue: 0.12) */
    --bg-end: #0d0d14;   /* Color(red: 0.05, green: 0.05, blue: 0.08) */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --text-main: #ffffff;
    --text-muted: #888888;
}

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

body {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(to bottom, var(--bg-start), var(--bg-end));
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Navigation */
nav {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

/* New Nav Links Styles */
.nav-links {
    display: flex;
    gap: 30px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-main);
}

.nav-links a.active { 
    color: var(--accent-pink); 
}

/* Logo Link Styles */
.logo-link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
}

.logo-link:hover {
    opacity: 0.8;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-nudge {
    font-family: 'Caveat', cursive;
    color: var(--text-muted);
    font-size: 22px;
    display: none; /* Hidden until count loads */
    align-items: center;
    gap: 8px;
    transform: rotate(-2deg);
}

.nav-nudge svg {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 40px;
    width: auto;
    /* Filter to match var(--accent-pink) #ff3399 */
    filter: brightness(0) saturate(100%) invert(28%) sepia(93%) saturate(2352%) hue-rotate(313deg) brightness(98%) contrast(105%);
}

.btn-primary {
    background-color: var(--accent-pink);
    color: white;
    padding: 12px 24px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Fredoka', sans-serif;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 51, 153, 0.4);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    font-size: 64px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero p {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* Interactive Demos Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 80px;
    padding: 0 20px;
}

.feature-card {
    background: var(--glass-bg);
    border-radius: 24px;
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 51, 153, 0.3);
}

.feature-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.feature-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

.feature-explanation {
    margin-top: 25px;
    font-size: 15px;
    line-height: 1.6;
    color: #bbb;
}

/* --- Demo 1: Device Sync --- */
.demo-sync-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    height: 120px;
}

.device {
    color: white;
    font-size: 42px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
}

.device i {
    transition: all 0.3s ease;
}

.device:hover { background: rgba(255,255,255,0.1); }

.device.locked {
    background: rgba(255, 51, 153, 0.15);
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(255, 51, 153, 0.2);
}

.device.locked i {
    opacity: 0.2;
    transform: scale(0.8);
}

/* The lock icon overlay */
.device::after {
    content: '\f023'; /* FontAwesome Lock */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 24px;
    color: var(--accent-pink);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.device.locked::after {
    transform: translate(-50%, -50%) scale(1);
}

/* --- Demo 2: Group Session --- */
.demo-group-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    height: 120px;
    align-items: center;
}

.avatar {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.avatar i { font-size: 20px; }

.avatar.locked {
    background: var(--accent-pink);
    box-shadow: 0 0 15px rgba(255, 51, 153, 0.5);
}

.avatar.locked i { display: none; }

.avatar.locked::after {
    content: '\f023';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: white;
}

/* --- Demo 3: Classroom --- */
.demo-class-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    height: 120px;
}

.board {
    width: 120px;
    height: 70px;
    background: #333;
    border: 4px solid #555;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.board:active { transform: scale(0.95); }

.qr-code {
    font-size: 40px;
    color: white;
}

.students-row {
    display: flex;
    gap: 15px;
}

.student {
    font-size: 24px;
    color: #555;
    transition: all 0.5s;
}

.student.locked {
    color: var(--accent-pink);
    transform: translateY(5px);
}

/* --- Demo 3: Session Builder --- */
.demo-builder-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 0;
}

.builder-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.builder-btn {
    background: transparent;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.2s;
    color: #888;
}

.builder-btn.study {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

.builder-btn.study:hover {
    background: rgba(255, 51, 153, 0.1);
}

.builder-btn.break {
    border-color: #666;
    color: #aaa;
}

.builder-btn.break:hover {
    background: rgba(255, 255, 255, 0.05);
}

.builder-btn.remove {
    border-color: #ff4444;
    color: #ff4444;
    width: 36px;
    padding: 8px 0;
}

.builder-btn.remove:hover {
    background: rgba(255, 68, 68, 0.1);
}

/* Disabled state for builder buttons (greyed out) */
.builder-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: #444 !important;
    color: #777 !important;
}

.session-timeline {
    display: flex;
    gap: 4px;
    height: 40px;
    width: 100%;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 4px;
    overflow: hidden;
}

.timeline-block {
    flex: 1;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    color: white;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
}

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.timeline-block.study {
    background: var(--accent-pink);
}

.timeline-block.break {
    background: #555;
}

.builder-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.btn-start-sesh {
    flex: 1;
    background: var(--accent-pink);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-weight: 700;
    font-size: 16px;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 15px rgba(255, 51, 153, 0.3);
}

.btn-start-sesh:active {
    transform: scale(0.98);
}

.btn-qr-mini {
    width: 48px;
    background: #333;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Waitlist Section --- */
.waitlist-section {
    max-width: 600px;
    margin: 0 auto 80px;
    padding: 40px;
    background: var(--glass-bg);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}
/* --- Educators Section --- */
.educator-section {
    max-width: 600px;
    margin: 0 auto 60px;
    padding: 40px;
    background: var(--glass-bg);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.educator-section h2 {
    font-size: 28px;
    margin-bottom: 12px;
}

.educator-section p {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 18px;
}

.educator-link {
    color: var(--accent-pink);
    text-decoration: none;
    font-weight: 600;
}

.educator-link:hover {
    text-decoration: underline;
}

/* Waitlist Count Badge */
#waitlist-count {
    background: rgba(255, 51, 153, 0.15);
    border: 1px solid rgba(255, 51, 153, 0.4);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    margin: 0 auto 30px;
    display: inline-block;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: none; 
}

#waitlist-count.visible {
    display: inline-block;
    opacity: 1;
    transform: translateY(0);
}

/* Mailchimp Form Styles adapted for Dark Mode */
#mc_embed_signup {
    width: 100%;
}

.mc-field-group {
    margin-bottom: 20px;
    text-align: left;
}

.mc-field-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-main);
}

.mc-field-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-family: 'Fredoka', sans-serif;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.mc-field-group input:focus {
    border-color: var(--accent-pink);
}

/* Hide Mailchimp internal stuff */
#mc_embed_signup h2 { display: none; }
#mc_embed_signup .indicates-required { display: none; }

/* Error/Success messages */
div.mce_inline_error {
    background-color: transparent !important;
    color: var(--accent-pink) !important;
    border: none !important;
    padding: 4px 0 0 0 !important;
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

input.mce_inline_error {
    border-color: var(--accent-pink) !important;
    background: rgba(255, 51, 153, 0.05) !important;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    nav {
        padding: 15px 20px;
    }
    
    .nav-links {
        display: none; /* Hide text links on mobile to preserve space */
    }

    .logo {
        font-size: 20px;
    }

    .logo img {
        height: 32px;
    }

    /* Reposition nudge under button on mobile */
    .nav-right {
        flex-direction: column-reverse;
        align-items: flex-end;
        gap: 4px;
    }

    .nav-nudge {
        /* Allow JS to control display, just style it */
        font-size: 13px;
        transform: none;
        margin-top: 2px;
    }

    .nav-nudge svg {
        width: 24px;
        height: 24px;
        transform: rotate(-90deg);
        margin-left: 4px;
    }

    .btn-primary {
        padding: 10px 16px;
        font-size: 18px;
    }

    h1 {
        font-size: 36px;
    }

    .hero {
        padding: 30px 20px;
    }

    .hero p {
        font-size: 18px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-card {
        padding: 20px;
    }

    /* Scale down the sync demo slightly for very small screens */
    .device {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .demo-sync-container {
        gap: 10px;
        height: 80px; /* Reduced height */
    }

    /* Scale down group demo for mobile */
    .avatar {
        width: 40px;
        height: 40px;
    }
    
    .demo-group-container {
        gap: 8px;
        height: auto; /* Allow height to adjust for wrapping */
        padding: 10px 0;
        justify-content: center;
    }

    /* Force the 1 on top, 4 on bottom layout for mobile using Grid */
    .demo-group-container {
        display: grid;
        grid-template-columns: repeat(4, auto);
        grid-template-rows: auto auto;
        justify-content: center;
    }
    
    .demo-group-container .avatar:nth-child(1) {
        grid-column: 1 / -1; /* Span all columns */
        justify-self: center;
        margin-bottom: 5px;
    }

    .waitlist-section {
        padding: 25px 20px;
        margin: 0 auto;
        border-radius: 16px;
    }

    .mc-field-group input {
        padding: 10px 14px;
        font-size: 14px;
    }

    /* Footer adjustments */
    footer {
        font-size: 12px;
        padding: 30px 20px;
    }
}