/* VHSI Web Development Course - Main Stylesheet */

/* ===== CSS Variables ===== */
:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --secondary: #2c3e50;
    --accent: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --white: #ffffff;
    --gray: #95a5a6;
    --gray-dark: #7f8c8d;
    
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-code: 'Consolas', 'Monaco', 'Courier New', monospace;
    
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --radius-lg: 12px;
    
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: var(--font-main);
    line-height: 1.7;
    color: var(--dark);
    background-color: #f8f9fa;
    min-height: 100vh;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

code {
    font-family: var(--font-code);
    background: var(--light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ===== Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

#wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ===== Sidebar Navigation ===== */
.sidebar {
    width: 280px;
    background: var(--secondary);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 25px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 0.85rem;
    opacity: 0.9;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    padding: 10px 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.nav-link.active {
    background: rgba(255,255,255,0.15);
    color: var(--white);
    border-left-color: var(--primary);
}

.nav-link .chapter-num {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-right: 12px;
}

.nav-link.active .chapter-num {
    background: var(--primary);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 0;
    min-height: 100vh;
    box-sizing: border-box;
}

/* ===== Header ===== */
.lesson-header {
    margin-bottom: 40px;
    padding: 35px 40px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--white) 0%, #f8fafc 100%);
    border: 1px solid var(--light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.chapter-badge {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.lesson-header .chapter-badge {
    margin-bottom: 15px;
}

.chapter-badge.success {
    background: var(--success);
    color: var(--white);
}

.chapter-card .chapter-badge {
    font-size: 0.75rem;
    padding: 4px 12px;
    margin-bottom: 8px;
}

/* ===== Project Banner ===== */
.project-banner {
    text-align: center;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 30px;
    border-radius: var(--radius-lg);
    margin-top: 30px;
}

.project-banner h2 {
    margin-bottom: 10px;
}

.project-banner .btn {
    background: var(--success);
    margin-top: 15px;
}

.project-banner p {
    font-size: 0.9rem;
    color: var(--gray);
    margin-top: 10px;
}

/* ===== Oefeningen ===== */
.practice-exercises {
    margin-top: 20px;
}

.practice-exercises .exercise {
    background: var(--light);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.practice-exercises .exercise h3 {
    margin-top: 0;
    color: var(--secondary);
}

.practice-exercises .exercise ul {
    margin-bottom: 0;
}

.lesson-header h1 {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 12px;
    line-height: 1.2;
}

.lesson-header .meta {
    color: var(--gray);
    font-size: 1rem;
    margin-top: 8px;
}

/* ===== Content Sections ===== */
.section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px 35px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.section h2 {
    font-size: 1.6rem;
    color: var(--secondary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary);
}

.section h3 {
    font-size: 1.25rem;
    color: var(--secondary);
    margin: 25px 0 15px;
}

.section p {
    margin-bottom: 15px;
    color: #555;
}

.section ul, .section ol {
    margin: 15px 0;
    padding-left: 25px;
}

.section li {
    margin-bottom: 8px;
}

/* ===== Code Blocks ===== */
.code-block {
    background: #1e1e1e;
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
    position: relative;
}

.code-block pre {
    margin: 0;
    color: #d4d4d4;
    font-family: var(--font-code);
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-block .language-tag {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(255,255,255,0.1);
    color: var(--gray);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.code-block.html pre { color: #9cdcfe; }
.code-block.css pre { color: #ce9178; }
.code-block.javascript pre { color: #dcdcaa; }

.code-block {
    position: relative;
}

.code-block .preview-toggle {
    position: absolute;
    top: 10px;
    right: 80px;
    background: var(--success);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.code-block .preview-toggle:hover {
    opacity: 1;
}

.code-block .preview-container {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: white;
    border: 1px solid var(--light);
    border-radius: var(--radius);
}

.code-block .preview-container.active {
    display: block;
}

/* ===== Info Boxes ===== */
.info-box {
    background: #e8f4fd;
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.info-box.warning {
    background: #fff3e0;
    border-left-color: var(--warning);
}

.info-box.success {
    background: #e8f5e9;
    border-left-color: var(--success);
}

.info-box.danger {
    background: #ffebee;
    border-left-color: var(--accent);
}

.info-box-title {
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Tables ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

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

th {
    background: var(--secondary);
    color: var(--white);
    font-weight: 600;
}

tr:hover {
    background: #f8f9fa;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.btn-success {
    background: var(--success);
}

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

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

/* ===== Cards ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card h3 {
    color: var(--secondary);
    margin-bottom: 10px;
}

.card .icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* ===== Chapter Cards (Homepage) ===== */
.chapter-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-top: 4px solid var(--primary);
}

.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.chapter-card h3 {
    font-size: 1.3rem;
    color: var(--secondary);
    margin-bottom: 10px;
}

.chapter-card .topics {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.chapter-card .progress-bar {
    height: 6px;
    background: var(--light);
    border-radius: 3px;
    overflow: hidden;
}

.chapter-card .progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
}

/* ===== Live Example / Demo ===== */
.live-demo {
    background: #f0f0f0;
    border: 2px dashed var(--gray);
    border-radius: var(--radius);
    padding: 30px;
    margin: 20px 0;
    text-align: center;
}

.live-demo iframe {
    border: none;
    width: 100%;
    height: 200px;
    background: var(--white);
    border-radius: var(--radius);
}

/* ===== Tabs ===== */
.tabs {
    margin: 20px 0;
}

.tab-buttons {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--light);
    margin-bottom: 15px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

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

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

.tab-content {
    display: none;
}

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

/* ===== Progress Tracker ===== */
.progress-tracker {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--white);
    padding: 15px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 99;
}

.progress-tracker .label {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 5px;
}

.progress-tracker .progress-bar {
    width: 150px;
    height: 8px;
    background: var(--light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-tracker .progress-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s ease;
}

/* ===== Interactive Elements ===== */
.try-it {
    background: #f0f8ff;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.try-it h4 {
    color: var(--primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.try-it textarea {
    width: 100%;
    min-height: 150px;
    font-family: var(--font-code);
    padding: 15px;
    border: 1px solid var(--light);
    border-radius: var(--radius);
    resize: vertical;
    font-size: 0.9rem;
}

.try-it .controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.preview-display {
    margin-top: 15px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    min-height: 200px;
    box-sizing: border-box;
}

.preview-iframe {
    width: 100%;
    height: 300px;
    border: 1px solid var(--light);
    border-radius: 8px;
    background: white;
    margin-top: 15px;
}

/* ===== Quiz Section ===== */
.quiz-question {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.quiz-question h4 {
    margin-bottom: 15px;
    color: var(--secondary);
}

.quiz-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: var(--light);
    border-radius: var(--radius);
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.quiz-option:hover {
    background: #dfe6e9;
}

.quiz-option input {
    margin-right: 12px;
}

.quiz-option.correct {
    background: #d4edda;
    border: 2px solid var(--success);
}

.quiz-option.incorrect {
    background: #f8d7da;
    border: 2px solid var(--accent);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
    border-top: 1px solid var(--light);
    margin-top: 40px;
}

/* ===== Homepage Specific ===== */
.hero-section {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 80px 40px;
    border-radius: var(--radius-lg);
    margin-bottom: 50px;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.3rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto 30px;
}

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

.stat-item {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: var(--radius);
}

.stat-item .number {
    font-size: 2.5rem;
    font-weight: bold;
}

.stat-item .label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }
    
    .lesson-header h1 {
        font-size: 1.8rem;
    }
    
    .section {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Menu Toggle (Mobile) ===== */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 101;
    background: var(--primary);
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: var(--shadow);
}

@media (max-width: 1024px) {
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

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

.section {
    animation: fadeIn 0.5s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.highlight {
    animation: pulse 0.5s ease;
}
