/* =========================================
   GLOBAL VARIABLES & THEME
   ========================================= */
:root {
    --primary-color: #2962FF;
    --secondary-color: #FF6D00;
    --tertiary-color: #4CAF50;
    --danger-color: #D50000;
    --ratio-color: #9C27B0;
    
    /* Heatmap / Status Colors */
    --hm-up-bg: #00C853; 
    --hm-down-bg: #D50000; 
    --hm-up-txt: #000000;
    --hm-down-txt: #FFFFFF;

    /* Dark Mode (Default) */
    --bg-body: #111111;
    --bg-card: #1e1e1e;
    --text-main: #ffffff; 
    --text-muted: #b0b0b0;
    --border-color: #333333;
    --grid-color: #2a2a2a;
    --hover-bg: #2d2d2d;
    --shadow: 0 4px 15px rgba(0,0,0,0.3);
    --bg-nav: rgba(30, 30, 30, 0.8);
}

[data-theme="light"] {
    --bg-body: #f8f9fb;
    --bg-card: #ffffff;
    --text-main: #222222;
    --text-muted: #666666;
    --border-color: #e0e3eb;
    --grid-color: #f0f3fa;
    --hover-bg: #f0f3fa;
    --shadow: 0 4px 15px rgba(0,0,0,0.05);
    --hm-up-bg: #00FF00;
    --hm-down-bg: #FF0000;
    --hm-up-txt: #000000;
    --hm-down-txt: #FFFFFF;
    --bg-nav: rgba(255, 255, 255, 0.8);
}

/* =========================================
   RESET & TYPOGRAPHY
   ========================================= */
html { scroll-behavior: smooth; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; 
    background: var(--bg-body); 
    color: var(--text-main); 
    margin: 0; 
    padding: 0; 
    transition: 0.3s; 
}
a { text-decoration: none; color: inherit; }
[v-cloak] { display: none; }

/* =========================================
   LAYOUT COMPONENTS
   ========================================= */
.container { 
    max-width: 1536px; 
    margin: 0 auto; 
    padding: 0 20px 20px 20px; 
    display: flex; 
    flex-direction: column; 
    gap: 25px; 
}

.card { 
    background: var(--bg-card); 
    padding: 30px; 
    border-radius: 12px; 
    box-shadow: var(--shadow); 
    position: relative; 
    border: 1px solid var(--border-color); 
}

.header { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 20px; 
    gap: 20px; 
}

.header-title h1 { 
    font-size: 1.6rem; 
    margin: 0 0 5px 0; 
    line-height: 1.2; 
    font-weight: 700; 
    color: var(--text-main); 
}

.header-title sub { 
    font-size: 0.9rem; 
    color: var(--text-muted); 
}

/* =========================================
   NAVIGATION BAR & CONTENT
   ========================================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    height: 64px; 
    margin-bottom: 25px; /* <--- ADD THIS LINE TO RESTORE THE SPACE */
}

.nav-content {
    max-width: 1536px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left, .nav-right { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
}

/* Desktop Link Container */
.nav-links { 
    display: flex; 
    gap: 8px; 
    align-items: center;
}

/* Desktop Pill Links */
.nav-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1; 
    border: none !important;
    white-space: nowrap; /* Prevents text from wrapping inside pill */
}

.nav-link:hover {
    color: var(--text-main);
    background: var(--hover-bg);
}

.nav-link.active {
    background: var(--primary-color) !important;
    color: #FFFFFF !important; 
    box-shadow: 0 4px 12px rgba(41, 98, 255, 0.4);
}

/* =========================================
   MOBILE MENU & OVERLAY
   ========================================= */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

.mobile-nav-container {
    display: none; /* Controlled by JS toggle */
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    z-index: 9999;
    flex-direction: column;
}

/* Hide mobile nav on desktop */
@media (min-width: 993px) {
    .mobile-nav-container {
        display: none !important;
    }
}

.mobile-nav-link {
    padding: 14px 20px;
    color: var(--text-muted);
    font-weight: 600;
    margin: 4px 10px;
    border-radius: 8px;
    transition: 0.2s;
    display: block;
}

