/* ========================================
   WebDev Academy - Main Stylesheet
   Giao diện colorful, sinh động cho người mới
   ======================================== */

/* === CSS Variables === */
:root {
    /* Primary Colors - Gradient */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);

    /* Solid Colors */
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #00c853;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #00bcd4;

    /* Course Colors */
    --html-color: #e44d26;
    --css-color: #264de4;
    --bootstrap-color: #7952b3;
    --form-color: #ff6b6b;

    /* Neutrals */
    --dark: #2d3748;
    --gray-700: #4a5568;
    --gray-500: #718096;
    --gray-300: #e2e8f0;
    --gray-100: #f7fafc;
    --white: #ffffff;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --shadow-xl: 0 12px 48px rgba(0,0,0,0.2);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gray-100);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* === Header === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--white);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: var(--transition-normal);
}

.logo:hover {
    transform: scale(1.05);
}

.logo i {
    font-size: 1.8rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 500;
    color: var(--gray-500);
    transition: var(--transition-normal);
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: var(--white);
}

.progress-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--warning-gradient);
    border-radius: var(--radius-full);
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.progress-badge:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* === Main Content === */
.main-content {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
    padding: 30px;
}

/* === Home Page === */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Hero Section */
.hero-section {
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    padding: 60px;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 60px;
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.hero-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-title span {
    display: block;
    color: #ffd700;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
    max-width: 500px;
}

.hero-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.2);
    padding: 12px 20px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
}

.stat-item i {
    font-size: 1.3rem;
}

.hero-illustration {
    flex: 0 0 350px;
    position: relative;
    z-index: 1;
}

.code-window {
    background: var(--dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: rotate(-3deg);
    transition: var(--transition-normal);
}

.code-window:hover {
    transform: rotate(0deg) scale(1.02);
}

.window-header {
    display: flex;
    gap: 8px;
    padding: 12px 15px;
    background: #1a202c;
}

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

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27ca40; }

.window-body {
    padding: 20px;
}

.window-body pre {
    margin: 0;
    color: #a0aec0;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
}

.window-body .tag { color: #f687b3; }
.window-body .attr { color: #68d391; }
.window-body .value { color: #fbd38d; }
.window-body .text { color: #90cdf4; }

/* Courses Section */
.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--dark);
}

.section-title i {
    margin-right: 10px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.course-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.course-card.html::before { background: var(--html-color); }
.course-card.css::before { background: var(--css-color); }
.course-card.bootstrap::before { background: var(--bootstrap-color); }
.course-card.form::before { background: var(--form-color); }

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

.course-card.html:hover { border-color: var(--html-color); }
.course-card.css:hover { border-color: var(--css-color); }
.course-card.bootstrap:hover { border-color: var(--bootstrap-color); }
.course-card.form:hover { border-color: var(--form-color); }

.course-icon {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--white);
    margin-bottom: 20px;
}

.course-card.html .course-icon { background: var(--html-color); }
.course-card.css .course-icon { background: var(--css-color); }
.course-card.bootstrap .course-icon { background: var(--bootstrap-color); }
.course-card.form .course-icon { background: var(--form-color); }

.course-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark);
}

.course-card p {
    color: var(--gray-500);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.course-progress {
    margin-bottom: 20px;
}

.progress-bar-container {
    height: 8px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.course-card.html .progress-bar-fill { background: var(--html-color); }
.course-card.css .progress-bar-fill { background: var(--css-color); }
.course-card.bootstrap .progress-bar-fill { background: var(--bootstrap-color); }
.course-card.form .progress-bar-fill { background: var(--form-color); }

.progress-text {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.btn-start {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-full);
    font-weight: 600;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-normal);
}

.course-card.html .btn-start { background: var(--html-color); }
.course-card.css .btn-start { background: var(--css-color); }
.course-card.bootstrap .btn-start { background: var(--bootstrap-color); }
.course-card.form .btn-start { background: var(--form-color); }

.btn-start:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* === Course Detail Page === */
.course-container {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar */
.lesson-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 100px;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    margin-bottom: 25px;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: 15px;
    transition: var(--transition-normal);
}

.btn-back:hover {
    background: var(--gray-300);
}

.sidebar-header h3 {
    font-size: 1.2rem;
    color: var(--dark);
}

.lesson-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    background: var(--gray-100);
}

.lesson-item:hover {
    background: var(--gray-300);
}

.lesson-item.active {
    background: var(--primary-gradient);
    color: var(--white);
}

.lesson-item.completed {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.lesson-item.completed .lesson-icon {
    background: var(--success);
}

.lesson-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-300);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.lesson-item.active .lesson-icon {
    background: rgba(255,255,255,0.3);
}

