/* ========================================
   Modern Finance Dashboard 2025
   Bootstrap 5 + Glass Morphism Design
   ======================================== */

:root {
    /* Primary Colors - Modern Blue Gradient */
    --primary: #0066ff;
    --primary-dark: #0052cc;
    --primary-light: #3385ff;
    
    /* Accent Colors */
    --gold: #fbbf24;
    --gold-dark: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
}

/* Dark Theme (Default) */
[data-theme="dark"] {
    --bg-primary: #0a0e27;
    --bg-secondary: #131829;
    --bg-tertiary: #1a1f3a;
    
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.3);
    --glass-hover-bg: rgba(255, 255, 255, 0.08);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    
    /* Nav */
    --nav-bg: rgba(10, 14, 39, 0.8);
    
    /* Chart Colors */
    --chart-grid: rgba(0, 0, 0, 0.05);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.15);
    --glass-shadow: rgba(0, 0, 0, 0.15);
    --glass-hover-bg: rgba(255, 255, 255, 0.95);
    
    /* Text Colors */
    --text-primary: #1a202c;
    --text-secondary: #2d3748;
    --text-muted: #4a5568;
    
    /* Nav */
    --nav-bg: rgba(255, 255, 255, 0.95);
    
    /* Chart Colors */
    --chart-grid: rgba(0, 0, 0, 0.1);
}

/* Default to dark theme */
html {
    color-scheme: dark;
}

html[data-theme="light"] {
    color-scheme: light;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    max-width: 100vw;
    width: 100%;
}

/* ========================================
   Animated Background
   ======================================== */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    z-index: -1;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #0066ff, #00d4ff);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    bottom: -100px;
    right: -100px;
    animation-delay: 7s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* ========================================
   Navigation
   ======================================== */
.glass-nav {
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px var(--glass-shadow);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav {
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav .nav-item {
    display: flex;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem !important;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-link:hover {
    color: var(--primary-light) !important;
}

.nav-link.active {
    color: var(--primary) !important;
    font-weight: 600;
}

.nav-link i {
    font-size: 1rem;
    line-height: 1;
}

/* Navbar Buttons */
.navbar-nav .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar-nav .btn-outline-warning {
    border: 2px solid var(--gold);
    color: var(--gold);
    background: transparent;
}

.navbar-nav .btn-outline-warning:hover {
    background: var(--gold);
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.navbar-nav .btn i {
    font-size: 1rem;
    line-height: 1;
}

/* User Dropdown Menu */
.navbar-nav .dropdown-menu {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 8px 32px var(--glass-shadow);
    min-width: 250px;
}

.navbar-nav .dropdown-item {
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav .dropdown-item:hover {
    background: var(--glass-hover-bg);
    color: var(--text-primary);
}

.navbar-nav .dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.navbar-nav .dropdown-header {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.navbar-nav .dropdown-divider {
    border-color: var(--glass-border);
    margin: 0.5rem 0;
}

.navbar-nav .dropdown-item-text {
    padding: 0.75rem 1rem;
}

/* Theme Toggle Button */
.btn-theme-toggle {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.btn-theme-toggle i {
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: absolute;
}

[data-theme="dark"] .theme-icon-light {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .theme-icon-dark {
    opacity: 0;
    transform: rotate(180deg) scale(0);
}

[data-theme="light"] .theme-icon-light {
    opacity: 0;
    transform: rotate(-180deg) scale(0);
}

[data-theme="light"] .theme-icon-dark {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* ========================================
   Glass Card Effect
   ======================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px var(--glass-shadow);
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--glass-shadow);
    border-color: var(--glass-border);
}

/* ========================================
   Hero Section
   ======================================== */
.hero-badge .badge {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 50px;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
}

.gradient-text {
    background: linear-gradient(135deg, #ffffff, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(20deg);
    }
}

/* ========================================
   Category Pills
   ======================================== */
.category-pills {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.category-pill {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.category-pill:hover {
    border-color: var(--primary);
    background: rgba(0, 102, 255, 0.1);
    color: var(--primary-light);
    transform: translateY(-2px);
}

.category-pill.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.4);
}

/* ========================================
   Stock Grid
   ======================================== */
.stock-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
}

.stock-grid-modern::-webkit-scrollbar {
    width: 8px;
}

.stock-grid-modern::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.stock-grid-modern::-webkit-scrollbar-thumb {
    background: rgba(0, 102, 255, 0.5);
    border-radius: 10px;
}

.stock-grid-modern::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 102, 255, 0.7);
}

.stock-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.75rem 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stock-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 102, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.stock-card:hover::before {
    left: 100%;
}

.stock-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 102, 255, 0.3);
    background: rgba(0, 102, 255, 0.1);
}

.stock-card.selected {
    border-color: var(--primary);
    background: rgba(0, 102, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.4);
}

.stock-card .stock-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    line-height: 1;
}

.stock-card .stock-ticker {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    letter-spacing: 0.5px;
}

.stock-card .stock-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
    font-weight: 500;
}