.mobile-nav-link.active {
    background: var(--primary-color);
    color: #FFFFFF !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tablets and mobile - show hamburger menu instead of nav links */
@media (max-width: 992px) {
    .nav-links { display: none !important; }
    .mobile-menu-btn { display: block !important; }
}

/* Status Pill (Beta Tag) */
.status-pill {
    font-size: 10px;
    background: rgba(41, 98, 255, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(41, 98, 255, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Theme Toggle Button */
.theme-btn { 
    background: transparent; 
    border: 1px solid var(--border-color); 
    color: var(--text-main); 
    padding: 0; 
    border-radius: 50%; 
    cursor: pointer; 
    width: 36px; 
    height: 36px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: 0.2s; 
}
.theme-btn:hover { background: var(--hover-bg); }

/* =========================================
   USER PROFILE DROPDOWN
   ========================================= */
.nav-user-section {
    position: relative;
    display: flex;
    align-items: center;
}

.user-profile-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.user-profile-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
}

.user-icon {
    font-size: 18px;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
    margin-left: 4px;
}

.user-profile-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 220px;
    overflow: hidden;
}

.user-menu-header {
    padding: 12px 16px;
    background: var(--hover-bg);
    border-bottom: 1px solid var(--border-color);
}

.user-menu-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 14px;
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: var(--text-main);
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
    font-family: inherit;
}

.user-menu-item:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

.logout-btn {
    color: #f44336;
}

.logout-btn:hover {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

/* =========================================
   MOBILE MENU
   ========================================= */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 5px;
}

.mobile-nav-container {
    display: none;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    z-index: 999;
    box-shadow: var(--shadow);
}
.mobile-nav-container.open { display: flex; flex-direction: column; }

.mobile-nav-link {
    padding: 15px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    display: block;
}
.mobile-nav-link:last-child { border-bottom: none; }
.mobile-nav-link:hover { background: var(--hover-bg); }

/* Mobile phones - additional adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 5px 5px 5px;
    }
    
    .header { flex-direction: column; align-items: flex-start; }
    
    .user-profile-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .user-name {
        display: none;
    }
    
    .user-dropdown-menu {
        min-width: 180px;
    }
}

/* =========================================
   COMMON UTILITIES & BUTTONS
   ========================================= */
.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}
.btn-primary:hover { opacity: 0.9; }

.positive { color: var(--hm-up-bg); }
.negative { color: var(--hm-down-bg); }

/* Footer */
.site-footer {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}
.site-footer p { margin: 0 0 10px 0; }
.site-footer .copyright { margin-bottom: 8px; color: var(--text-main); }
.site-footer a { color: var(--primary-color); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.loading-status { font-size: 13px; color: var(--text-muted); margin-top: 15px; text-align: center; }


/* =========================================
   PORTFOLIO BRANDING (The "Goldilocks" Size)
   ========================================= */
:root {
    --portfolio-bg: linear-gradient(135deg, rgba(255, 160, 0, 0.95) 0%, rgba(255, 111, 0, 0.95) 100%);
    --portfolio-glow: rgba(255, 160, 0, 0.4);
    --glass-border: rgba(255, 255, 255, 0.3);
}

/* 1. NAV MENU BUTTON (Stays Bold & Highlighted) */
.nav-portfolio-cta {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: var(--portfolio-bg) !important;
    color: #ffffff !important;
    padding: 8px 18px !important;
    border-radius: 6px !important;
    font-weight: 800 !important;
    font-size: 14px !important;
    text-decoration: none !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 4px 12px var(--portfolio-glow) !important;
    transition: all 0.3s ease !important;
}

/* 2. THE FLOATING PILL (Medium Pro Sizing) */
.portfolio-pill-container {
    position: fixed !important;
    bottom: 25px;
    right: 25px;
    z-index: 99999;
    display: flex;
    align-items: center;
    background: var(--portfolio-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 50px; 
    box-shadow: 0 10px 25px var(--portfolio-glow);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Slide-In States */
.pill-hidden { transform: translateY(100px); opacity: 0; pointer-events: none; }
.pill-visible { transform: translateY(0); opacity: 1; pointer-events: auto; }

.pill-main-link {
    display: flex;
    align-items: center;
    gap: 10px; 
    padding: 10px 12px 10px 22px; /* Balanced padding */
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 15px; /* Perfect readability */
}

.pill-icon {
    font-size: 18px; 
}

/* 3. CLOSE BUTTON (Comfortable Target) */
.pill-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 26px; /* Easy to click but not huge */
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 10px;
    transition: background 0.2s ease !important;
}

.pill-close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: none !important;
}

/* Professional Bobbing Animation */
.pill-visible:not(:hover) {
    animation: pill-bob 3.5s ease-in-out infinite;
}

@keyframes pill-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Mobile Tweak */
@media (max-width: 768px) {
    .portfolio-pill-container { bottom: 20px; right: 20px; }
    .pill-main-link { font-size: 14px; padding: 10px 10px 10px 18px; }
}


/* =========================================
   RESPONSIVE PREMIUM BANNER (Golden Ember)
   ========================================= */
.portfolio-banner-highlighted {
    position: relative;
    background: var(--bg-card);
    /* High-impact gradient border */
    border: 2px solid transparent !important;
    background-image: linear-gradient(var(--bg-card), var(--bg-card)), var(--portfolio-bg) !important;
    background-origin: border-box !important;
    background-clip: padding-box, border-box !important;

    /* DESKTOP DEFAULT: Much taller and wider padding */
    padding: 40px 50px !important; 
    overflow: hidden;
    box-shadow: 0 20px 50px var(--portfolio-glow) !important;
    border-radius: 16px; /* Larger corner radius for a premium feel */
}

/* Glassmorphism Background Glow */
.banner-glass-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255, 160, 0, 0.08) 0%, rgba(255, 111, 0, 0.03) 100%);
    pointer-events: none;
}