.lesson-info {
    flex: 1;
    min-width: 0;
}

.lesson-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-info span {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Lesson Content */
.lesson-content {
    flex: 1;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.lesson-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-100);
}

.lesson-header h2 {
    font-size: 1.5rem;
    color: var(--dark);
}

.step-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    color: var(--gray-700);
    font-weight: 500;
    transition: var(--transition-normal);
}

.btn-nav:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.step-indicator {
    padding: 8px 16px;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Step Progress Bar */
.step-progress {
    margin-bottom: 30px;
}

.step-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-300);
    transition: var(--transition-normal);
}

.step-dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

.step-dot.completed {
    background: var(--success);
}

/* Lesson Body */
.lesson-body {
    min-height: 300px;
}

.step-content {
    animation: fadeIn 0.3s ease;
}

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

.step-content h3 {
    font-size: 1.3rem;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-content h3 i {
    color: var(--primary);
}

.step-content p {
    color: var(--gray-700);
    margin-bottom: 15px;
    line-height: 1.7;
}

.step-content ul {
    margin: 15px 0;
    padding-left: 25px;
}

.step-content li {
    margin-bottom: 10px;
    color: var(--gray-700);
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
    border-left: 4px solid var(--info);
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 20px 0;
}

.info-box.tip {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-left-color: var(--warning);
}

.info-box.warning {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border-left-color: var(--danger);
}

.info-box h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--dark);
}

/* Code Block */
.code-block {
    background: #1e1e1e;
    border-radius: var(--radius-md);
    margin: 20px 0;
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
}

.code-header span {
    color: #a0a0a0;
    font-size: 0.85rem;
}

.btn-copy {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #404040;
    border-radius: var(--radius-sm);
    color: #e0e0e0;
    font-size: 0.8rem;
    transition: var(--transition-fast);
}

.btn-copy:hover {
    background: #505050;
}

.code-body {
    padding: 20px;
    overflow-x: auto;
}

.code-body pre {
    margin: 0;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
}

.code-body .tag { color: #569cd6; }
.code-body .attr { color: #9cdcfe; }
.code-body .value { color: #ce9178; }
.code-body .comment { color: #6a9955; }
.code-body .property { color: #9cdcfe; }
.code-body .selector { color: #d7ba7d; }

/* === Code Editor === */
.editor-section {
    margin-top: 30px;
    border-top: 2px solid var(--gray-100);
    padding-top: 30px;
}

.editor-section h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--dark);
}

.editor-section h4 i {
    color: var(--success);
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-height: 300px;
}

.editor-panel, .preview-panel {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.editor-panel {
    background: #1e1e1e;
}

.editor-header, .preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #2d2d2d;
}

.editor-header span, .preview-header span {
    color: #a0a0a0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-reset, .btn-run {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.btn-reset {
    background: #404040;
    color: #e0e0e0;
}

.btn-reset:hover {
    background: #505050;
}

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

.btn-run:hover {
    filter: brightness(1.1);
}

.code-textarea {
    width: 100%;
    height: 250px;
    padding: 16px;
    background: #1e1e1e;
    border: none;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
}

.code-textarea:focus {
    outline: none;
}

.preview-panel {
    background: var(--white);
    border: 1px solid var(--gray-300);
}

.preview-header {
    background: var(--gray-100);
}

.preview-header span {
    color: var(--gray-700);
}

.preview-iframe {
    width: 100%;
    height: 250px;
    border: none;
    background: var(--white);
}

/* === Quiz Section === */
.quiz-section {
    margin-top: 30px;
    border-top: 2px solid var(--gray-100);
    padding-top: 30px;
}

.quiz-section > h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    color: var(--dark);
}

.quiz-section > h4 i {
    color: var(--warning);
}

.quiz-container {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 25px;
}

.quiz-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 20px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--white);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    border: 2px solid transparent;
}

.quiz-option:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #e8eaf6, #c5cae9);
}

.quiz-option.correct {
    border-color: var(--success);
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

.quiz-option.incorrect {
    border-color: var(--danger);
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
}

.option-letter {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--gray-700);
    flex-shrink: 0;
}

.quiz-option.selected .option-letter {
    background: var(--primary);
    color: var(--white);
}

.quiz-option.correct .option-letter {
    background: var(--success);
    color: var(--white);
}

.quiz-option.incorrect .option-letter {
    background: var(--danger);
    color: var(--white);
}

.option-text {
    flex: 1;
    color: var(--gray-700);
}

.quiz-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
}

