/* ==========================================================================
   ANTIGRAVITY SaaS DESIGN SYSTEM — GLOBAL CSS
   Single source of truth for colors, typography, glass panels, and shell styles.
   ========================================================================== */

/* 1. GLOBAL DESIGN TOKENS (Light & Dark System) */
:root {
    --bg-dark: #f4f4f6;       /* Clean Off-White Zinc Page Canvas */
    --bg-card: #ffffff;       /* Pure White Glass Card Surface */
    --bg-card-hover: #f1f1f4; /* Card Hover Light Tint */
    --border-dark: #e4e4e7;   /* Light Zinc Border */
    --border-hover: #d4d4d8;  /* High Contrast Hover Border */
    
    --accent: #09090b;        /* Dark Charcoal Primary Accent */
    --accent-hover: #18181b;  /* Dark Charcoal Hover */
    --accent-bg: rgba(9, 9, 11, 0.05); /* Soft Tint Badge Fill */
    --accent-glow: rgba(9, 9, 11, 0.1);
    
    --text-primary: #09090b;  /* High Contrast Heading Text */
    --text-secondary: #52525b;/* Medium Charcoal Body Copy */
    --text-muted: #71717a;    /* Muted Metadata Gray */
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.06);
}

html.dark, html[data-theme="dark"] {
    --bg-dark: #09090b;       /* Deepest Charcoal Zinc */
    --bg-card: #121215;       /* Elevated Dark Gray Card Surface */
    --bg-card-hover: #18181b; /* Card Hover Slate */
    --border-dark: #27272a;   /* Structural Zinc Border */
    --border-hover: #3f3f46;  /* High Contrast Hover Border */
    
    --accent: #ffffff;        /* Pure White Primary Accent */
    --accent-hover: #e4e4e7;  /* Off-White Hover */
    --accent-bg: rgba(255, 255, 255, 0.08); /* Translucent White Badge Fill */
    --accent-glow: rgba(255, 255, 255, 0.15); /* Soft White Halo Glow */
    
    --text-primary: #ffffff;  /* Pure White Heading Text */
    --text-secondary: #a1a1aa;/* Cool Zinc Body Copy */
    --text-muted: #71717a;    /* Subdued Muted Metadata Gray */
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* 2. BASE RESET & BODY STYLES */
html, body {
    height: 100%;
    max-height: 100vh;
    overflow: hidden !important;
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* 3. BACKGROUND GRID PATTERN */
.bg-clean-dark {
    background-color: var(--bg-dark);
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px, 40px 40px;
}

/* 4. GLASS PANEL & MACOS WINDOW CONTAINERS */
.glass-panel {
    position: relative;
    background-color: var(--bg-card);
    border: 1px solid var(--border-dark);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}

.tilt-card {
    position: relative;
    background-color: var(--bg-card);
    border: 1px solid var(--border-dark);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ==========================================================================
   FANCY ANIMATED GRADIENT BORDER HOVER SYSTEM
   Moving silver-white shimmering gradient border overlay on tile hover
   ========================================================================== */
@keyframes gradientBorderSpin {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Pseudo-element for animated gradient border overlay */
.glass-panel::after,
.tilt-card::after,
.memory-card::after,
.animated-gradient-tile::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0.95),
        rgba(113, 113, 122, 0.3),
        rgba(255, 255, 255, 0.9),
        rgba(39, 39, 42, 0.3),
        rgba(255, 255, 255, 0.95)
    );
    background-size: 300% 300%;
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: gradientBorderSpin 3.5s linear infinite;
    z-index: 10;
}

/* Reveal animated gradient border on hover + elevate card */
.glass-panel:hover::after,
.tilt-card:hover::after,
.memory-card:hover::after,
.animated-gradient-tile:hover::after {
    opacity: 1;
}

.glass-panel:hover,
.tilt-card:hover,
.memory-card:hover {
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 255, 255, 0.12);
}

/* Disable hover outline animation & gradient outline for sidebar and topbar header */
#sidebar::after,
header::after,
#sidebar:hover::after,
header:hover::after {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
}

#sidebar:hover,
header:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    border-color: var(--border-dark) !important;
}


/* 5. SIDEBAR NAVIGATION ACTIVE STATES */
.nav-item-active {
    background-color: var(--accent-bg);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--accent);
    font-weight: 500;
}

/* 6. CUSTOM SCROLLBARS */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* 7. SELECTION HIGHLIGHT */
::selection {
    background: var(--accent-bg);
    color: var(--accent);
}

/* 8. WORK HISTORY ORBIT TO TIMELINE CONTINUOUS MORPH STAGE */
.wh-container {
    position: relative;
    width: 100%;
    height: 310px;
    transition: height 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

/* Central N Icon in Orbit Mode */
.wh-center-n {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--accent);
    box-shadow: 0 0 25px var(--accent-glow), inset 0 0 15px var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}

.wh-orbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    pointer-events: none;
    transition: opacity 0.6s ease;
    animation: spinOrbit 22s linear infinite;
}

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