.banner-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px; /* More space between text and image on desktop */
    position: relative;
    z-index: 2;
}

.banner-text { flex: 1; }

.banner-tag {
    font-size: 12px;
    font-weight: 900;
    color: #ffa000;
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 15px;
}

.banner-text h2 {
    /* DESKTOP DEFAULT: Larger headline */
    font-size: 2.4rem; 
    margin: 0 0 15px 0;
    color: var(--text-main);
    line-height: 1.15;
    font-weight: 800;
}

.banner-text p {
    /* DESKTOP DEFAULT: Larger body text */
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0 0 30px 0;
    max-width: 550px;
    line-height: 1.6;
}

.banner-cta-row {
    display: flex;
    align-items: center;
    gap: 25px;
}

.cta-note {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.banner-btn-pronounced {
    padding: 14px 30px !important;
    font-size: 16px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
}

/* --- The Highlighted Mockup (Desktop) --- */
.banner-mockup {
    flex: 1.2; /* Give image more space */
    display: flex;
    justify-content: flex-end;
    perspective: 1500px; /* Deeper 3D perspective */
}

.mockup-frame-highlight {
    width: 100%;
    /* DESKTOP DEFAULT: Much larger image */
    max-width: 550px; 
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    transform: rotateY(-15deg) rotateX(5deg);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mockup-frame-highlight:hover {
    transform: rotateY(0deg) rotateX(0deg) scale(1.02);
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.6);
}

.mockup-frame-highlight img {
    width: 100%;
    display: block;
    border-radius: inherit;
}

/* =========================================
   MOBILE RESPONSIVE STYLES (Max-width: 992px)
   ========================================= */
@media (max-width: 992px) {
    .portfolio-banner-highlighted {
        /* MOBILE: Standard padding */
        padding: 30px 25px !important;
    }

    .banner-flex {
        flex-direction: column; /* Stack vertically */
        text-align: center;
        gap: 35px;
    }

    /* On mobile, move the image to the top */
    .banner-mockup { order: -1; justify-content: center; }
    
    /* MOBILE: Reset image size and remove 3D tilt */
    .mockup-frame-highlight { 
        transform: none; 
        max-width: 100%; 
        box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    }
    
    .banner-text h2 { font-size: 1.8rem; } /* Smaller headline for mobile */
    .banner-text p { font-size: 1rem; margin-bottom: 25px; }
    
    .banner-cta-row {
        flex-direction: column; /* Stack button and note */
        gap: 12px;
    }
}