/* Import fonts from Google Fonts */
/* Outfit for body text, Space Grotesk for headers/tech vibe */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;800&family=Space+Grotesk:wght@400;700&display=swap');

/* =========================================
   VARIABLES (THEME CONFIGURATION)
   ========================================= */
:root {
    --accent: #ff7675; /* Primary accent color (Coral) */
    --bat-yellow: #f1c40f; /* Secondary accent (Batman Yellow) used for highlights */
    --secondary: #74b9ff; /* Blue for subheaders or tech elements */
    --dark: #2d3436; /* Dark grey for backgrounds */
    --glass: rgba(15, 12, 41, 0.85); /* Semi-transparent background for panels */
    --border: rgba(255, 255, 255, 0.1); /* Subtle border color */
}

/* Reset default browser spacing */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* =========================================
   GLOBAL BODY STYLES
   ========================================= */
body {
    overflow: hidden; /* Prevent native scrollbars (scrolling handled by JS/Canvas) */
    background: #000;
    font-family: 'Outfit', sans-serif;
    color: white;
}

/* =========================================
   LAYERS & CONTAINERS
   ========================================= */

/* The 3D World Container */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1; /* Lowest visual layer */
}

/* The 2D UI Overlay Layer */
#ui-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10; /* Sits above the 3D canvas */
    pointer-events: none; /* Allows clicks to pass through to the 3D world */
    transition: opacity 1s; /* Fade effect when revealing */
}

#ui-layer.hidden {
    opacity: 0; /* Hide UI initially or during transitions */
}

/* =========================================
   INTRO OVERLAY (LANDING PAGE)
   ========================================= */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: black;
    z-index: 20; /* Highest layer, covers everything */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-family: 'Space Grotesk', monospace;
}

/* The typing text area */
#terminal-text {
    font-size: 1.5rem;
    color: var(--bat-yellow);
    margin-bottom: 30px;
    min-height: 120px; /* Reserves space so layout doesn't jump while typing */
    white-space: pre-wrap; /* Preserves line breaks from JSON */
    text-shadow: 0 0 5px var(--bat-yellow); /* Glowing text effect */
    text-align: left;
    width: 80%;
    max-width: 600px;
}

/* The "Enter Experience" button */
#start-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    background: transparent;
    color: var(--bat-yellow);
    border: 2px solid var(--bat-yellow);
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: 0.3s;
    opacity: 0; /* Hidden initially */
    transform: translateY(20px); /* Pushed down for animation */
}

#start-btn.visible {
    opacity: 1; /* Fade in */
    transform: translateY(0); /* Slide up */
}

#start-btn:hover {
    background: var(--bat-yellow);
    color: black;
    box-shadow: 0 0 20px var(--bat-yellow); /* Glow on hover */
}

/* =========================================
   LOADER ANIMATION
   ========================================= */
#loader {
    position: fixed;
    z-index: 999; /* Absolute top priority */
    background: #000;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--bat-yellow); /* Rotating part color */
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================
   HUD ELEMENTS (HEADS-UP DISPLAY)
   ========================================= */
#header {
    position: absolute;
    top: 40px;
    left: 40px;
}

#ui-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

#ui-role {
    color: var(--secondary);
    font-weight: 300;
}

/* Scroll Hint Animation */
#scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0.8;
    animation: bounce 2s infinite; /* Vertical bounce */
}

.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid white;
    border-radius: 12px;
    margin: 0 auto 10px;
}

.wheel {
    width: 4px;
    height: 8px;
    background: white;
    border-radius: 2px;
    margin: 6px auto;
    animation: scroll 1.5s infinite; /* Wheel scrolling down animation */
}

@keyframes scroll { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(15px); } }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);} 40% {transform: translateX(-50%) translateY(-10px);} 60% {transform: translateX(-50%) translateY(-5px);} }

/* Zone Indicator (Top Right) */
#zone-indicator {
    position: absolute;
    top: 40px;
    right: 40px;
    font-family: 'Space Grotesk', sans-serif;
    border: 1px solid var(--bat-yellow);
    padding: 5px 15px;
    border-radius: 4px;
    color: var(--bat-yellow);
    background: rgba(0,0,0,0.5);
}

/* =========================================
   PROGRESS BAR (RIGHT SIDE)
   ========================================= */
#progress-container {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    height: 200px;
    display: flex;
    flex-direction: row-reverse; /* Align bar to the right of dots */
    align-items: center;
    gap: 10px;
}

