/* ===== VARIABLES ===== */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --dark: #2d3748;
    --light: #f7fafc;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-green: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-orange: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-blue: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER ===== */
.main-header {
    background: var(--gradient);
    color: white;
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.main-header nav a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    transition: opacity 0.3s;
}

.main-header nav a:hover {
    opacity: 0.8;
}

/* ===== HERO ===== */
.hero {
    background: var(--gradient);
    color: white;
    padding: 150px 0 100px;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.progress-info {
    background: rgba(255,255,255,0.2);
    padding: 20px;
    border-radius: 15px;
    margin: 30px auto;
    max-width: 500px;
    backdrop-filter: blur(10px);
}

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-block;
    background: var(--gradient);
    color: white;
    padding: 15px 40px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    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-large {
    font-size: 1.2rem;
    padding: 20px 50px;
}

.btn-level {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--gradient);
    color: white;
}

.btn-level:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    color: #718096;
}

.btn-level:not(:disabled):hover {
    transform: scale(1.02);
}

.btn-success {
    background: var(--success);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-success:hover {
    background: #38a169;
}

/* ===== LEVELS SECTION ===== */
.levels-section {
    padding: 80px 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.section-subtitle {
    text-align: center;
    color: #718096;
    margin-bottom: 50px;
    font-size: 1.1rem;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.level-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    transition: all 0.3s;
    position: relative;
    border: 2px solid transparent;
}

.level-card:hover:not(.locked) {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.level-card.locked {
    opacity: 0.7;
    background: #f7fafc;
}

.level-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 2rem;
}

.level-card.completed {
    border-color: var(--success);
    background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%);
}

.level-card.completed::before {
    content: '✅';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 2rem;
}

.level-badge {
    display: inline-block;
    background: var(--gradient);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.level-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.level-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.level-topics {
    list-style: none;
    margin-bottom: 20px;
}

.level-topics li {
    padding: 8px 0;
    color: #4a5568;
    border-bottom: 1px solid #e2e8f0;
}

.level-topics li::before {
    content: '✓ ';
    color: var(--success);
    font-weight: bold;
}

.level-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #718096;
}

/* ===== FEATURES ===== */
.features-section {
    padding: 80px 0;
    background: var(--light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.feature-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.feature-box:hover {
    transform: translateY(-5px);
}

.feature-box .feature-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.feature-box h3 {
    margin-bottom: 15px;
    color: var(--dark);
}

/* ===== CONTACT ===== */
.contact-section {
    padding: 80px 0;
    background: white;
}

.contact-box {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 40px;
    background: var(--light);
    border-radius: 20px;
}

.contact-methods {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s;
}

.contact-btn.phone {
    background: var(--primary);
    color: white;
}

.contact-btn.whatsapp {
    background: #25d366;
    color: white;
}

.contact-btn:hover {
    transform: scale(1.05);
}

/* ===== FOOTER ===== */
.main-footer {
    background: var(--dark);
    color: white;
    padding: 40px 0;
    text-align: center;
}

.footer-links {
    margin-top: 20px;
}

.footer-links a {
    color: #a0aec0;
    text-decoration: none;
    margin: 0 15px;
}

.footer-links a:hover {
    color: white;
}

/* ===== LESSON PAGE STYLES ===== */
.lesson-header {
    background: var(--gradient);
    color: white;
    padding: 100px 0 50px;
}

.lesson-header.level1 { background: var(--gradient); }
.lesson-header.level2 { background: var(--gradient-orange); }
.lesson-header.level3 { background: var(--gradient-green); }
.lesson-header.level4 { background: var(--gradient-blue); }
.lesson-header.level5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }

.lesson-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.lesson-content {
    background: white;
    padding: 50px;
    border-radius: 20px;
    margin: -30px auto 50px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    max-width: 900px;
}

.lesson-content h2 {
    color: var(--primary);
    margin: 30px 0 15px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.lesson-content h3 {
    color: var(--secondary);
    margin: 25px 0 10px;
}

.lesson-content p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: #4a5568;
}

.lesson-content ul, .lesson-content ol {
    margin-right: 20px;
    margin-bottom: 20px;
    color: #4a5568;
}

.lesson-content li {
    margin-bottom: 10px;
}

.code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    direction: ltr;
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
}

.code-block .comment { color: #68d391; }
.code-block .keyword { color: #fc8181; }
.code-block .string { color: #fbd38d; }
.code-block .tag { color: #63b3ed; }

.quiz-section {
    background: var(--light);
    padding: 40px;
    border-radius: 20px;
    margin-top: 40px;
}

.quiz-question {
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border-right: 4px solid var(--primary);
}

.quiz-options label {
    display: block;
    padding: 15px;
    margin: 10px 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.quiz-options label:hover {
    border-color: var(--primary);
    background: #f7fafc;
}

.quiz-options input[type="radio"] {
    margin-left: 10px;
}

.quiz-options label.correct {
    border-color: var(--success);
    background: #f0fff4;
}

.quiz-options label.wrong {
    border-color: var(--danger);
    background: #fff5f5;
}

.quiz-result {
    text-align: center;
    padding: 30px;
    border-radius: 15px;
    margin-top: 20px;
    display: none;
}

.quiz-result.pass {
    background: #f0fff4;
    color: var(--success);
    display: block;
}

.quiz-result.fail {
    background: #fff5f5;
    color: var(--danger);
    display: block;
}

/* ===== PROGRESS BAR ===== */
.progress-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.progress-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    transition: width 0.5s;
}

/* ===== AD SPACES ===== */
.ad-space {
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    padding: 30px;
    text-align: center;
    margin: 30px 0;
    border-radius: 10px;
    color: #a0aec0;
}

/* ===== EXAM STYLES ===== */
.exam-header {
    color: white;
    padding: 100px 0 50px;
    text-align: center;
}

.exam-header.level1 { background: var(--gradient); }
.exam-header.level2 { background: var(--gradient-orange); }
.exam-header.level3 { background: var(--gradient-green); }
.exam-header.level4 { background: var(--gradient-blue); }

.exam-rules {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.exam-rules h3 {
    color: #856404;
    margin-bottom: 10px;
}

.timer {
    position: fixed;
    top: 100px;
    left: 20px;
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
    z-index: 100;
}

/* ===== CERTIFICATE ===== */
.certificate-container {
    background: white;
    padding: 60px;
    border-radius: 20px;
    text-align: center;
    max-width: 800px;
    margin: 50px auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    border: 10px solid transparent;
    border-image: var(--gradient) 1;
}

.certificate-title {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.certificate-recipient {
    font-size: 2rem;
    color: var(--dark);
    margin: 30px 0;
    font-weight: bold;
}

.certificate-text {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 30px;
}

.certificate-date {
    color: #718096;
    margin-top: 40px;
}

.seal {
    width: 150px;
    height: 150px;
    background: var(--gradient);
    border-radius: 50%;
    margin: 30px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .levels-grid {
        grid-template-columns: 1fr;
    }
    
    .lesson-content {
        padding: 25px;
    }
    
    .timer {
        position: relative;
        top: 0;
        left: 0;
        margin-bottom: 20px;
    }
    
    .certificate-container {
        padding: 30px;
    }
    
    .certificate-title {
        font-size: 2rem;
    }
}