/* ========================================
   Form Controls
   ======================================== */
.glass-input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 2px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
    transition: all 0.3s ease !important;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1) !important;
    color: var(--text-primary) !important;
}

.glass-input::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* ========================================
   Buttons
   ======================================== */
.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    border: none !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.3) !important;
}

.btn-gradient:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 30px rgba(0, 102, 255, 0.5) !important;
}

.btn-gradient:active {
    transform: translateY(0) !important;
}

/* ========================================
   Utility Classes
   ======================================== */
.hidden {
    display: none !important;
}

/* ========================================
   Metric Cards
   ======================================== */
.metric-card {
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.5s ease;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.asset-card {
    border-left: 4px solid var(--primary);
}

.gold-card {
    border-left: 4px solid var(--gold);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.metric-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* ========================================
   Charts
   ======================================== */
canvas {
    max-height: 400px;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 12px;
}

@media (max-width: 768px) {
    canvas {
        max-height: 500px;
        min-height: 350px;
    }
}

@media (max-width: 576px) {
    canvas {
        max-height: 450px;
        min-height: 320px;
    }
}

/* ========================================
   Responsive Design
   ======================================== */

/* Prevent all containers and rows from causing overflow */
.container,
.container-fluid,
.row {
    max-width: 100%;
    overflow-x: hidden;
}

/* Ensure all main sections respect viewport boundaries */
section,
main,
.content-section {
    max-width: 100vw;
    overflow-x: hidden;
}

@media (max-width: 992px) {
    .gradient-text {
        font-size: 2.5rem;
    }
    
    .stock-grid-modern {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Prevent horizontal overflow on all elements */
    * {
        max-width: 100%;
    }
    
    /* Allow specific elements to be 100% width */
    html,
    body,
    .container-fluid,
    .row,
    section,
    .content-section,
    .animated-bg {
        max-width: 100vw !important;
    }
    
    /* Reduce padding on containers to prevent overflow */
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .hero-badge .badge {
        font-size: 0.8rem;
        padding: 0.5rem 1rem !important;
    }
    
    .gradient-text {
        font-size: 2rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .category-pills {
        gap: 0.5rem;
    }
    
    .category-pill {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .stock-grid-modern {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }
    
    .stock-card {
        padding: 1.25rem 1rem;
        min-height: 120px;
    }
    
    .stock-card .stock-icon {
        font-size: 2.5rem;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .glass-nav {
        padding: 0.5rem 0;
    }
    
    /* Mobile navbar adjustments */
    .navbar-collapse {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .navbar-nav {
        gap: 0;
        padding-top: 1rem;
        width: 100%;
    }
    
    .navbar-nav .nav-item {
        width: 100%;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        width: 100%;
    }
    
    .navbar-nav .btn {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .btn-theme-toggle {
        margin-top: 0.5rem;
        width: auto;
        margin-left: auto;
        margin-right: auto;
    }
    
    .navbar-nav .dropdown-menu {
        position: static !important;
        transform: none !important;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .quick-action-card {
        padding: 1.5rem;
        min-height: 140px;
    }
    
    .quick-action-icon {
        font-size: 3rem;
    }
    
    /* Ensure all cards and content respect boundaries */
    .glass-card {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Ensure orbs stay within viewport on mobile */
    .gradient-orb {
        max-width: 300px;
        max-height: 300px;
    }
    
    .orb-1,
    .orb-2,
    .orb-3 {
        width: 300px !important;
        height: 300px !important;
    }
}

@media (max-width: 576px) {
    /* Extra mobile constraints */
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .gradient-text {
        font-size: 1.75rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .lead {
        font-size: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .category-pill {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .metric-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    /* Additional mobile navbar constraints for smaller devices */
    .glass-nav .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .navbar-collapse {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .stock-grid-modern {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .stock-card {
        padding: 1rem 0.75rem;
        min-height: 110px;
    }
    
    .stock-card .stock-icon {
        font-size: 2.25rem;
    }
    
    /* Make orbs even smaller on very small screens */
    .gradient-orb {
        max-width: 250px;
        max-height: 250px;
    }
    
    .orb-1,
    .orb-2,
    .orb-3 {
        width: 250px !important;
        height: 250px !important;
    }
    
    /* Ensure all text elements wrap properly */
    h1, h2, h3, h4, h5, h6, p, span, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* ========================================
   Content Sections
   ======================================== */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

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

/* Light Theme Adjustments */
[data-theme="light"] .animated-bg .gradient-orb {
    opacity: 0.1;
}

[data-theme="light"] .gradient-text {
    background: linear-gradient(135deg, #1a202c, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .navbar-brand {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .lead {
    color: var(--text-secondary) !important;
}

[data-theme="light"] .text-light {
    color: var(--text-secondary) !important;
}

[data-theme="light"] .stat-label {
    color: var(--text-muted) !important;
}

[data-theme="light"] .stat-value {
    color: var(--text-primary) !important;
}

[data-theme="light"] .stock-card .stock-ticker {
    color: var(--text-primary) !important;
}

[data-theme="light"] .stock-card .stock-name {
    color: var(--text-secondary) !important;
}

[data-theme="light"] .category-pill {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .category-pill:hover {
    color: var(--primary);
    background: rgba(0, 102, 255, 0.1);
}

[data-theme="light"] .category-pill.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white !important;
    border-color: var(--primary);
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .form-label {
    color: var(--text-primary) !important;
}

[data-theme="light"] small {
    color: var(--text-secondary) !important;
}

[data-theme="light"] .gradient-text-gold {
    background: linear-gradient(135deg, #d97706, #b45309, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] h1, 
[data-theme="light"] h2, 
[data-theme="light"] h3, 
[data-theme="light"] h4, 
[data-theme="light"] h5, 
[data-theme="light"] h6 {
    color: var(--text-primary) !important;
}

[data-theme="light"] p {
    color: var(--text-secondary);
}

[data-theme="light"] .text-warning {
    color: #d97706 !important;
}

[data-theme="light"] strong {
    color: var(--text-primary);
}

[data-theme="light"] .bg-gradient-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #000 !important;
}

[data-theme="light"] .badge {
    color: #000;
}

[data-theme="light"] .hero-badge .badge {
    color: #000 !important;
}

[data-theme="light"] .btn-gradient-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #000 !important;
}

[data-theme="light"] .glass-input {
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: var(--text-primary) !important;
}

[data-theme="light"] .glass-input:focus {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: var(--primary) !important;
}

[data-theme="light"] .glass-input::placeholder {
    color: var(--text-muted) !important;
}

[data-theme="light"] .metric-value {
    color: var(--text-primary) !important;
}

[data-theme="light"] .metric-label {
    color: var(--text-muted) !important;
}

[data-theme="light"] .insight-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .insight-title {
    color: var(--text-primary) !important;
}

[data-theme="light"] .insight-body {
    color: var(--text-secondary) !important;
}

[data-theme="light"] .navbar-nav .dropdown-menu {
    background: var(--bg-secondary);
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .navbar-nav .dropdown-item {
    color: var(--text-secondary);
}

[data-theme="light"] .navbar-nav .dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* ========================================
   Tooltip System
   ======================================== */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 102, 255, 0.2);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: help;
    margin-left: 0.35rem;
    transition: all 0.3s ease;
    border: 1.5px solid var(--primary);
    vertical-align: middle;
    flex-shrink: 0;
}

.info-icon:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.4);
}

.info-icon.large {
    width: 22px;
    height: 22px;
    font-size: 0.85rem;
}

.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.custom-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: normal;
    min-width: 200px;
    max-width: 320px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
    pointer-events: none;
}

@media (max-width: 768px) {
    .custom-tooltip {
        max-width: 90vw;
        left: auto;
        right: 0;
        transform: translateY(-5px);
    }
}

.custom-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--bg-secondary);
}

.custom-tooltip::after {
    content: '';
    position: absolute;
    top: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--bg-secondary);
}

.tooltip-wrapper:hover .custom-tooltip,
.info-icon:hover + .custom-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.custom-tooltip strong {
    color: var(--primary);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.custom-tooltip ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
}

.custom-tooltip li {
    margin-bottom: 0.25rem;
}

/* Tooltip positioning variants */
.custom-tooltip.tooltip-right {
    left: calc(100% + 10px);
    bottom: auto;
    top: 50%;
    transform: translateY(-50%) translateX(-5px);
}

.custom-tooltip.tooltip-right::before {
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-right-color: var(--bg-secondary);
}

.custom-tooltip.tooltip-right::after {
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-right-color: var(--bg-secondary);
}

.tooltip-wrapper:hover .custom-tooltip.tooltip-right {
    transform: translateY(-50%) translateX(0);
}

/* Help section styling */
.help-section {
    background: rgba(0, 102, 255, 0.05);
    border-left: 4px solid var(--primary);
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--primary);
}

.help-section .help-title {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-section .help-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    font-weight: 500;
}

/* ========================================
   Insight Cards
   ======================================== */
.insights-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.insight-card {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.1), rgba(0, 212, 255, 0.05));
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInUp 0.6s ease backwards;
}

.insight-card:nth-child(1) { animation-delay: 0.1s; }
.insight-card:nth-child(2) { animation-delay: 0.2s; }
.insight-card:nth-child(3) { animation-delay: 0.3s; }
.insight-card:nth-child(4) { animation-delay: 0.4s; }

.insight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.insight-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(0, 102, 255, 0.3);
}

.insight-card:hover::before {
    left: 100%;
}

.insight-card.highlight {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.1));
    border-color: var(--warning);
}

.insight-card.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
    border-color: var(--success);
}

.insight-card.info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(0, 102, 255, 0.1));
    border-color: var(--info);
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.insight-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.insight-card.highlight .insight-icon {
    background: linear-gradient(135deg, var(--warning), var(--danger));
    color: white;
}

.insight-card.success .insight-icon {
    background: linear-gradient(135deg, var(--success), var(--info));
    color: white;
}

.insight-card.info .insight-icon {
    background: linear-gradient(135deg, var(--info), var(--primary));
    color: white;
}

.insight-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.insight-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.insight-highlight {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1em;
}

.insight-card.highlight .insight-highlight {
    color: var(--warning);
}

.insight-card.success .insight-highlight {
    color: var(--success);
}

.insight-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
}

.insight-footer i {
    font-size: 1rem;
}

/* Pulse animation for important insights */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 102, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 102, 255, 0);
    }
}

