/*
 * SolveIT Website Stylesheet
 * Integrates Light Mode (Executive Minimalist) and Dark Mode (SolveIT Signature) Design Systems
 */

/* ==========================================================================
   1. Theme Variables & Settings
   ========================================================================== */

:root {
    /* Fonts */
    --font-primary: 'Inter', sans-serif;

    /* Theme: Light Luxe (Minimal Light) */
    --color-background: #f8f9fa;
    --color-on-background: #0b0c10;
    --color-surface: #ffffff;
    --color-on-surface: #0b0c10;
    --color-on-surface-variant: #5c647a;
    --color-surface-dim: #e9ecef;
    --color-surface-bright: #ffffff;

    /* Containers */
    --color-surface-container-lowest: rgba(255, 255, 255, 0.85);
    --color-surface-container-low: rgba(241, 243, 245, 0.8);
    --color-surface-container: rgba(233, 236, 239, 0.75);
    --color-surface-container-high: rgba(222, 226, 230, 0.7);
    --color-surface-container-highest: rgba(206, 212, 218, 0.65);
    
    /* Branding */
    --color-primary: #c5a059; /* Muted Gold for Light Mode readability */
    --color-primary-rgb: 197, 160, 89;
    --color-on-primary: #ffffff;
    --color-primary-container: #d4af37;
    --color-on-primary-container: #0b0c10;
    --color-inverse-primary: #d4af37;

    --color-secondary: #5a6578;
    --color-on-secondary: #ffffff;
    --color-secondary-container: #e2e8f0;
    --color-on-secondary-container: #475569;

    --color-tertiary: #64748b;
    --color-on-tertiary: #ffffff;
    --color-tertiary-container: #f1f5f9;
    --color-on-tertiary-container: #334155;

    /* Borders & Outlines */
    --color-outline: #94a3b8;
    --color-outline-variant: #cbd5e1;
    --color-outline-variant-rgb: 203, 213, 225;
    --color-border-opacity: 0.12;

    /* Error States */
    --color-error: #ba1a1a;
    --color-on-error: #ffffff;
    --color-error-container: #ffdad6;
    --color-on-error-container: #93000a;

    /* Glass Effect Config */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(197, 160, 89, 0.15);
    --glass-glow: rgba(197, 160, 89, 0.3);
    --grid-glow-color: rgba(197, 160, 89, 0.25);
    --bg-mesh: radial-gradient(at 0% 0%, rgba(197, 160, 89, 0.07) 0px, transparent 50%), radial-gradient(at 100% 100%, rgba(197, 160, 89, 0.07) 0px, transparent 50%);
    --bg-image: url('../images/finance_tech_bg_light.png');
}

html.dark {
    /* Theme: Minimal Luxury & Tech (Dark Mode) */
    --color-background: #0b0c10; /* Very deep charcoal/navy-black */
    --color-on-background: #ffffff;
    --color-surface: #0b0c10;
    --color-on-surface: #ffffff;
    --color-on-surface-variant: #a9a9a9; /* Soft grey secondary text */
    --color-surface-dim: #0b0c10;
    --color-surface-bright: #141519;
    --bg-image: url('../images/finance_tech_bg_dark.png');

    /* Containers */
    --color-surface-container-lowest: #050507;
    --color-surface-container-low: #141519; /* Lighter dark card backgrounds */
    --color-surface-container: #1e1e24;
    --color-surface-container-high: #272830;
    --color-surface-container-highest: #31323c;
    
    /* Branding */
    --color-primary: #d4af37; /* Metallic Gold */
    --color-primary-rgb: 212, 175, 55;
    --color-on-primary: #000000; /* Black text on gold buttons */
    --color-primary-container: #c5a059;
    --color-on-primary-container: #1a1200;
    --color-inverse-primary: #c5a059;

    --color-secondary: #a9a9a9;
    --color-on-secondary: #000000;
    --color-secondary-container: #2c2d33;
    --color-on-secondary-container: #d4af37;

    --color-tertiary: #a9a9a9;
    --color-on-tertiary: #000000;
    --color-tertiary-container: #222329;
    --color-on-tertiary-container: #ffffff;

    /* Borders & Outlines */
    --color-outline: #4a4d56;
    --color-outline-variant: #2d3038;
    --color-outline-variant-rgb: 45, 48, 56;
    --color-border-opacity: 0.1; /* 10% opacity white-ish border overlay */

    /* Error States */
    --color-error: #ffb4ab;
    --color-on-error: #690005;
    --color-error-container: #93000a;
    --color-on-error-container: #ffdad6;

    /* Glass Effect Config */
    --glass-bg: rgba(20, 21, 25, 0.7); /* Lighter dark for cards (#141519) */
    --glass-border: rgba(255, 255, 255, 0.1); /* 1px border in white at 10% opacity */
    --glass-glow: rgba(212, 175, 55, 0.08); /* Subtle gold glow shadow */
    --grid-glow-color: rgba(212, 175, 55, 0.12);
    --bg-mesh: none;
}

