/* Beginner-Friendly Design System */
:root {
    /* Simple, friendly colors */
    --primary: #4f46e5;        /* Friendly purple-blue */
    --primary-dark: #4338ca;   
    --success: #22c55e;        /* Encouraging green */
    --success-bg: #f0fdf4;     
    --text-main: #1e293b;      /* Very dark, easy to read */
    --text-secondary: #64748b; /* Still readable gray */
    --white: #ffffff;
    --background: #f8fafc;     /* Soft background */
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    background: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 18px; /* Larger base font */
}

/* Simple Login Screen */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.login-box {
    background: var(--white);
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    text-align: center;
    margin: 0 auto;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.login-container h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.login-container p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 1rem;
}

.form-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.2s;
    background: var(--white);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-group i {
    position: absolute;
    left: 1rem;
    bottom: 1.1rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.btn-login {
    width: 100%;
    padding: 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

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

/* Main Container */
.main-container {
    display: none;
    min-height: 100vh;
}

/* Simple Header */
.header {
    background: var(--white);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header h1 i {
    color: var(--primary);
    font-size: 2rem;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.welcome-message {
    font-size: 1rem;
    color: var(--text-secondary);
}

.btn-logout {
    padding: 0.75rem 1.5rem;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #fecaca;
    transform: translateY(-1px);
}

/* Big Progress Section */
.progress-section {
    background: var(--white);
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    max-width: 1400px;
}

.progress-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.progress-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.progress-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stat-box {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.progress-bar-container {
    height: 40px;
    background: #f1f5f9;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--border);
}

.progress-bar-container::after {
    content: 'Ready to start learning!';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    border-radius: 20px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.progress-bar-fill:not(:empty) ~ .progress-bar-container::after {
    display: none;
}

/* Lesson Section Headers */
.section-header {
    max-width: 1400px;
    margin: 2rem auto 1rem;
    padding: 0 2rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Beginner-Friendly Lesson Cards */
.lessons-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.75rem;
    padding: 0 2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.lesson-card {
    background: var(--white);
    border: 3px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.lesson-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.lesson-card.completed {
    background: var(--success-bg);
    border-color: var(--success);
}

/* Big lesson numbers */
.lesson-number-big {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.lesson-card.completed .lesson-number-big {
    background: var(--success);
}

.lesson-content {
    padding: 1.75rem;
}

.lesson-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    padding-right: 60px; /* Space for number */
}

.lesson-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.lesson-info span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lesson-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Big, clear buttons */
.play-button {
    width: 100%;
    padding: 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.play-button:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.play-button i {
    font-size: 1.5rem;
}

.lesson-card.completed .play-button {
    background: var(--success);
}

.lesson-card.completed .play-button:hover {
    background: #16a34a;
}

/* Completed badge */
.completed-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--success);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.lesson-card.completed .completed-badge {
    display: flex;
}

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

.video-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1000px;
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.close-modal {
    width: 50px;
    height: 50px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 12px;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: #fecaca;
    transform: rotate(90deg);
}

#videoContainer {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

#videoContainer iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.mark-complete-btn {
    width: 100%;
    padding: 1.25rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mark-complete-btn:hover:not(:disabled) {
    background: #16a34a;
    transform: scale(1.02);
}

.mark-complete-btn:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Achievement Popup - More visible */
.achievement-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 3px solid var(--success);
    z-index: 2000;
    transition: transform 0.3s ease;
    max-width: 400px;
    text-align: center;
}

.achievement-popup.show {
    transform: translate(-50%, -50%) scale(1);
}

.achievement-popup h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 0.5rem;
}

.achievement-popup p {
    font-size: 1.1rem;
    color: var(--text-main);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    .lessons-container {
        grid-template-columns: 1fr;
        padding: 0 1rem 2rem;
    }
    
    .header-top {
        flex-direction: column;
        text-align: center;
    }
    
    .progress-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .video-modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}