.insight-card.pulse {
    animation: pulse 2s infinite, slideInUp 0.6s ease backwards;
}

/* ========================================
   Call to Action Elements
   ======================================== */
.cta-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0;
}

.cta-button {
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.cta-button i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.cta-button:hover i {
    transform: translateX(3px);
}

.cta-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.3);
}

.cta-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 102, 255, 0.5);
    color: white;
}

.cta-secondary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.cta-secondary:hover {
    background: rgba(0, 102, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.2);
}

.cta-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.cta-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
    color: white;
}

.cta-warning {
    background: linear-gradient(135deg, var(--warning), var(--gold-dark));
    color: white;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.cta-warning:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.5);
    color: white;
}

/* Quick Action Cards */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin: 2rem 0;
}

.quick-action-card {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.quick-action-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 102, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-action-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(0, 102, 255, 0.3);
}

.quick-action-card:hover::before {
    opacity: 1;
}

.quick-action-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
    line-height: 1;
}

.quick-action-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.3px;
}

.quick-action-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    font-weight: 500;
}

/* Prompt Banner */
.prompt-banner {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.1), rgba(0, 212, 255, 0.05));
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    animation: slideInUp 0.6s ease;
}

.prompt-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.prompt-content {
    flex-grow: 1;
}

.prompt-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.prompt-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.prompt-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    box-shadow: 0 8px 30px rgba(0, 102, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    z-index: 999;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 40px rgba(0, 102, 255, 0.6);
}

