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

:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border: #334155;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 2rem 0;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
    margin-bottom: 2rem;
}

.navbar .container {
    text-align: center;
}

.logo {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.95;
}

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

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border);
    padding-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -1rem;
}

.tab-btn:hover {
    color: var(--text);
    background: rgba(99, 102, 241, 0.1);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

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

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

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

.btn-secondary {
    background: var(--primary);
    color: white;
}

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

/* Lessons Grid */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.lesson-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
}

.lesson-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
    transform: translateY(-5px);
}

.lesson-card h3 {
    margin-bottom: 1rem;
    color: var(--text);
}

.lesson-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.difficulty {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.difficulty.beginner {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.difficulty.intermediate {
    background: rgba(236, 72, 153, 0.2);
    color: var(--accent);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

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

.modal-content h3 {
    margin: 1.5rem 0 1rem 0;
    color: var(--primary);
}

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

/* Quiz */
.quiz-start {
    text-align: center;
    padding: 3rem;
}

.quiz-start p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.quiz-question {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.quiz-question h4 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.quiz-options {
    display: grid;
    gap: 1rem;
}

.quiz-option {
    padding: 1rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.quiz-option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
}

.quiz-option.correct {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.2);
}

.quiz-option.incorrect {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.2);
}

.quiz-results {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.quiz-results h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--success);
}

/* Visualizer */
.visualizer-container {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.controls {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.controls label {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.controls input[type="range"] {
    width: 150px;
}

#networkCanvas {
    width: 100%;
    max-width: 600px;
    height: auto;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
    margin: 0 auto 1rem;
}

.visualization-info {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* Progress */
.progress-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

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

.stat-card h3 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .logo {
        font-size: 1.8rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    .tabs {
        gap: 0.5rem;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}