/* ==========================================================================
   CSS Variables & Tokens
   ========================================================================== */
:root {
    /* Colors - Dark Mode Aesthetic */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Brand Colors - Vibrant Gradient */
    --brand-primary: #3b82f6;
    --brand-secondary: #8b5cf6;
    --brand-accent: #06b6d4;
    
    /* UI Elements */
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);
    
    /* Spacing & Layout */
    --container-max: 1200px;
    --nav-height: 80px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    /* Animations */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

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

/* Background Effects */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 20s infinite alternate;
}

.blob-1 {
    top: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, rgba(0,0,0,0) 70%);
}

.blob-2 {
    bottom: -20%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(139,92,246,0.2) 0%, rgba(0,0,0,0) 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-5%, 5%) scale(1.1); }
    100% { transform: translate(5%, -5%) scale(0.9); }
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    font-weight: 700;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* ==========================================================================
   Components
   ========================================================================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-large {
    padding: 14px 32px;
    font-size: 1.125rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 100;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background: rgba(15, 23, 42, 0.9);
    box-shadow: var(--glass-shadow);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-accent {
    color: var(--brand-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

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

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

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

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
}

.mobile-menu-btn span {
    position: absolute;
    height: 2px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.mobile-menu-btn span:nth-child(1) { top: 0; }
.mobile-menu-btn span:nth-child(2) { top: 9px; }
.mobile-menu-btn span:nth-child(3) { top: 18px; }

/* ==========================================================================
   Sections
   ========================================================================== */

main {
    padding-top: var(--nav-height);
}

/* Hero Section */
.hero {
    min-height: calc(100vh - var(--nav-height));
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 80px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-full);
    color: var(--brand-primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 4.5rem);
    letter-spacing: -1px;
    margin-bottom: 24px;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 60px;
}

.stats-container {
    display: flex;
    gap: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--glass-border);
}

.stat-item h3 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-item p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Hero Visual (Glassmorphism) */
.hero-visual {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow);
}

.main-dashboard {
    width: 100%;
    max-width: 500px;
    height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: float 6s ease-in-out infinite;
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.window-controls {
    display: flex;
    gap: 6px;
}

.window-controls span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.window-controls span:nth-child(1) { background: #ef4444; }
.window-controls span:nth-child(2) { background: #eab308; }
.window-controls span:nth-child(3) { background: #22c55e; }

.card-header .title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: auto;
    margin-right: auto;
}

.card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.skeleton-chart {
    height: 120px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.skeleton-chart .bar {
    flex: 1;
    background: linear-gradient(to top, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.8));
    border-radius: 4px 4px 0 0;
}

.data-rows {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.line {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.line-1 { width: 60%; }
.line-2 { width: 40%; }

.floating-card {
    position: absolute;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    bottom: 40px;
    left: -40px;
    animation: float 5s ease-in-out infinite alternate-reverse;
}

.floating-card .icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-card h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.floating-card p {
    font-size: 1.25rem;
    font-weight: 700;
    color: #10b981;
}

/* Features Section */
.features {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 100px 24px;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-header h2 {
    font-size: clamp(2rem, 3vw, 2.5rem);
    margin-bottom: 16px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.feature-card {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    transition: all var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-10px);
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.feature-card p {
    color: var(--text-secondary);
}

/* Footer */
footer {
    border-top: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.5);
    padding-top: 80px;
}

.footer-content {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 64px;
    margin-bottom: 64px;
}

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

.footer-links {
    display: flex;
    justify-content: space-around;
}

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

.link-group h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.link-group a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.link-group a:hover {
    color: var(--brand-primary);
}

.footer-bottom {
    border-top: 1px solid var(--glass-border);
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 40px;
    }
    
    .hero-description {
        margin: 0 auto 40px;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .stats-container {
        justify-content: center;
    }
    
    .hero-visual {
        margin-top: 40px;
    }
    
    .floating-card {
        left: 20px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none; /* In a real app, add mobile menu logic */
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer-links {
        justify-content: flex-start;
        gap: 60px;
    }
}

/* ==========================================================================
   Auth & Modal Styles
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    position: relative;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.modal-header h3 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.modal-header p {
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-group input:focus {
    border-color: var(--brand-primary);
}

.btn-full {
    width: 100%;
    margin-top: 8px;
}

.auth-error {
    color: #ef4444;
    font-size: 0.875rem;
    text-align: center;
    min-height: 20px;
}

.modal-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.modal-footer a {
    color: var(--brand-primary);
    font-weight: 500;
}

.modal-footer a:hover {
    text-decoration: underline;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}
