/* ORZATTY™ LAYOUT v1.2 (M3 Structure) */

/* --- APP BAR (TOP) --- */
.oz-app-bar {
    position: sticky;
    top: 0;
    z-index: var(--sys-z-sticky);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;

    /* Glass Effect default for App Bar */
    background: var(--sys-glass-surface);
    backdrop-filter: var(--sys-glass-blur);
    -webkit-backdrop-filter: var(--sys-glass-blur);
    border-bottom: 1px solid var(--sys-glass-border);
    transition: all 0.3s ease;
}

.oz-app-bar-title {
    font: var(--sys-text-h3);
    margin: 0;
}

/* --- NAVIGATION RAIL (SIDE - DESKTOP) --- */
.oz-nav-rail {
    position: fixed;
    left: 0;
    top: 64px;
    /* Below App Bar */
    bottom: 0;
    width: 80px;
    background: var(--sys-color-surface);
    border-right: 1px solid var(--sys-color-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 0;
    z-index: var(--sys-z-sticky);
}

.oz-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--sys-radius-lg);
    color: var(--sys-color-primary);
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    /* Context for indicator */
}

/* --- MAGIC INDICATOR --- */
.oz-nav-indicator {
    position: absolute;
    top: 0;
    /* Left/Width set by JS */
    left: 0;
    /* We align it manually via JS or centering.
       Actually JS sets width, so we just need left if not full width.
       Rail is flex-col align-center.
       But we changed logic to offsetTop.
       Let's center it horizontally if needed.
       For now, JS sets width equal to item width, so it matches.
    */
    background-color: var(--sys-color-surface-variant);
    /* Subtle Pill */
    /* active state might darken this via JS? No, just keep it neutral or accent-tinted */

    z-index: -1;
    /* Behind text */
    /* ELASTIC BOUNCE PHYSICS */
    transition:
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        /* Bouncy Translate */
        width 0.3s ease,
        height 0.3s ease,
        border-radius 0.3s ease;

    pointer-events: none;

    /* Optional: Glow for the indicator */
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
    /* Slight border ring */
}

.oz-nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    z-index: 1;
    /* Above indicator */
    transition: color 0.2s ease;
}

.oz-nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 1;
    /* Above indicator */
    transition: color 0.2s ease;
}

.oz-nav-item.active {
    /* No bg color */
    color: var(--sys-color-accent);
}

/* Remove old pseudo-element glow */
.oz-nav-item.active::before {
    display: none;
}

.oz-nav-item:hover {
    /* No bg color */
    color: var(--sys-color-on-surface);
    /* Maybe slight text darken */
}

/* --- MAIN LAYOUT WITH RAIL --- */
.oz-layout-rail {
    padding-left: 80px;
    /* Offset for Rail */
    min-height: 100vh;
}

/* --- GRID SYSTEM --- */
.oz-grid {
    display: grid;
    gap: 1.5rem;
}

.oz-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.oz-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.oz-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* --- MOBILE DRAWER (Transform Rail) --- */
.oz-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--sys-z-sticky) - 1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.oz-scrim.visible {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 1024px) {

    /* Adjust Main Content */
    .oz-layout-rail {
        padding-left: 0;
    }

    /* Adjust Container Padding */
    .container {
        padding: 2rem 1rem !important;
        /* Force override inline styles if any */
    }

    /* Transform Rail to Drawer */
    .oz-nav-rail {
        transform: translateX(-100%);
        width: 280px;
        /* Standard Drawer Width */
        align-items: flex-start;
        /* Align text left */
        padding: 2rem 1rem;
        box-shadow: var(--sys-shadow-lg);
        transition: transform 0.3s var(--sys-motion-standard);
        border-right: none;
        background: var(--sys-color-surface);
        /* Solid background */
    }

    .oz-nav-rail.is-open {
        transform: translateX(0);
        display: flex;
    }

    /* Adjust Items for Drawer List */
    .oz-nav-item {
        flex-direction: row;
        width: 100%;
        height: auto;
        min-height: 56px;
        /* Ensure visual touch target size */
        padding: 0 1.5rem;
        /* Horizontal padding, vertical handled by flex/height */
        align-items: center;
        /* Perfect vertical center */
        justify-content: flex-start;
        gap: 1.5rem;
        /* More space between icon and text */
        margin-bottom: 0.5rem;
        border-radius: 100px;
        /* Stadium shape */
        text-decoration: none !important;
        /* Force remove blue link underline */
    }

    .oz-nav-item span {
        font-size: 1rem;
        /* Larger text */
    }

    /* Grids Collapse */
    .oz-grid-3,
    .oz-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {

    /* Full Collapse */
    .oz-grid-2,
    .oz-grid-3,
    .oz-grid-4 {
        grid-template-columns: 1fr;
    }

    /* --- HERO RESPONSIVENESS --- */
    .hero {
        padding: 3rem 0 2rem 0 !important;
        /* Reduce vertical padding */
    }

    .hero h1 {
        font-size: 2rem !important;
        /* Smaller Hero Text */
        line-height: 1.2;
    }

    .hero p {
        font-size: 1rem !important;
    }

    /* --- APP BAR RESPONSIVENESS --- */
    .oz-app-bar {
        padding: 0 1rem;
        /* Tighter padding */
    }

    .oz-app-bar-title {
        font-size: 1.1rem;
        /* Smaller Title */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Hide "MATERIAL" span on very small screens to prevent overlap */
    .oz-app-bar-title span {
        display: none;
    }

    /* Hide "GitHub" text, keep only Badge if space is tight */
    .oz-app-bar .oz-btn-text {
        display: none;
    }
}