.fab.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Responsive CTAs */
@media (max-width: 768px) {
    .cta-container {
        flex-direction: column;
        max-width: 100%;
    }
    
    .cta-button {
        width: 100%;
        max-width: 100%;
        justify-content: center;
        word-wrap: break-word;
    }
    
    .prompt-banner {
        flex-direction: column;
        text-align: center;
        max-width: 100%;
    }
    
    .prompt-actions {
        width: 100%;
        max-width: 100%;
        flex-direction: column;
    }
    
    .fab {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}

/* ========================================
   Spring Software Branding
   ======================================== */
.branding-section {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.05), rgba(16, 185, 129, 0.05));
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.branding-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: var(--glass-bg);
    border: 2px solid var(--primary);
    border-radius: 50px;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.branding-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 102, 255, 0.3);
}

.branding-icon {
    font-size: 1.5rem;
}

.branding-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin: 0;
}

.branding-company {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.service-cta-box {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.1), rgba(16, 185, 129, 0.1));
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.service-cta-box::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 102, 255, 0.1) 0%, transparent 70%);
    animation: float 20s infinite ease-in-out;
}

.service-cta-content {
    position: relative;
    z-index: 1;
}

.service-cta-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.service-cta-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.service-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    text-align: left;
}

.service-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.service-feature:hover {
    background: rgba(0, 102, 255, 0.1);
    transform: translateX(5px);
}

