/* ═══════════════════════════════════════════════════════════════════
   LAYOUT FIX: CLEAN ARCHITECTURE
   Purpose: Establish proper z-index, grid zones, and visual hierarchy
   ═══════════════════════════════════════════════════════════════════ */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1. Z-INDEX HIERARCHY (FIXED LAYERS)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

:root {
    /* Z-Index Layers */
    --z-base: 1;
    --z-content: 10;
    --z-sidebar: 50;
    --z-header: 100;
    --z-navigation: 200;
    --z-floating-ui: 300;
    --z-modal: 500;
    --z-overlay: 1000;
    --z-cursor: 9999;

    /* Layout Zones */
    --header-height: 80px;
    --sidebar-width: 80px;
    --content-max-width: 1400px;
    --spacing-unit: 1.5rem;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   2. GRID LAYOUT ZONES
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

body {
    display: grid;
    grid-template-areas:
        "header header"
        "sidebar content";
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--header-height) 1fr;
    min-height: 100vh;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   3. HEADER ZONE (FIXED, CLEAN, AUTHORITATIVE)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.header {
    grid-area: header;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: var(--z-header);
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    mix-blend-mode: normal;
    /* Remove difference mode */
}

/* Logo */
.header .logo {
    font-size: 1.8rem;
    font-weight: 700;
    z-index: var(--z-header);
}

/* Navigation */
.header nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    font-size: 0.9rem;
    font-family: var(--font-heading);
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Game Buttons (Contained) */
.game-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: var(--font-heading);
    transition: all 0.3s ease;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   4. SIDEBAR ZONE (LEFT, MINIMAL, GROUPED)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.coding-trigger-sidebar {
    grid-area: sidebar;
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    z-index: var(--z-sidebar);
    background: rgba(10, 10, 10, 0.9);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    gap: 1.5rem;
}

.coding-icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.coding-icon-container:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.05);
}

.coding-icon-large {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.coding-label {
    font-size: 0.7rem;
    font-family: var(--font-heading);
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   5. CONTENT ZONE (MAIN AREA, CLEAN BOUNDARIES)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

main {
    grid-area: content;
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    width: calc(100% - var(--sidebar-width));
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

/* Section Spacing */
section {
    padding: 8rem 0;
    position: relative;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   6. FLOATING UI ELEMENTS (RIGHT SIDE, STACKED CLEANLY)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.floating-ui-stack {
    position: fixed;
    right: 2rem;
    top: calc(var(--header-height) + 2rem);
    z-index: var(--z-floating-ui);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.floating-ui-stack>* {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.floating-ui-stack>*:hover {
    transform: scale(1.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

/* AI Chat Button */
.ai-chat-trigger {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    z-index: var(--z-floating-ui);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-tertiary));
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(191, 0, 255, 0.4);
    transition: all 0.3s ease;
}

.ai-chat-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(191, 0, 255, 0.6);
}

.ai-icon {
    font-size: 1.8rem;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   7. GOOGLE AUTH FIX (CLEAN, TRUSTWORTHY)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.google-auth-mock {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: white;
    color: #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 1rem;
}

.google-auth-mock:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.google-auth-mock img {
    width: 24px;
    height: 24px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   8. LANGUAGE ICONS (CONTAINED, STRUCTURED)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.lang-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.2);
}

.lang-icon {
    font-size: 3rem;
}

.lang-name {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   9. TYPOGRAPHY HIERARCHY (CLEAR VISUAL FLOW)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Primary Heading */
h1,
.hero-name {
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 700;
    line-height: 1.1;
}

/* Section Titles */
h2,
.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 600;
    margin-bottom: 4rem;
}

/* Subsection Titles */
h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

/* Body Text */
p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.8);
}

/* Secondary Text */
.secondary-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   10. OVERLAY SYSTEM (MODALS, CODING ENV)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.coding-environment,
.login-overlay,
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-overlay);
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.coding-environment.active,
.login-overlay.active,
.modal.active {
    opacity: 1;
    pointer-events: all;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   11. RESPONSIVE BREAKPOINTS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

@media (max-width: 1024px) {
    body {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "content";
    }

    .coding-trigger-sidebar {
        display: none;
    }

    main {
        margin-left: 0;
        width: 100%;
    }

    .floating-ui-stack {
        right: 1rem;
        top: calc(var(--header-height) + 1rem);
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
        --spacing-unit: 1rem;
    }

    .header {
        padding: 0 1.5rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .game-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .floating-ui-stack {
        display: none;
        /* Hide on mobile to reduce clutter */
    }

    .ai-chat-trigger {
        width: 50px;
        height: 50px;
        right: 1rem;
        bottom: 1rem;
    }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   12. CURSOR (HIGHEST Z-INDEX)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.cursor,
.cursor-follower {
    z-index: var(--z-cursor);
}