/* ==========================================================================
   2. Base Elements Styles
   ========================================================================== */

* {
    box-sizing: border-box;
}

body {
    background-color: var(--color-background);
    background-image: var(--bg-image), var(--bg-mesh);
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--color-on-surface);
    font-family: var(--font-primary);
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

::selection {
    background-color: var(--color-primary-container);
    color: var(--color-on-primary-container);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-surface-container-low);
}

::-webkit-scrollbar-thumb {
    background: var(--color-outline-variant);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* ==========================================================================
   3. Animations & Reveals
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal-active {
    animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal-initial {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* ==========================================================================
   4. Glassmorphism & UI Accents
   ========================================================================== */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 0.25rem; /* 4px corner radius matching design specs */
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 16px 36px -12px var(--glass-glow);
    /* translateY is handled by JS for cards with parallax images.
       For static cards (no .parallax-img child), CSS handles lift. */
}

.glass-card:not(:has(.parallax-img)):hover {
    transform: translateY(-4px);
}

/* Interactive Cursor Radial Hover Glow for Glass Cards */
.glass-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        350px circle at var(--mouse-x, -999px) var(--mouse-y, -999px),
        var(--glass-glow),
        transparent 80%
    );
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.4s ease;
    opacity: 0;
}

.glass-card:hover::before {
    opacity: 1;
}

/* Ensure card content sits above the glow pseudo-element */
.glass-card > * {
    position: relative;
    z-index: 2;
}

/* Custom Bento Grid Background drift effect */
.parallax-img-wrap {
    overflow: hidden;
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.parallax-img {
    transition: transform 0.2s cubic-bezier(0.25, 0.61, 0.35, 1);
    will-change: transform;
}

/* Obsidian Card Layout */
.obsidian-card {
    background: var(--color-surface-container-lowest);
    border: 1px solid var(--color-outline-variant);
    border-radius: 0.25rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.obsidian-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 12px 28px -8px var(--glass-glow);
    transform: translateY(-2px);
}

/* Button transitions & Custom CTAs */
button, a {
    border-radius: 0.25rem; /* Soft corner radius */
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-on-primary) !important;
    border: 1px solid var(--color-primary);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 600;
}

.btn-primary:hover {
    background-color: transparent !important;
    color: var(--color-primary) !important;
    box-shadow: 0 0 24px var(--glass-glow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-on-surface) !important;
    border: 1px solid var(--color-outline);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary:hover {
    background-color: var(--color-on-surface) !important;
    color: var(--color-background) !important;
    border-color: var(--color-on-surface);
}

/* Hero section — transparent so fixed bg image shows through */
.interactive-hero {
    background: transparent !important;
}

/* Background Grids & Interaction */
.tech-grid {
    background-size: 50px 50px;
    background-image: 
        radial-gradient(circle, rgba(var(--color-primary-rgb), 0.08) 1px, transparent 1px);
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.grid-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        500px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        var(--grid-glow-color),
        transparent 85%
    );
    pointer-events: none;
    z-index: 1;
    transition: background 0.1s ease;
}

/* ==========================================================================
   5. Parallax Section & Visual Accents
   ========================================================================== */

.parallax-bg-section {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: -30%;
    left: 0;
    width: 100%;
    height: 160%;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    will-change: transform;
    z-index: 0;
    pointer-events: none;
}

.parallax-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 1;
    pointer-events: none;
}

/* Material Icons Custom settings */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* Dynamic Charts bars animations */
.chart-bar {
    transition: height 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dropdown transition dynamics — controlled by JS .dropdown-open class */
.dropdown-menu,
.accounting-dropdown {
    transform: translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* JS toggles this class; keeps dropdown open when cursor moves into the panel */
.lang-dropdown-wrapper.dropdown-open .dropdown-menu,
.accounting-dropdown-wrapper.dropdown-open .accounting-dropdown {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   6. Navigation Highlights & Responsive Customizations
   ========================================================================== */

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-link.active::after,
.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--color-primary);
}

/* Mobile Menu overlays */
.mobile-menu-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-content {
    transform: translateY(-20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu-overlay.open .mobile-menu-content {
    transform: translateY(0);
}
