/* 
   Smart Finance & Wealth Calculator - Global Style System
   Design: Modern glassmorphism, tailored HSL color system, dark theme support.
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Light Mode Default */
    --hue: 230;
    --primary: hsl(var(--hue), 85%, 60%);
    --primary-hover: hsl(var(--hue), 85%, 50%);
    --secondary: hsl(190, 90%, 45%);
    --secondary-hover: hsl(190, 90%, 38%);
    
    --bg-main: hsl(220, 30%, 98%);
    --bg-card: hsl(0, 0%, 100%);
    --bg-nav: rgba(255, 255, 255, 0.8);
    
    --text-main: hsl(222, 47%, 15%);
    --text-muted: hsl(220, 15%, 45%);
    --text-on-primary: hsl(0, 0%, 100%);
    
    --border: hsl(220, 15%, 90%);
    --border-focus: hsl(var(--hue), 85%, 75%);
    
    --success: hsl(142, 70%, 45%);
    --warning: hsl(38, 92%, 50%);
    --danger: hsl(350, 80%, 55%);
    
    /* Shadows & Border Radius */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    /* Font Families */
    --font-heading: 'Outfit', 'Inter', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    
    /* Layout Dimensions */
    --nav-height: 70px;
    --container-max: 1200px;
}

[data-theme="dark"] {
    /* Color Palette - Dark Mode overrides */
    --bg-main: hsl(222, 47%, 11%);
    --bg-card: hsl(223, 47%, 16%);
    --bg-nav: rgba(15, 23, 42, 0.8);
    
    --text-main: hsl(210, 40%, 98%);
    --text-muted: hsl(215, 20%, 65%);
    
    --border: hsl(223, 30%, 22%);
    --border-focus: hsl(var(--hue), 80%, 50%);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
    
    --success: hsl(142, 75%, 55%);
    --warning: hsl(38, 95%, 55%);
    --danger: hsl(350, 85%, 60%);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* Header & Glassmorphic Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.logo-link span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

/* Action Buttons & Utilities */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

.theme-toggle-btn .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle-btn .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle-btn .sun-icon {
    display: block;
}

/* Mobile Toggle Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero Section Style */
.hero {
    padding-top: calc(var(--nav-height) + 60px);
    padding-bottom: 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 30px;
    background-color: rgba(var(--hue), 85%, 60%, 0.1);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid rgba(var(--hue), 85%, 60%, 0.15);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Premium Card Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-bottom: 80px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--hue), 85%, 60%, 0.3);
}

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

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(var(--hue), 85%, 60%, 0.1), rgba(190, 90, 45, 0.1));
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    flex-grow: 1;
}

.card-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

.card-btn svg {
    transition: transform 0.2s ease;
}

.card:hover .card-btn svg {
    transform: translateX(4px);
}

/* Footer Style */
.footer {
    border-top: 1px solid var(--border);
    background-color: var(--bg-card);
    padding: 60px 0 30px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 320px;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 16px;
}

.footer-logo span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 80px;
}

.footer-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-main);
}

.footer-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-link {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-link:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive CSS */
@media (max-width: 900px) {
    html {
        font-size: 15px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .footer-links {
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background-color: var(--bg-card);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 40px;
        gap: 24px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-top: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-links {
        justify-content: space-between;
        width: 100%;
    }
}

/* --- Large Hub 16-Calculator Additions --- */
/* Category Badges */
.card-badge {
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: -0.2px;
}
.badge-wealth {
    background-color: rgba(230, 85%, 60%, 0.1);
    color: var(--primary);
    border: 1px solid rgba(230, 85%, 60%, 0.2);
}
.badge-loan {
    background-color: rgba(350, 80%, 55%, 0.1);
    color: var(--danger);
    border: 1px solid rgba(350, 80%, 55%, 0.2);
}
.badge-stock {
    background-color: rgba(190, 90, 45, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(190, 90, 45, 0.2);
}
.badge-tax {
    background-color: rgba(142, 70, 45, 0.1);
    color: var(--success);
    border: 1px solid rgba(142, 70, 45, 0.2);
}

/* Search Bar Container */
.search-section {
    max-width: 600px;
    margin: 0 auto 50px;
    padding: 0 24px;
    text-align: center;
}
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.search-input {
    width: 100%;
    padding: 16px 20px 16px 48px;
    font-size: 1.1rem;
    border: 2px solid var(--border);
    border-radius: 40px;
    background-color: var(--bg-card);
    color: var(--text-main);
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(230, 85%, 60%, 0.25);
    transform: scale(1.02);
}
.search-icon {
    position: absolute;
    left: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

/* --- Dropdown Navigation Menu --- */
.nav-item-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 0;
    min-width: 200px;
    box-shadow: var(--shadow-md);
    display: none;
    list-style: none;
    z-index: 1010;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item-dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    padding: 10px 20px;
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: background-color 0.2s ease, color 0.2s ease;
    text-align: left;
}

.dropdown-item:hover {
    background-color: rgba(230, 85, 60, 0.05);
    color: var(--primary);
}

@media (max-width: 768px) {
    .nav-menu {
        overflow-y: auto; /* Allow scrolling inside mobile nav drawer */
        padding-bottom: 60px;
    }
    
    .nav-item-dropdown {
        width: 100%;
        text-align: center;
    }
    
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        background-color: transparent;
        display: block;
        opacity: 1;
        padding: 5px 0 15px;
        min-width: 100%;
    }
    
    .dropdown-item {
        padding: 6px 12px;
        font-size: 0.85rem;
        text-align: center;
        color: var(--text-muted);
    }
}


