:root {
    /* Colors */
    --bg-dark: #0a0e27;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    /* Brand Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    --gradient-danger: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    --gradient-warning: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    --gradient-text: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 5rem;
    
    /* Borders & Radius */
    --radius-sm: 8px;
    --radius-md: 15px;
    --radius-lg: 20px;
    --radius-full: 50px;
    --border-light: rgba(255, 255, 255, 0.1);
    
    /* Shadows */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
    font-size: 1.1rem;
}

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

.section {
    padding: var(--spacing-xl) 0;
    position: relative;
}

.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* Components */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.5);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-light);
    color: white;
}

.btn-outline:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.btn-sm {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 1rem 3rem;
    font-size: 1.1rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: var(--shadow-md);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover, .nav-link.active {
    color: white;
}

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

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

/* Footer */
.main-footer {
    background: rgba(0, 0, 0, 0.2);
    padding: var(--spacing-lg) 0 var(--spacing-md);
    margin-top: auto;
    border-top: 1px solid var(--border-light);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 1rem;
    max-width: 300px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 1.5rem;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col ul li a {
    color: var(--text-secondary);
}

.footer-col ul li a:hover {
    color: #667eea;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Dashboard Specifics */
.dashboard-layout {
    margin-top: 80px;
    padding-bottom: var(--spacing-xl);
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active { background: rgba(39, 174, 96, 0.2); color: #2ecc71; border: 1px solid rgba(39, 174, 96, 0.3); }
.status-badge.trial { background: rgba(243, 156, 18, 0.2); color: #f1c40f; border: 1px solid rgba(243, 156, 18, 0.3); }
.status-badge.inactive { background: rgba(231, 76, 60, 0.2); color: #e74c3c; border: 1px solid rgba(231, 76, 60, 0.3); }

/* Table Styles */
.data-table-container {
    overflow-x: auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.data-table th {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.2rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.data-table td {
    padding: 1.2rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* Responsive */

/* Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 2px solid var(--border-light);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg-dark);
    border-left: 1px solid var(--border-light);
    z-index: 99999; /* Increased z-index */
    padding: 2rem;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
}

.mobile-menu.active {
    display: block;
    right: 0;
}

/* Fix Language Selector in Mobile Menu */
.mobile-menu .language-selector {
    margin-top: 0;
    margin-bottom: 1.5rem;
    display: block;
    width: 100%;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.mobile-menu .lang-btn {
    width: 100%;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
}

.mobile-menu .lang-dropdown {
    position: relative; /* Flow naturally in the menu */
    right: auto !important;
    left: 0 !important;
    top: 0 !important;
    bottom: auto !important;
    margin-top: 10px;
    width: 100%;
    min-width: 100%;
    transform: none;
    display: none; /* Hidden by default */
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.2);
}

.mobile-menu .lang-dropdown.show {
    display: block;
    transform: none;
}

.mobile-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    color: #667eea;
    transform: rotate(90deg);
}

.mobile-menu .nav-link {
    display: block;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 1.1rem;
}

.mobile-menu .nav-link::after {
    display: none;
}

.mobile-menu .btn {
    width: 100%;
    margin-top: 1rem;
    justify-content: center;
}

/* Tablet (769px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
}

/* Tablet and Mobile (max-width: 768px) */
@media (max-width: 768px) {
    /* Navigation */
    .nav-links {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: inline-flex !important;
    }
    
    /* Typography */
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    h1 {
        font-size: 2.5rem !important;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    h4 {
        font-size: 1.2rem;
    }
    
    /* Layout */
    .container {
        padding: 0 1.5rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    /* Grids */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .btn-lg {
        padding: 0.9rem 2rem;
        font-size: 1rem;
    }
    
    /* Cards */
    .card {
        padding: 1.5rem;
    }
    
    /* Remove hover transforms on touch devices */
    @media (hover: none) {
        .card:hover {
            transform: none;
        }
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    /* Hero Section Adjustments */
    .hero {
        min-height: 70vh !important;
        padding-top: 100px !important;
        background-color: #0a0e27 !important; /* Force dark background */
        background-image: none !important; /* Remove any potential background images */
        position: relative;
        overflow: hidden;
    }
    
    #hero-canvas {
        background-color: #0a0e27 !important; /* Force dark background on canvas container */
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%) !important; /* Fallback gradient */
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 1 !important;
    }
    
    /* Ensure hero content is above canvas */
    .hero .container {
        position: relative;
        z-index: 2;
    }
    
    /* Button Containers */
    .hero div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .hero .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Canvas Containers */
    div[id*="canvas"] {
        min-height: 200px !important;
        height: auto !important;
    }
    
    #hero-canvas {
        min-height: 300px !important;
    }
    
    #methodology-canvas {
        min-height: 250px !important;
    }
    
    #global-access-canvas {
        min-height: 250px !important;
    }
}

/* Mobile Large (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .section-title {
        font-size: 2.2rem;
    }
    
    h1 {
        font-size: 2.8rem !important;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Small (max-width: 480px) */
@media (max-width: 480px) {
    /* Typography */
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 0.95rem;
    }
    
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    h4 {
        font-size: 1.1rem;
    }
    
    /* Layout */
    .container {
        padding: 0 1rem;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    /* Buttons */
    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }
    
    /* Cards */
    .card {
        padding: 1.2rem;
    }
    
    /* Logo */
    .logo {
        font-size: 1.2rem;
    }
    
    /* Hero */
    .hero {
        min-height: 60vh !important;
        padding-top: 80px !important;
    }
    
    /* Forms */
    input[type="email"],
    input[type="text"],
    input[type="password"],
    textarea,
    select {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Touch Targets */
    .btn,
    .nav-link,
    a.card {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Extra Small Mobile (max-width: 320px) */
@media (max-width: 320px) {
    .section-title {
        font-size: 1.5rem;
    }
    
    h1 {
        font-size: 1.8rem !important;
    }
    
    .container {
        padding: 0 0.8rem;
    }
    
    .logo span {
        font-size: 0.9rem;
    }
}
