/* ============================================================
   W3Teach - Main Stylesheet
   ============================================================ */

:root {
    --green: #04AA6D;
    --green-dark: #028b58;
    --green-light: #e8fff5;
    --dark: #1a1a2e;
    --gray: #6c757d;
    --border: #e0e0e0;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
    --font: 'Source Sans Pro', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    color: #333;
    line-height: 1.6;
    background: #fff;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.main-navbar {
    background: #282c34 !important;
    padding: 0 16px;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.logo-w3 {
    background: var(--green);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 800;
}
.logo-teach { color: white; font-weight: 700; }

.main-navbar .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 600;
    font-size: 14px;
    padding: 0.5rem 1rem !important;
    transition: color 0.2s;
}
.main-navbar .nav-link:hover { color: var(--green) !important; }

.navbar-search .form-control {
    border-radius: 4px 0 0 4px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    min-width: 200px;
}
.navbar-search .form-control::placeholder { color: rgba(255,255,255,0.5); }
.navbar-search .form-control:focus { background: rgba(255,255,255,0.15); box-shadow: none; border-color: var(--green); }
.btn-search {
    background: var(--green);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
}
.btn-search:hover { background: var(--green-dark); color: white; }
.btn-signup {
    background: var(--green);
    color: white;
    border-radius: 4px;
    padding: 6px 16px;
    font-weight: 600;
    border: none;
}
.btn-signup:hover { background: var(--green-dark); color: white; }

.mega-menu {
    min-width: 220px;
    border: 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
.mega-header {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
    background: var(--dark);
    padding: 60px 0;
}
.hero-title {
    color: white;
    font-size: 52px;
    font-weight: 900;
    line-height: 1.1;
}
.hero-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 22px;
}
.hero-search-group .form-control {
    border-radius: 4px 0 0 4px;
    font-size: 16px;
    border: 0;
    min-width: 400px;
    max-width: 500px;
}
.hero-tags .badge-tag {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    margin: 2px;
}
.hero-tags .badge-tag:hover { background: var(--green); color: white; }

/* ============================================================
   STATS SECTION
   ============================================================ */