.progress-bar {
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,0.1);
    position: relative;
}

/* The actual fill of the progress bar */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--prog, 0%); /* Height controlled by JS variable */
    background: var(--bat-yellow);
    transition: height 0.1s;
}

.dots-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: all 0.3s;
}

.dot.active {
    background: var(--bat-yellow);
    box-shadow: 0 0 10px var(--bat-yellow);
}

/* =========================================
   CONTENT PANEL (SIDEBAR/MODAL)
   ========================================= */
.panel {
    position: absolute;
    right: 100px; /* Positioned to the left of the progress bar */
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    max-height: 75vh;
    background: var(--glass);
    backdrop-filter: blur(10px); /* Frosted glass effect */
    border: 1px solid var(--border);
    border-left: 4px solid var(--bat-yellow); /* Accent border */
    padding: 30px;
    border-radius: 8px;
    color: white;
    overflow-y: auto; /* Allow scrolling within the panel */
    transition: all 0.5s ease;
    opacity: 1;
    pointer-events: auto; /* Re-enable clicks inside the panel */
}

/* Hidden state for panel */
.panel.hidden {
    opacity: 0;
    transform: translate(50px, -50%); /* Slide out to the right */
    pointer-events: none;
}

.panel h2 {
    font-family: 'Space Grotesk';
    color: var(--secondary);
    margin-bottom: 20px;
    font-size: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

/* Standard List Items (Job, Education) */
.panel-item {
    margin-bottom: 20px;
}

.panel-item h3 { font-size: 1.1rem; margin-bottom: 5px; color: #fff; }
.panel-item .meta { font-size: 0.8rem; color: var(--bat-yellow); margin-bottom: 8px; display: block; }
.panel-item p { font-size: 0.9rem; line-height: 1.5; color: #ccc; }

/* Skill Pills */
.skill-tag {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 0 5px 5px 0;
    border: 1px solid var(--secondary);
    color: #eee;
}

/* Project Cards */
.project-card {
    /* REMOVED !important so inline JS styles from config work */
    background: rgba(0, 0, 0, 0.4); 
    backdrop-filter: blur(10px);
    padding: 0;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    border-color: var(--bat-yellow);
}

.project-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.project-info {
    padding: 15px;
}

.project-tag {
    display: inline-block;
    font-size: 0.7rem;
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 4px;
    color: #fff;
}

/* Certification Cards */
.cert-card {
    background: rgba(255,255,255,0.05);
    border-left: 2px solid var(--bat-yellow);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 0 8px 8px 0;
}
.cert-card h4 { color: white; margin-bottom: 2px; font-size: 1rem; }
.cert-card .issuer { color: #aaa; font-size: 0.8rem; }
.cert-card .date { float: right; color: var(--bat-yellow); font-size: 0.8rem; }
.cert-card p { font-size: 0.85rem; color: #ccc; margin-top: 5px; }

/* Contact Links */
.contact-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: white;
    background: rgba(255,255,255,0.1);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    transition: 0.3s;
}

.contact-link:hover { background: var(--bat-yellow); color: #000; }
.contact-icon { font-size: 1.5rem; }

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    #ui-layer { pointer-events: none; }
    
    #header {
        top: 15px;
        left: 20px;
    }
    
    #ui-name { font-size: 1.2rem; }
    #ui-role { font-size: 0.8rem; }
    
    #zone-indicator {
        top: 15px;
        right: 15px;
        font-size: 0.7rem;
        padding: 4px 10px;
    }
    
    #progress-container { display: none; /* Hide progress bar on mobile */ }
    
    /* FIX: Panel is moved to bottom sheet on mobile */
    .panel {
        width: 100%;
        left: 0;
        bottom: 0;
        top: auto;
        transform: translateY(0);
        border-radius: 20px 20px 0 0;
        max-height: 40vh; /* Reduced height to leave room for 3D view */
        border-left: none;
        border-top: 4px solid var(--bat-yellow);
        padding: 20px;
        background: rgba(15, 12, 41, 0.95); /* darker/more opaque for readability */
    }
    
    .panel.hidden {
        transform: translateY(100%); /* Slide down off screen */
        opacity: 1;
    }
    
    #terminal-text { font-size: 1rem; width: 85%; }
    
    #scroll-hint { bottom: 45vh; } /* Moved up to not overlap with bottom panel */
}