.service-feature i {
    font-size: 1.5rem;
    color: var(--primary);
}

.service-feature-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.powered-by-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    margin-top: 1.5rem;
}

.powered-by-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.powered-by-footer a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.spring-logo {
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

@media (max-width: 768px) {
    .service-cta-title {
        font-size: 1.5rem;
    }
    
    .service-features {
        grid-template-columns: 1fr;
    }
    
    .branding-section {
        padding: 1.5rem;
    }
}

/* ========================================
   Gold-Themed Sales Design
   ======================================== */

/* Gold gradient text */
.gradient-text-gold {
    background: linear-gradient(135deg, #FFD700, #FFA500, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldShimmer 3s ease infinite;
}

@keyframes goldShimmer {
    0%, 100% {
        filter: hue-rotate(0deg) brightness(1);
    }
    50% {
        filter: hue-rotate(10deg) brightness(1.2);
    }
}

/* Gold gradient button */
.btn-gradient-gold {
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
    border: none !important;
    color: #000 !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4) !important;
}

.btn-gradient-gold:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6) !important;
    background: linear-gradient(135deg, #FFA500, #FFD700) !important;
}

.bg-gradient-gold {
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
}

/* Gold icon styling */
.gold-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

/* Hero stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 1rem;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 700;
}

/* Leverage Card */
.leverage-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
    border: 3px solid rgba(255, 215, 0, 0.3) !important;
    position: relative;
    overflow: hidden;
}

.leverage-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    animation: float 15s infinite ease-in-out;
}

.leverage-badge {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.leverage-display {
    margin: 2rem 0;
}

.leverage-multiplier {
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    display: inline-block;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }
}

.leverage-explanation {
    position: relative;
    z-index: 1;
}

.leverage-stat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.leverage-stat:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateY(-3px);
}

