/* --- START OF FILE style.css --- */

/* Starry Theme Stylesheet */

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

:root {
    --starry-bg: #02020a;
    --starry-cyan: #22d3ee;
    --starry-blue: #3b82f6;
    --starry-deep-blue: #1e3a8a;
    --starry-glow: #38bdf8;
    --starry-gold: #fbbf24;
    --starry-text: #f0f9ff;
    --starry-text-dim: #94a3b8;
    --starry-border: rgba(56, 189, 248, 0.2);
    --starry-glass: rgba(2, 2, 10, 0.6);
}

/* --- GLOBAL SCROLLBAR --- */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--starry-blue) transparent;
}
::-webkit-scrollbar {
    width: 8px;
    background: transparent;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
    background-color: var(--starry-cyan);
}

body {
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
    background-color: var(--starry-bg);
    color: var(--starry-text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: radial-gradient(ellipse at bottom, #0f172a 0%, #02020a 100%);
}

#star-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

@keyframes shine {
    0% { background-position: 0% center; }
    100% { background-position: 400% center; }
}

/* --- HEADER --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
    z-index: 1000;
    backdrop-filter: blur(5px);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    z-index: 1002;
    min-width: max-content;
}

.logo-text {
    font-family: 'Trebuchet MS', sans-serif;
    font-weight: 900;
    font-size: 1.5rem;
    text-decoration: none;
    background: linear-gradient(90deg, #3b82f6, #38bdf8, #22d3ee, #06b6d4, #38bdf8, #3b82f6);
    background-size: 400% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 8s linear infinite;
    display: flex;
    align-items: center;
    gap: 15px;
    white-space: nowrap;
}

.header-content-wrapper {
    display: flex;
    align-items: center;
}

/* DESKTOP NAV LAYOUT */
@media (min-width: 901px) {
    .header-content-wrapper {
        flex-grow: 1;
        justify-content: flex-end;
    }

    .header-center {
        position: absolute;
        left: 0;
        right: 0;
        margin: auto;
        width: max-content;
        display: flex;
        gap: 2rem;
        align-items: center;
        /* Crucial for 3D stars */
        transform-style: preserve-3d;
        perspective: 1000px;
    }

    .header-right {
        margin-left: auto;
    }
    
    /* Toggle for Sidebar is hidden on desktop */
    .mobile-sidebar-toggle {
        display: none !important;
    }
}

/* --- HAMBURGER --- */
.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1002;
    padding: 10px;
}
.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--starry-cyan);
    box-shadow: 0 0 5px var(--starry-blue);
}
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* --- NAVIGATION LINKS & STAR ANIMATION --- */
.nav-item {
    position: relative;
    /* FIX: This ensures the child elements can exist in 3D space relative to this item */
    transform-style: preserve-3d; 
}

.nav-link {
    color: var(--starry-text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    display: block;
    font-weight: 600;
    transition: color 0.3s;
    position: relative;
    z-index: 5; /* Keep link above stars */
}
.nav-link:hover {
    color: var(--starry-cyan);
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.6);
}