/* Orbit Stage Rotating Wrapper (Active only in Orbit mode) */
.wh-orbit-rotator {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    margin-left: -100px;
    margin-top: -100px;
    border-radius: 50%;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
    animation: rotateOrbit 14s linear infinite;
}

.wh-container.paused .wh-orbit-rotator,
.wh-container.paused .wh-orbit-ring {
    animation-play-state: paused;
}

@keyframes rotateOrbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Single Item CSS Morph System */
.wh-item {
    position: absolute;
    box-sizing: border-border-box;
    transition: top 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                left 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                width 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                border-radius 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s ease,
                box-shadow 0.6s ease,
                padding 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    z-index: 20;
}

/* --- ORBIT MODE SPECIFICS --- */
.wh-container.mode-orbit .wh-item {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border-dark);
    background: var(--bg-card);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    padding: 0;
    overflow: hidden;
    cursor: pointer;
}

.wh-container.mode-orbit .wh-item:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.wh-container.mode-orbit .wh-item-1 { top: -24px; left: 76px; }
.wh-container.mode-orbit .wh-item-2 { top: 76px; left: 176px; }
.wh-container.mode-orbit .wh-item-3 { top: 176px; left: 76px; }
.wh-container.mode-orbit .wh-item-4 { top: 76px; left: -24px; }

.wh-container.mode-orbit .wh-logo-chip {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.wh-container.mode-orbit .wh-logo-chip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: counterRotate 14s linear infinite;
}

.wh-container.paused .wh-logo-chip img {
    animation-play-state: paused;
}

@keyframes counterRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

.wh-container.mode-orbit .wh-details {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* --- TIMELINE MORPH MODE SPECIFICS --- */
.wh-container.mode-timeline .wh-center-n {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
    pointer-events: none;
}

.wh-container.mode-timeline .wh-orbit-ring {
    opacity: 0;
}

.wh-container.mode-timeline .wh-orbit-rotator {
    animation-play-state: paused !important;
    transform: rotate(0deg) !important;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    margin: 0;
    border-radius: 0;
}

.wh-container.mode-timeline .wh-item {
    left: 0 !important;
    width: 100% !important;
    height: 66px !important;
    border-radius: 12px !important;
    border: 1px solid var(--border-dark);
    background-color: rgba(11, 15, 25, 0.95);
    padding: 10px 14px;
    box-shadow: none;
    overflow: visible;
}

.wh-container.mode-timeline .wh-item:hover {
    border-color: var(--accent);
    background-color: rgba(255, 255, 255, 0.04);
}

.wh-container.mode-timeline .wh-item-1 { top: 0px; }
.wh-container.mode-timeline .wh-item-2 { top: 76px; }
.wh-container.mode-timeline .wh-item-3 { top: 152px; }
.wh-container.mode-timeline .wh-item-4 { top: 228px; }

.wh-container.mode-timeline .wh-logo-chip {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-dark);
    overflow: hidden;
    shrink: 0;
}

.wh-container.mode-timeline .wh-logo-chip img {
    animation: none !important;
    transform: none !important;
}

.wh-container.mode-timeline .wh-details {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
    width: calc(100% - 48px);
}

/* SILHOUETTE PORTRAIT ANIMATED GRADIENT OUTLINE EFFECT (HOVER ONLY) */
.silhouette-portrait {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    filter: drop-shadow(0 0 0px transparent);
}

.silhouette-portrait:hover {
    transform: scale(1.03);
    animation: gradientOutlineAnimation 5s linear infinite;
}