.leverage-stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.leverage-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.leverage-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-warning);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-stats {
        gap: 1.5rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .leverage-multiplier {
        font-size: 3.5rem;
    }
    
    .leverage-stat {
        padding: 1rem 0.75rem;
    }
    
    /* Make leverage stats 2 columns on mobile */
    .leverage-explanation .row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .leverage-explanation .col-md-4 {
        width: 100%;
    }
    
    /* Stack third item below spanning both columns */
    .leverage-explanation .col-md-4:nth-child(3) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 576px) {
    .gradient-text-gold {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .leverage-multiplier {
        font-size: 3rem;
    }
    
    /* Keep 2 columns layout on small mobile */
    .leverage-explanation .row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .leverage-stat {
        padding: 0.875rem 0.5rem;
    }
    
    .leverage-stat-icon {
        font-size: 1.75rem;
    }
    
    .leverage-stat-label {
        font-size: 0.75rem;
    }
    
    .leverage-stat-value {
        font-size: 1.25rem;
    }
}

/* ========================================
   Email Capture Popup
   ======================================== */
.email-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    overflow-x: hidden;
}

.email-popup-overlay.hidden {
    display: none;
}

.email-popup-container {
    position: relative;
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.95), rgba(26, 31, 58, 0.95));
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    max-width: 500px;
    width: 90%;
    max-width: calc(100vw - 2rem);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
}

[data-theme="light"] .email-popup-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    border-color: rgba(251, 191, 36, 0.4);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.email-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.email-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.email-popup-content {
    text-align: center;
}

.email-popup-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.email-popup-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.email-popup-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.email-capture-form {
    margin-bottom: 0;
}

.email-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.email-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

[data-theme="light"] .email-input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

.email-input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.1);
}

.email-input::placeholder {
    color: var(--text-muted);
}

.email-submit-btn {
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: none;
    border-radius: 12px;
    color: #000;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.email-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.4);
}

.email-submit-btn:active {
    transform: translateY(0);
}

.submit-loading {
    display: inline-block;
}

.email-privacy-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.email-success-message {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    color: var(--success);
    animation: slideUp 0.3s ease;
}

.email-success-message i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.email-success-message p {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 576px) {
    .email-popup-container {
        padding: 2rem 1.5rem;
        width: 95%;
        max-width: calc(100vw - 1rem);
    }
    
    .email-popup-title {
        font-size: 1.5rem;
        word-wrap: break-word;
    }
    
    .email-input-group {
        flex-direction: column;
        max-width: 100%;
    }
    
    .email-submit-btn {
        width: 100%;
        max-width: 100%;
    }
    
    .email-input {
        width: 100%;
        max-width: 100%;
    }
}

/* ========================================
   Social Share Buttons
   ======================================== */

.social-share-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.social-share-btn i {
    font-size: 1.25rem;
}

.social-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.social-share-btn:active {
    transform: translateY(0);
}

