/* ========================================
   Chung Khoan - Vietnamese Stock Analysis
   Modern CSS with CSS Variables
   ======================================== */

/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --accent: #f59e0b;
    --danger: #ef4444;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border: #334155;
    --border-light: #475569;
    
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-2: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-hero: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-brand .logo {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

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

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-cta {
    background: var(--gradient-1);
    color: white !important;
    margin-left: 8px;
}

.nav-cta:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    overflow: hidden;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

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

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

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

/* Hero Visual - Code Preview */
.hero-visual {
    position: relative;
}

.code-preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

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

.code-dots {
    display: flex;
    gap: 8px;
}

.code-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dots span:nth-child(1) { background: #ef4444; }
.code-dots span:nth-child(2) { background: #f59e0b; }
.code-dots span:nth-child(3) { background: #10b981; }

.code-title {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.code-content {
    padding: 20px 24px;
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
    line-height: 1.8;
    overflow-x: auto;
}

.code-keyword { color: #c084fc; }
.code-string { color: #4ade80; }
.code-number { color: #fbbf24; }
.code-function { color: #60a5fa; }
.code-comment { color: var(--text-muted); font-style: italic; }

/* Hero Background */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    right: -100px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: -100px;
    left: -100px;
}

/* ========================================
   Stats Section
   ======================================== */
.stats {
    padding: 80px 0;
    border-bottom: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.stat-card {
    text-align: center;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

/* ========================================
   Section Common Styles
   ======================================== */
.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 60px;
}

.section-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

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

/* ========================================
   Features Section
   ======================================== */
.features {
    padding: 120px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ========================================
   Architecture Section
   ======================================== */
.architecture {
    padding: 120px 0;
    background: var(--bg-secondary);
}

.architecture-diagram {
    margin-bottom: 60px;
}

.arch-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.arch-block {
    text-align: center;
    padding: 32px 40px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    min-width: 180px;
}

.arch-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.arch-title {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 4px;
}

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

.arch-arrow {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 300;
}

.tech-stack {
    text-align: center;
}

.tech-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.tech-badge {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.tech-badge.python {
    background: var(--gradient-1);
    color: white;
    border: none;
}

/* ========================================
   Demo Section
   ======================================== */
.demo {
    padding: 120px 0;
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.demo-card {
    text-align: center;
}

.demo-preview {
    margin-bottom: 20px;
}

.demo-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Terminal Mockup */
.terminal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-align: left;
}

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

.terminal-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.terminal-header span {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.terminal-body {
    padding: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.8;
}

.terminal-line {
    margin-bottom: 12px;
}

.prompt {
    color: var(--secondary);
    margin-right: 8px;
}

.command {
    color: var(--text-primary);
}

.terminal-output {
    color: var(--text-secondary);
}

.terminal-output p {
    margin-bottom: 4px;
}

.terminal-output .success {
    color: var(--secondary);
    font-weight: 600;
}

/* Excel Mockup */
.excel-mockup {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    text-align: left;
}

.excel-header {
    padding: 12px 16px;
    background: #217346;
}

.excel-title {
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
}

.excel-content {
    padding: 16px;
}

.excel-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 80px;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.8125rem;
}

.excel-row.header {
    font-weight: 600;
    background: #f1f5f9;
    margin: -16px -16px 0;
    padding: 10px 16px;
}

.excel-row span {
    color: #334155;
}

.excel-row .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.excel-row .badge {
    text-align: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.buy {
    background: #dcfce7;
    color: #166534;
}

.badge.sell {
    background: #fee2e2;
    color: #991b1b;
}

/* ========================================
   Setup Section
   ======================================== */
.setup {
    padding: 120px 0;
    background: var(--bg-secondary);
}

.setup-steps {
    max-width: 800px;
    margin: 0 auto;
}

.step {
    display: flex;
    gap: 24px;
    margin-bottom: 40px;
}

.step:last-child {
    margin-bottom: 0;
}

.step-number {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.code-block {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    overflow-x: auto;
}

.code-block code {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.copy-btn.copied {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

/* ========================================
   CTA Section
   ======================================== */
.cta {
    padding: 120px 0;
}

.cta-box {
    text-align: center;
    padding: 80px 40px;
    background: var(--gradient-1);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.cta-box h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: white;
}

.cta-box p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 32px;
}

.cta-box .btn-primary {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.cta-box .btn-primary:hover {
    background: #f8fafc;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    padding: 60px 0 40px;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 40px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.footer-brand .logo {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

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

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .code-preview {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        padding: 24px;
        gap: 8px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        width: 100%;
        justify-content: center;
    }
    
    .nav-cta {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .demo-grid {
        grid-template-columns: 1fr;
    }
    
    .arch-flow {
        flex-direction: column;
    }
    
    .arch-arrow {
        transform: rotate(90deg);
    }
    
    .step {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .cta-box {
        padding: 48px 24px;
    }
    
    .cta-box h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

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

.feature-card,
.step,
.demo-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

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

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

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

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