/* ORBITING STAR ANIMATION LOGIC */
/* 1. Define 3D Space */
.star-hover-effect, 
.dropdown-item,
.sidebar-nav-link {  /* <--- ADDED SIDEBAR HERE */
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* 2. Create the Stars (Hidden by default) */
.star-hover-effect::before,
.star-hover-effect::after,
.dropdown-item::before,
.dropdown-item::after,
.sidebar-nav-link::before, /* <--- ADDED SIDEBAR HERE */
.sidebar-nav-link::after { /* <--- ADDED SIDEBAR HERE */
    content: '✦';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    font-size: 14px;
    color: var(--starry-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
    text-shadow: 0 0 10px var(--starry-blue);
    transition: opacity 0.1s ease-out, transform 0.1s ease-out;
}

/* 3. Trigger Animation on Hover (Desktop Only) */
@media (min-width: 901px) {
    .star-hover-effect:hover::before,
    .dropdown-item:hover::before,
    .sidebar-nav-link:hover::before { /* <--- ADDED SIDEBAR HERE */
        opacity: 1;
        animation: smoothOrbit1 3s infinite linear;
        transition: opacity 0.3s ease-in;
    }

    .star-hover-effect:hover::after,
    .dropdown-item:hover::after,
    .sidebar-nav-link:hover::after { /* <--- ADDED SIDEBAR HERE */
        opacity: 1;
        animation: smoothOrbit1 3s infinite linear;
        animation-delay: -1.5s;
        transition: opacity 0.3s ease-in;
    }
}

@keyframes smoothOrbit1 {
    0% { transform: rotateZ(45deg) rotateY(0deg) translateZ(30px) rotateY(0deg) rotateZ(-45deg) scale(1.5); z-index: 20; text-shadow: 0 0 15px var(--starry-cyan); }
    25% { transform: rotateZ(45deg) rotateY(90deg) translateZ(30px) rotateY(-90deg) rotateZ(-45deg) scale(1); z-index: 20; text-shadow: none; }
    50% { transform: rotateZ(45deg) rotateY(180deg) translateZ(30px) rotateY(-180deg) rotateZ(-45deg) scale(0.6); z-index: 1; opacity: 0.6; }
    75% { transform: rotateZ(45deg) rotateY(270deg) translateZ(30px) rotateY(-270deg) rotateZ(-45deg) scale(1); z-index: 20; }
    100% { transform: rotateZ(45deg) rotateY(360deg) translateZ(30px) rotateY(-360deg) rotateZ(-45deg) scale(1.5); z-index: 20; text-shadow: 0 0 15px var(--starry-cyan); }
}

/* --- DROPDOWNS --- */
.dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    background: rgba(2, 2, 10, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--starry-border);
    border-top: 2px solid var(--starry-cyan);
    border-radius: 0 0 12px 12px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: row;
    padding: 0;
    z-index: 1100;
}
@media (min-width: 901px) {
    .nav-item:hover .dropdown {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, 0);
    }
}
.dropdown-column {
    display: flex;
    flex-direction: column;
    min-width: 220px;
    padding: 0.8rem 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}
.dropdown-column:last-child { border-right: none; }
.dropdown-item {
    display: block;
    padding: 0.7rem 1.5rem;
    color: var(--starry-text-dim);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    z-index: 50; /* Higher than stars */
}
.dropdown-item:not([style*="pointer-events: none"]):hover {
    color: var(--starry-cyan);
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.08), transparent);
    padding-left: 1.8rem;
    text-shadow: 0 0 8px rgba(34, 211, 238, 0.3);
}

/* --- SEARCH --- */
.search-container {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--starry-border);
    border-radius: 20px;
    padding: 0.3rem 1rem;
    display: flex;
    align-items: center;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}
.search-input { background: transparent; border: none; color: white; outline: none; padding: 0.25rem; width: 200px; }
.search-filter { background: #0a0a1a; color: var(--starry-cyan); border: 1px solid var(--starry-border); border-radius: 4px; margin-left: 8px; padding: 2px 5px; }

/* --- PAGE LAYOUT & SIDEBAR --- */
.page-wrapper {
    display: flex;
    margin-top: 40px;
    min-height: calc(100vh - 80px);
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 220px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    position: fixed;
    top: 80px;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    padding: 1.5rem 0.5rem;
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background-color: rgba(56, 189, 248, 0.3); border-radius: 10px; }

.sidebar-nav-item { margin-bottom: 0; }

.sidebar-nav-link {
    display: block;
    padding: 0.4rem 1rem;
    color: var(--starry-text-dim);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    font-size: 0.9rem;
    line-height: 1.3;
    
    /* FIX: Added relative positioning and Z-index for stars */
    position: relative;
    z-index: 50; 
}
.sidebar-nav-link:hover {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.05), transparent);
    color: #fff;
    border-left-color: var(--starry-cyan);
    padding-left: 1.25rem;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.4);
}
.sidebar-nav-link.active {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.1), transparent);
    color: var(--starry-cyan);
    border-left-color: var(--starry-cyan);
    font-weight: bold;
}
.sidebar-section-title {
    color: var(--starry-gold);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    font-weight: 800;
    opacity: 0.9;
}