/* Twitter Button */
.social-share-btn.twitter {
    background: linear-gradient(135deg, #1DA1F2, #0d8bd9);
}

.social-share-btn.twitter:hover {
    box-shadow: 0 8px 20px rgba(29, 161, 242, 0.4);
}

/* LinkedIn Button */
.social-share-btn.linkedin {
    background: linear-gradient(135deg, #0077B5, #005885);
}

.social-share-btn.linkedin:hover {
    box-shadow: 0 8px 20px rgba(0, 119, 181, 0.4);
}

/* Facebook Button */
.social-share-btn.facebook {
    background: linear-gradient(135deg, #1877F2, #0d5dbf);
}

.social-share-btn.facebook:hover {
    box-shadow: 0 8px 20px rgba(24, 119, 242, 0.4);
}

/* Link Copy Button */
.social-share-btn.link {
    background: linear-gradient(135deg, #718096, #4a5568);
}

.social-share-btn.link:hover {
    box-shadow: 0 8px 20px rgba(113, 128, 150, 0.4);
}

/* Light theme adjustments */
[data-theme="light"] .social-share-btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .social-share-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .social-share-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .social-share-btn span {
        font-size: 0.9rem;
    }
    
    .social-share-btn {
        padding: 0.75rem 1.25rem;
    }
}

/* ========================================
   Email Subscription CTA Styles
   ======================================== */
.email-cta-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.email-cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.email-cta-icon {
    font-size: 3rem;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.email-cta-benefits {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.benefit-item i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.email-cta-form-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.email-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.email-cta-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.email-cta-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--glass-hover-bg);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.email-cta-input::placeholder {
    color: var(--text-muted);
}

.email-cta-submit {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.email-cta-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.email-cta-submit:hover::before {
    left: 100%;
}

.email-cta-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.email-cta-submit:active {
    transform: translateY(0);
}

.email-cta-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.email-cta-privacy {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
}

.email-cta-success {
    text-align: center;
    padding: 2rem;
}

.email-cta-success i {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.email-cta-success p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Responsive Email CTA */
@media (max-width: 991px) {
    .email-cta-card {
        padding: 2rem;
        max-width: 100%;
    }
    
    .email-input-wrapper {
        flex-direction: column;
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .email-cta-card {
        padding: 1.5rem;
        max-width: 100%;
    }
    
    .email-cta-icon {
        font-size: 2.5rem;
    }
    
    .email-cta-form-container {
        padding: 1.5rem;
        max-width: 100%;
    }
    
    .email-cta-input,
    .email-cta-submit {
        width: 100%;
        max-width: 100%;
    }
}

/* ========================================
   Professional Footer Styles
   ======================================== */
.site-footer {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    position: relative;
    z-index: 10;
}

.footer-brand {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(5px);
}

.footer-links a i {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Legal Content Styles */
.legal-content {
    line-height: 1.8;
}

.legal-content h2 {
    color: var(--text-primary);
    margin-top: 2rem;
}

.legal-content h3 {
    color: var(--text-primary);
    margin-top: 1.5rem;
}

.legal-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.legal-content ul {
    color: var(--text-secondary);
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal-content ul li {
    margin-bottom: 0.5rem;
}

.legal-content a {
    color: var(--primary);
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-content .alert {
    border-radius: 12px;
    padding: 1.25rem;
}

/* Responsive Footer */
@media (max-width: 991px) {
    .site-footer .col-lg-4,
    .site-footer .col-lg-2,
    .site-footer .col-lg-3 {
        margin-bottom: 2rem;
    }
    
    .site-footer {
        max-width: 100vw;
        overflow-x: hidden;
    }
}

@media (max-width: 767px) {
    .footer-brand {
        font-size: 1.25rem;
        justify-content: center;
        text-align: center;
    }
    
    .site-footer .text-md-start,
    .site-footer .text-md-end {
        text-align: center !important;
    }
    
    .footer-links {
        text-align: center;
    }
    
    .footer-links a {
        justify-content: center;
        word-wrap: break-word;
    }
    
    .site-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ========================================
   Universal Mobile Overflow Prevention
   ======================================== */
@media (max-width: 768px) {
    /* Ensure images don't overflow */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Ensure all buttons and inputs respect boundaries */
    button,
    input,
    select,
    textarea {
        max-width: 100%;
    }
    
    /* Ensure tables are responsive */
    table {
        max-width: 100%;
        overflow-x: auto;
        display: block;
    }
    
    /* Ensure pre and code blocks don't overflow */
    pre,
    code {
        max-width: 100%;
        overflow-x: auto;
        word-wrap: break-word;
        white-space: pre-wrap;
    }
    
    /* Ensure modal dialogs respect boundaries */
    .modal-dialog {
        max-width: calc(100vw - 2rem) !important;
        margin: 1rem !important;
    }
    
    .modal-content {
        max-width: 100%;
    }
    
    /* Ensure Bootstrap columns don't overflow */
    [class*="col-"] {
        max-width: 100%;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Force all fixed and absolute positioned elements to respect boundaries */
    .fixed-top,
    .fixed-bottom {
        max-width: 100vw;
        left: 0;
        right: 0;
    }
    
    /* Ensure dropdowns don't overflow */
    .dropdown-menu {
        max-width: calc(100vw - 2rem);
    }
}
