:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --code-bg: #1e1e3f;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

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

html {
    scroll-behavior: smooth;
}

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

/* Links - High Contrast Colors */
a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

a:visited {
    color: #c084fc;
}

a:visited:hover {
    color: #d8b4fe;
}

a:focus {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

/* Progress Bar */
.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    width: 0%;
    transition: width 0.1s ease-out;
    z-index: 1001;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.6rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.logo-icon {
    font-size: 1.6rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.3rem 0;
}

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

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

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a.active::after {
    width: 100%;
}

/* Hero Section */
.hero {
    margin-top: 60px;
    padding: 6rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero .subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.badge {
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

.btn-secondary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Section Styling */
section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title::before {
    content: '';
    width: 5px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: 10px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Feature Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    max-width: 100%;
}

@media (min-width: 1400px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

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

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

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

.feature-card ul {
    color: var(--text-secondary);
    padding-left: 1.5rem;
    margin-top: 1rem;
}

.feature-card li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Tech Stack */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0;
}

.tech-item {
    background: var(--card-bg);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tech-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Code Block */
.code-block {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    overflow-x: auto;
    max-width: 100%;
}

.code-block .code-wrapper {
    overflow-x: auto;
    position: relative;
}

.code-block .copy-btn {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    padding: 0.5rem !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 1.2rem !important;
    z-index: 10 !important;
    transition: all 0.3s !important;
    width: 35px !important;
    height: 35px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.code-block pre {
    margin: 0;
    color: #f8f8f2;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    overflow-x: auto;
    max-width: 100%;
    white-space: pre;
}

.code-block code {
    color: #f8f8f2;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Mermaid Diagrams */
.mermaid-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    margin: 2rem 0;
    overflow-x: auto;
    max-width: 100%;
}

.mermaid-container .mermaid {
    min-width: fit-content;
}

/* Architecture Diagram */
.architecture {
    margin: 3rem 0;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 600;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-left: 80px;
    margin-bottom: 3rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--dark-bg);
}

.timeline-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    margin-bottom: 0.5rem;
}

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

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 0.4rem;
    z-index: 1002;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 60px);
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem 0;
        gap: 0;
        transition: right 0.3s ease;
        border-left: 1px solid var(--border-color);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 1rem 2rem;
        font-size: 1rem;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
    }
    
    .nav-links a::after {
        display: none;
    }
    
    .nav-links a.active {
        background: rgba(37, 99, 235, 0.1);
        border-left: 3px solid var(--primary-color);
    }
    
    .nav-links a:hover {
        background: rgba(37, 99, 235, 0.05);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 2rem 1rem;
    }
    
    .hero {
        padding: 4rem 1rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero .subtitle {
        font-size: 1.2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .code-block {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 10px;
    }
    
    .code-block pre {
        font-size: 0.85rem;
    }
    
    .mermaid-container {
        padding: 1rem;
        overflow-x: auto;
    }
    
    .tech-stack {
        justify-content: center;
    }
    
    .tech-item {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .timeline-item {
        padding-left: 60px;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item::before {
        left: 10px;
        width: 16px;
        height: 16px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .nav-links {
        width: 100%;
        right: -100%;
    }
    
    .nav-links.active {
        right: 0;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 0.6rem 1rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo-icon {
        font-size: 1.4rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero .subtitle {
        font-size: 1rem;
    }
    
    .hero-badges {
        gap: 0.4rem;
    }
    
    .badge {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-title::before {
        width: 4px;
        height: 30px;
    }
    
    .feature-icon {
        font-size: 2.5rem;
    }
    
    .feature-card h3 {
        font-size: 1.25rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .info-box,
    .warning-box,
    .success-box {
        padding: 1rem;
        margin: 1rem 0;
    }
}

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

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

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Table Styles */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: var(--card-bg);
    min-width: 600px;
}

thead {
    background: rgba(37, 99, 235, 0.2);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--primary-color);
    font-weight: 700;
    white-space: nowrap;
}

td {
    word-wrap: break-word;
}

tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

@media (max-width: 768px) {
    table {
        min-width: 100%;
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Stack table on very small screens */
    @media (max-width: 480px) {
        thead {
            display: none;
        }
        
        tr {
            display: block;
            margin-bottom: 1rem;
            border: 1px solid var(--border-color);
            border-radius: 10px;
        }
        
        td {
            display: block;
            text-align: right;
            padding: 0.75rem 1rem;
            border-bottom: 1px solid var(--border-color);
            position: relative;
        }
        
        td:last-child {
            border-bottom: none;
        }
        
        td::before {
            content: attr(data-label);
            float: left;
            font-weight: bold;
            color: var(--primary-color);
        }
    }
}

/* Highlight boxes */
.info-box {
    background: rgba(37, 99, 235, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 10px;
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid var(--warning-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 10px;
}

.success-box {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 10px;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