.content-with-sidebar {
    margin-left: 220px;
    padding: 3rem 4rem;
    width: 100%;
    max-width: 1200px;
}
.content.no-sidebar {
    margin-top: 40px;
    padding: 3rem;
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}
.content h1, .content-with-sidebar h1 {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
    font-weight: 300;
    border-bottom: 1px solid var(--starry-border);
    padding-bottom: 10px;
    display: inline-block;
}
.content-with-sidebar p {
    font-size: 1.05rem;
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 900px) {
    header { padding: 0 1.5rem; background: rgba(2, 2, 10, 0.98); }
    .hamburger { display: block; }
    
    /* Mobile Navigation Drawer */
    .header-content-wrapper {
        position: fixed;
        left: -100%;
        top: 0;
        width: 100%;
        height: 100vh;
        background: #02020a;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 90px;
        transition: 0.3s ease-in-out;
        z-index: 1001;
        overflow-y: auto;
    }
    .header-content-wrapper.active { left: 0; }
    .header-center {
        position: static;
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin: 0;
        transform: none;
    }
    .nav-item { width: 100%; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
    .nav-link { padding: 1.5rem; font-size: 1.2rem; display: flex; justify-content: center; align-items: center; }
    
    .nav-item:has(.dropdown) .nav-link::after {
        content: '▼'; font-size: 0.7em; margin-left: 10px; transition: transform 0.3s;
    }
    .nav-item:has(.dropdown.open) .nav-link::after {
        transform: rotate(180deg); color: var(--starry-cyan);
    }
    
    .dropdown {
        position: static; width: 100%; display: block; visibility: visible; opacity: 1; transform: none;
        background: rgba(255, 255, 255, 0.02); box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
        border: none; border-radius: 0; margin: 0; max-height: 0; overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }
    .dropdown.open { max-height: 1500px; border-top: 1px solid var(--starry-border); border-bottom: 1px solid var(--starry-border); }
    
    .dropdown-column { width: 100%; border: none; padding: 0; }
    .dropdown-item { padding: 1rem; text-align: center; font-size: 1rem; }
    .header-right { margin: 2rem 0; width: 90%; }
    .search-container { width: 100%; }
    .search-input { width: 100%; }
    
    /* Disable stars on mobile */
    .star-hover-effect:hover::before, .star-hover-effect:hover::after,
    .dropdown-item:hover::before, .dropdown-item:hover::after,
    .sidebar-nav-link:hover::before, .sidebar-nav-link:hover::after { display: none; }
    
    /* MOBILE SIDEBAR LOGIC */
    .page-wrapper { flex-direction: column; position: relative; }
    
    /* Hide Sidebar by default on mobile */
    .sidebar {
        position: fixed;
        top: 80px;
        left: -100%; /* Hidden off-screen */
        width: 80%;
        max-width: 320px;
        height: calc(100vh - 80px);
        border-right: 1px solid var(--starry-cyan);
        border-bottom: none;
        background: rgba(2, 2, 10, 0.98); /* Opaque background for legibility */
        padding: 1rem;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    .sidebar.active {
        left: 0; /* Slide in */
    }
    
    .content-with-sidebar { margin-left: 0; padding: 1.5rem; width: 100%; }
    
    /* Sidebar Toggle Button (Mobile Only) */
    .mobile-sidebar-toggle {
        display: flex;
        align-items: center;
        gap: 10px;
        background: rgba(34, 211, 238, 0.1);
        border: 1px solid var(--starry-cyan);
        color: var(--starry-cyan);
        padding: 10px 20px;
        border-radius: 8px;
        margin: 1rem 1.5rem 0 1.5rem;
        cursor: pointer;
        width: fit-content;
        font-weight: bold;
        transition: 0.3s;
        z-index: 50;
    }
    .mobile-sidebar-toggle:hover {
        background: rgba(34, 211, 238, 0.2);
        box-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
    }
}