.stats-section { background: #f8f9fa; }
.stat-card { padding: 16px; }
.stat-number { font-size: 28px; font-weight: 800; color: var(--green); }
.stat-label { font-size: 13px; color: #888; font-weight: 600; }

/* ============================================================
   COURSES SECTION
   ============================================================ */
.section-title { font-size: 28px; font-weight: 800; color: var(--dark); }
.course-card-link { text-decoration: none; display: block; }
.course-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    border: 1px solid var(--border);
}
.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
.course-icon {
    height: 80px;
    background: linear-gradient(135deg, var(--course-color), var(--course-color)cc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
}
.course-info { padding: 16px; }
.course-title { font-size: 16px; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
.course-desc { font-size: 12px; color: #888; margin-bottom: 12px; line-height: 1.5; }
.course-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #888; }
.btn-start { color: var(--green); font-weight: 700; font-size: 12px; }

/* ============================================================
   FEATURES SECTION
   ============================================================ */
.feature-box { padding: 32px 20px; }
.feature-icon { font-size: 40px; color: var(--green); margin-bottom: 16px; }
.feature-list { list-style: none; padding: 0; }
.feature-list li { padding: 4px 0; font-size: 15px; }

/* ============================================================
   EDITOR PREVIEW
   ============================================================ */
.editor-preview-box {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    background: #282c34;
}
.editor-header {
    background: #3c4049;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.editor-code {
    padding: 24px;
    color: #abb2bf;
    font-size: 14px;
    font-family: 'Fira Code', 'Consolas', monospace;
    line-height: 1.8;
    margin: 0;
}
.editor-code .kw { color: #e06c75; }
.editor-code .prop { color: #61dafb; }
.editor-code .attr { color: #98c379; }
.editor-code .val { color: #e5c07b; }

/* ============================================================
   CERT SECTION
   ============================================================ */
.cert-step { margin: 8px; }
.step-no { width: 48px; height: 48px; background: rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; margin: 0 auto 8px; }
.step-text { font-weight: 600; opacity: 0.9; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: #1a1a2e; margin-top: auto; }
.footer-top { border-bottom: 1px solid rgba(255,255,255,0.08); }
.footer-brand { font-size: 22px; font-weight: 800; color: white; }
.footer-heading { font-weight: 700; color: white; font-size: 14px; letter-spacing: 0.5px; margin-bottom: 12px; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.footer-links a:hover { color: var(--green); }
.contact-list li { color: rgba(255,255,255,0.6); font-size: 14px; margin-bottom: 8px; }
.social-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.1); color: white; text-decoration: none; margin-right: 6px; transition: background 0.2s; font-size: 14px; }
.social-btn:hover { background: var(--green); color: white; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); }
.footer-bottom a { text-decoration: none; }
.footer-bottom a:hover { color: var(--green) !important; }

/* ============================================================
   COURSE HERO
   ============================================================ */
.course-hero { padding: 20px 0; }
.course-hero-icon { width: 64px; height: 64px; background: rgba(255,255,255,0.2); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 32px; color: white; }
.course-hero-title { color: white; font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.btn-white { background: white; color: #333; font-weight: 700; }
.btn-white:hover { background: #f0f0f0; }

/* ============================================================
   LESSON SIDEBAR
   ============================================================ */
.sidebar-lesson-link {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.sidebar-lesson-link:hover {
    background: var(--green-light);
    color: var(--green-dark);
    border-left-color: var(--green);
}
.sidebar-lesson-link.active {
    background: var(--green-light);
    color: var(--green-dark);
    font-weight: 700;
    border-left-color: var(--green);
}
.sidebar-lesson-link.read { color: #04AA6D; }
.sidebar-lesson-link.read i { color: var(--green); }

/* ============================================================
   LESSON CONTENT
   ============================================================ */
.lesson-header { border-bottom: 1px solid var(--border); }
.lesson-title { font-size: 28px; font-weight: 800; color: var(--dark); margin-top: 4px; }
.lesson-text h2 { font-size: 22px; font-weight: 700; margin-top: 28px; margin-bottom: 12px; color: var(--dark); }
.lesson-text h3 { font-size: 18px; font-weight: 700; margin-top: 24px; margin-bottom: 10px; }
.lesson-text p { margin-bottom: 14px; line-height: 1.7; }
.lesson-text code { background: #f4f4f4; padding: 2px 6px; border-radius: 3px; font-family: 'Fira Code', Consolas, monospace; font-size: 13px; color: #c0392b; }
.lesson-text ul, .lesson-text ol { margin-bottom: 14px; padding-left: 24px; }
.lesson-text li { margin-bottom: 4px; }
.lesson-text .note { background: #e8f4fd; border-left: 4px solid #3498db; padding: 12px 16px; border-radius: 0 6px 6px 0; margin: 16px 0; }

/* Code Example Box */
.code-example-box {
    background: #1e2127;
    border-radius: 8px;
    overflow: hidden;
}
.example-header {
    background: #282c34;
    color: #abb2bf;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
}
.code-content { padding: 0; }
.code-pre {
    margin: 0;
    padding: 16px;
    color: #abb2bf;
    font-family: 'Fira Code', Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    overflow-x: auto;
    max-height: 350px;
}
.example-result-bar {
    background: #04AA6D;
    color: white;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    user-select: none;
}
.example-result-bar:hover { background: var(--green-dark); }
.example-result-preview { border-top: 2px solid var(--green); background: white; }

/* Navigation Buttons */
.lesson-nav { border-top: 1px solid var(--border); padding-top: 20px; }
.btn-nav { font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Quiz CTA */
.quiz-cta-box {
    background: linear-gradient(135deg, var(--green-light), #fff);
    border: 1px solid var(--green);
    border-radius: 10px;
    padding: 20px;
}

/* ============================================================
   COURSE LISTING
   ============================================================ */
.course-icon-sm {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.lesson-link { text-decoration: none; color: #555; }
.lesson-link:hover { color: var(--green); }
.lesson-read { color: var(--green); }

/* ============================================================
   EXAM STYLES
   ============================================================ */
.badge-filter {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: #666;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}
.badge-filter:hover, .badge-filter.active {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

.exam-card { background: white; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); height: 100%; transition: transform 0.2s; border: 1px solid var(--border); }
.exam-card:hover { transform: translateY(-3px); }
.exam-card-header { padding: 20px; position: relative; }
.exam-card-body { padding: 16px; }
.exam-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.exam-meta-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #666; }

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-hero {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 32px 0;
}
.profile-avatar-wrapper { position: relative; }
.profile-role-badge { position: absolute; bottom: 0; right: 0; font-size: 10px; }
.info-stat { padding: 16px; }
.stat-big { font-size: 36px; font-weight: 800; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-card { max-width: 430px; margin: 80px auto; }

/* ============================================================
   PAGE HEADER SECTIONS
   ============================================================ */
.page-header-section { position: relative; overflow: hidden; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fadeInUp 0.4s ease; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-success { color: var(--green) !important; }
.bg-success { background-color: var(--green) !important; }
.btn-success { background-color: var(--green) !important; border-color: var(--green) !important; }
.btn-success:hover { background-color: var(--green-dark) !important; border-color: var(--green-dark) !important; }
.btn-outline-success { color: var(--green) !important; border-color: var(--green) !important; }
.btn-outline-success:hover { background: var(--green) !important; color: white !important; }
.border-success { border-color: var(--green) !important; }

/* Alert fixes */
.alert-success { background-color: var(--green-light); border-color: var(--green); color: var(--green-dark); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .hero-title { font-size: 32px; }
    .hero-search-group .form-control { min-width: unset; }
    .lesson-title { font-size: 20px; }
    .cert-border { padding: 20px; }
}

@media (max-width: 576px) {
    .hero-section { padding: 40px 0; }
    .stat-number { font-size: 22px; }
}