@keyframes gradientOutlineAnimation {
    0% {
        filter: 
            drop-shadow(2px 0 0 #ffffff) 
            drop-shadow(-2px 0 0 #52525b) 
            drop-shadow(0 2px 0 #d4d4d8) 
            drop-shadow(0 -2px 0 #18181b);
    }
    25% {
        filter: 
            drop-shadow(2px 0 0 #18181b) 
            drop-shadow(-2px 0 0 #ffffff) 
            drop-shadow(0 2px 0 #52525b) 
            drop-shadow(0 -2px 0 #d4d4d8);
    }
    50% {
        filter: 
            drop-shadow(2px 0 0 #d4d4d8) 
            drop-shadow(-2px 0 0 #18181b) 
            drop-shadow(0 2px 0 #ffffff) 
            drop-shadow(0 -2px 0 #52525b);
    }
    75% {
        filter: 
            drop-shadow(2px 0 0 #52525b) 
            drop-shadow(-2px 0 0 #d4d4d8) 
            drop-shadow(0 2px 0 #18181b) 
            drop-shadow(0 -2px 0 #ffffff);
    }
    100% {
        filter: 
            drop-shadow(2px 0 0 #ffffff) 
            drop-shadow(-2px 0 0 #52525b) 
            drop-shadow(0 2px 0 #d4d4d8) 
            drop-shadow(0 -2px 0 #18181b);
    }
}

/* ==========================================================================
   LIGHT THEME OVERRIDES (AUTOMATIC & MANUAL TOGGLE COMPATIBLE)
   ========================================================================== */
html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="light"] body {
    background-color: #f4f4f6 !important;
    color: #09090b !important;
}

html[data-theme="light"] .bg-clean-dark {
    background-color: #f4f4f6 !important;
    background-image: 
        linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 1px, transparent 1px) !important;
}

html[data-theme="light"] .glass-panel,
html[data-theme="light"] .tilt-card {
    background-color: #ffffff !important;
    border-color: #e4e4e7 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="light"] #sidebar {
    background-color: #ffffff !important;
    border-color: #e4e4e7 !important;
}

html[data-theme="light"] header {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-color: #e4e4e7 !important;
}

html[data-theme="light"] .text-white {
    color: #09090b !important;
}

html[data-theme="light"] .text-zinc-100,
html[data-theme="light"] .text-zinc-200 {
    color: #18181b !important;
}

html[data-theme="light"] .text-zinc-300,
html[data-theme="light"] .text-zinc-400 {
    color: #52525b !important;
}

html[data-theme="light"] .text-zinc-500 {
    color: #71717a !important;
}

html[data-theme="light"] .bg-zinc-950,
html[data-theme="light"] .bg-zinc-900 {
    background-color: #f4f4f5 !important;
    border-color: #e4e4e7 !important;
}

html[data-theme="light"] .bg-zinc-900\/90,
html[data-theme="light"] .bg-zinc-900\/80,
html[data-theme="light"] .bg-zinc-900\/60 {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-color: #e4e4e7 !important;
}

html[data-theme="light"] .bg-zinc-800,
html[data-theme="light"] .bg-zinc-800\/80,
html[data-theme="light"] .bg-zinc-800\/50 {
    background-color: #e4e4e7 !important;
    border-color: #d4d4d8 !important;
    color: #09090b !important;
}

html[data-theme="light"] .border-zinc-800,
html[data-theme="light"] .border-zinc-700 {
    border-color: #e4e4e7 !important;
}

/* Light Theme Action Buttons & Contrast Inversion */
html[data-theme="light"] .bg-white {
    background-color: #09090b !important;
    color: #ffffff !important;
}

html[data-theme="light"] .bg-white .text-zinc-950,
html[data-theme="light"] .bg-white svg,
html[data-theme="light"] .bg-white i {
    color: #ffffff !important;
}

html[data-theme="light"] .text-zinc-950 {
    color: #ffffff !important;
}

html[data-theme="light"] .bg-white:hover {
    background-color: #27272a !important;
}

/* Light Theme Modals & Dialog Backdrop */
html[data-theme="light"] #lightbox,
html[data-theme="light"] #cmd-modal {
    background-color: rgba(244, 244, 246, 0.85) !important;
}

html[data-theme="light"] #lightbox-card,
html[data-theme="light"] #cmd-modal > div {
    background-color: #ffffff !important;
    border-color: #e4e4e7 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12) !important;
}

/* ==========================================================================
   FULL SCREEN PRELOADER THEME OVERRIDES (BOOT OVERLAY & PERSONAL LOADER)
   ========================================================================== */
html[data-theme="light"] #boot-overlay {
    background-color: #f4f4f6 !important;
    color: #09090b !important;
}

html[data-theme="light"] #boot-overlay .border-zinc-800,
html[data-theme="light"] #boot-overlay .border-zinc-700 {
    border-color: #e4e4e7 !important;
}

html[data-theme="light"] #boot-overlay .text-zinc-200,
html[data-theme="light"] #boot-overlay .text-zinc-300,
html[data-theme="light"] #boot-overlay .text-white {
    color: #09090b !important;
}

html[data-theme="light"] #boot-overlay .text-zinc-400,
html[data-theme="light"] #boot-overlay .text-zinc-500 {
    color: #52525b !important;
}

html[data-theme="light"] #boot-overlay .bg-zinc-950 {
    background-color: #ffffff !important;
    border-color: #e4e4e7 !important;
}

html[data-theme="light"] #boot-overlay #boot-progress-fill {
    background-color: #09090b !important;
    box-shadow: 0 0 10px rgba(9, 9, 11, 0.3) !important;
}

html[data-theme="light"] #boot-overlay #boot-welcome-msg {
    background-color: #ffffff !important;
    border-color: #e4e4e7 !important;
    color: #09090b !important;
}

/* Light Theme Overrides for Personal Page Full Screen Loader */
html[data-theme="light"] .personal-loader-overlay {
    background-color: #f4f4f6 !important;
    color: #09090b !important;
}

html[data-theme="light"] .personal-loader-overlay .loader-percent-num {
    color: #09090b !important;
    text-shadow: 0 0 30px rgba(9, 9, 11, 0.15) !important;
}

html[data-theme="light"] .personal-loader-overlay .loader-status-msg {
    color: #52525b !important;
}

html[data-theme="light"] .personal-loader-overlay .loader-progress-track {
    background: #e4e4e7 !important;
    border-color: #d4d4d8 !important;
}

html[data-theme="light"] .personal-loader-overlay .loader-progress-fill {
    background: #09090b !important;
    box-shadow: 0 0 12px rgba(9, 9, 11, 0.4) !important;
}