.quiz-result.success {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

.quiz-result.fail {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
}

.quiz-result h4 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-check-answer {
    margin-top: 20px;
    padding: 14px 32px;
    background: var(--primary-gradient);
    color: var(--white);
    border-radius: var(--radius-full);
    font-weight: 600;
    transition: var(--transition-normal);
}

.btn-check-answer:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* Complete Lesson Button */
.lesson-complete {
    margin-top: 30px;
    text-align: center;
}

.btn-complete {
    padding: 16px 40px;
    background: var(--success-gradient);
    color: var(--white);
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-normal);
}

.btn-complete:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* === Progress Page === */
.progress-container {
    max-width: 1000px;
    margin: 0 auto;
}

.progress-header {
    text-align: center;
    margin-bottom: 40px;
}

.progress-header h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 10px;
}

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

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 25px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
    color: var(--white);
}

.stat-icon.lessons { background: var(--primary-gradient); }
.stat-icon.quizzes { background: var(--success-gradient); }
.stat-icon.streak { background: var(--warning-gradient); }
.stat-icon.time { background: var(--secondary-gradient); }

.stat-card h3 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 5px;
}

.stat-card p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* Course Progress Cards */
.progress-section-title {
    font-size: 1.3rem;
    color: var(--dark);
    margin-bottom: 20px;
}

.course-progress-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.course-progress-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-sm);
}

.course-progress-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.course-progress-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--white);
}

.course-progress-card.html .course-progress-icon { background: var(--html-color); }
.course-progress-card.css .course-progress-icon { background: var(--css-color); }
.course-progress-card.bootstrap .course-progress-icon { background: var(--bootstrap-color); }
.course-progress-card.form .course-progress-icon { background: var(--form-color); }

.course-progress-info h4 {
    font-size: 1.1rem;
    color: var(--dark);
}

.course-progress-info span {
    color: var(--gray-500);
    font-size: 0.85rem;
}

.course-progress-bar {
    height: 10px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 10px;
}

.course-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.course-progress-card.html .course-progress-fill { background: var(--html-color); }
.course-progress-card.css .course-progress-fill { background: var(--css-color); }
.course-progress-card.bootstrap .course-progress-fill { background: var(--bootstrap-color); }
.course-progress-card.form .course-progress-fill { background: var(--form-color); }

.course-progress-text {
    display: flex;
    justify-content: space-between;
    color: var(--gray-500);
    font-size: 0.85rem;
}

/* Achievements */
.achievements-section h3 {
    margin-bottom: 20px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.achievement-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    opacity: 0.5;
}

.achievement-card.unlocked {
    opacity: 1;
}

.achievement-card:hover {
    transform: scale(1.05);
}

.achievement-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.achievement-card h4 {
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 5px;
}

.achievement-card p {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* === Playground Page === */
.playground-container {
    max-width: 1400px;
    margin: 0 auto;
}

.playground-header {
    text-align: center;
    margin-bottom: 30px;
}

.playground-header h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 10px;
}

.playground-header p {
    color: var(--gray-500);
}

.playground-editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 70vh;
}

.playground-code-section {
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background: #2d2d2d;
}

.tab-btn {
    padding: 14px 24px;
    background: transparent;
    color: #a0a0a0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: #e0e0e0;
    background: #353535;
}

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

.playground-textarea {
    flex: 1;
    width: 100%;
    padding: 20px;
    background: #1e1e1e;
    border: none;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
}

.playground-textarea:focus {
    outline: none;
}

.playground-preview-section {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.playground-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-300);
}

.playground-preview-header span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-700);
    font-weight: 500;
}

.playground-iframe {
    flex: 1;
    border: none;
    background: var(--white);
}

/* === Toast Notification === */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }
.toast.warning { border-left: 4px solid var(--warning); }

.toast-icon {
    font-size: 1.3rem;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--info); }
.toast.warning .toast-icon { color: var(--warning); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.9rem;
    color: var(--gray-500);
}

.toast-close {
    background: none;
    color: var(--gray-500);
    font-size: 1.2rem;
    padding: 5px;
    transition: var(--transition-fast);
}

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

/* === Confetti Canvas === */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: 40px;
    }

    .hero-illustration {
        display: none;
    }

    .hero-stats {
        justify-content: center;
        flex-wrap: wrap;
    }

    .course-container {
        flex-direction: column;
    }

    .lesson-sidebar {
        width: 100%;
        position: static;
    }

    .editor-container {
        grid-template-columns: 1fr;
    }

    .playground-editor-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .playground-code-section,
    .playground-preview-section {
        height: 400px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .course-progress-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 15px;
    }

    .nav-menu {
        display: none;
    }

    .hero-title {
        font-size: 2rem;
    }

    .main-content {
        padding: 20px;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* === Loading Animation === */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    color: var(--dark);
    margin-bottom: 10px;
}
