/* =========================================
   1. RESET & VARIABLES
   ========================================= */
* {
    margin: 0; padding: 0; box-sizing: border-box;
}

:root {
    --bg-page: #f8fafc;
    --bg-white: #ffffff;
    --text-main: #0f172a;
    --text-sec: #64748b;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    padding-top: 80px; /* Space for fixed navbar */
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; }

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

/* =========================================
   2. NAVBAR STYLES
   ========================================= */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: 80px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-logo {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 1.4rem; font-weight: 800; color: var(--primary);
    text-decoration: none;
}
.nav-logo i { color: var(--primary); }

/* Desktop Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-links {
    display: flex; gap: 30px;
}

.nav-link {
    color: var(--text-sec);
    font-weight: 500;
    transition: color 0.2s;
}
.nav-link:hover { color: var(--primary); }

.nav-actions {
    display: flex; align-items: center; gap: 15px;
}

.btn-login {
    color: var(--text-sec);
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: 0.2s;
}
.btn-login:hover { color: var(--primary); border-color: var(--primary); }

.btn-trial {
    background: var(--primary);
    color: white;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-trial:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* Hamburger */
.hamburger {
    display: none; /* Hidden on Desktop */
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 1100;
}
.hamburger span {
    width: 25px; height: 3px;
    background: var(--text-main);
    border-radius: 2px;
    transition: 0.3s;
}

/* =========================================
   3. HERO SECTION
   ========================================= */
.hero-section {
    background: var(--bg-white);
    padding: 60px 0;
    border-bottom: 1px solid var(--border);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    align-items: center;
}

/* Badge */
.badges-row .badge {
    background: #e0e7ff;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.hero-title {
    font-size: 2.5rem;
    margin: 20px 0;
    line-height: 1.2;
    color: var(--text-main);
}

.hero-desc {
    font-size: 1.125rem;
    color: var(--text-sec);
    margin-bottom: 30px;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    gap: 25px;
    margin-bottom: 35px;
    color: var(--text-sec);
    font-size: 0.95rem;
    flex-wrap: wrap;
}
.stat-item i { color: var(--primary); margin-right: 5px; }

/* Desktop CTA */
.hero-cta { display: flex; align-items: center; gap: 20px; }

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }

.price-box { display: flex; flex-direction: column; }
.price-val { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.price-label { font-size: 0.8rem; color: var(--text-sec); }

/* Video Card */
.media-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.15);
    aspect-ratio: 16/9;
    background: #000;
}
.media-card img {
    width: 100%; height: 100%; object-fit: cover; opacity: 0.8;
}
.play-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.1);
    transition: 0.3s;
}
.media-card:hover .play-overlay { background: rgba(0,0,0,0.3); }

.play-btn {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: white;
    border: none;
    color: var(--primary);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: 0.3s;
}
.play-btn:hover { transform: scale(1.1); }

/* =========================================
   4. CONTENT SECTIONS
   ========================================= */
.section-container { padding: 80px 0; }
.bg-white { background: var(--bg-white); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: 2rem; margin-bottom: 40px; color: var(--text-main); }

/* Accordion */
.accordion-list {
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-white);
}
.accordion-list p{
    color: #666;
}
.module-item { border-bottom: 1px solid var(--border); }
.module-item:last-child { border-bottom: none; }

.module-header {
    padding: 20px;
    cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; font-size: 1.1rem;
    background: var(--bg-white);
    transition: 0.2s;
}
.module-header:hover { background: #f8fafc; color: var(--primary); }

.module-content {
    display: none;
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
}
.module-item.active .module-content { display: block; }
.module-item.active .module-header i { transform: rotate(180deg); }

.module-content li {
    padding: 8px 0; color: var(--text-sec); display: flex; align-items: center; gap: 10px;
}
.module-content li i { color: var(--primary); font-size: 0.9rem; }

/* Grid Cards */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.teacher-card, .review-card {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.teacher-card { display: flex; align-items: center; gap: 20px; }
.teacher-img { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; }

.review-card p { font-style: italic; color: var(--text-sec); }
.review-header { display: flex; justify-content: space-between; margin-bottom: 15px; font-weight: 700; }

/* =========================================
   5. MOBILE RESPONSIVE
   ========================================= */
.mobile-only { display: none; }


/* =========================================
   🎓 CURRICULUM TIMELINE
   ========================================= */
.timeline-wrapper {
    position: relative;
    padding-left: 40px; /* Місце для лінії */
    margin-top: 40px;
}

/* Вертикальна лінія */
.timeline-wrapper::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 15px; /* Центр крапки */
    width: 2px;
    background: #e2e8f0;
    z-index: 0;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

/* Крапка на лінії */
.timeline-dot {
    position: absolute;
    left: -41px; top: 20px;
    width: 32px; height: 32px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    font-weight: 700; font-size: 0.9rem;
    z-index: 1;
    box-shadow: 0 0 0 4px #f8fafc; /* Відступ від лінії */
}

/* Картка модуля */
.timeline-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.timeline-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.timeline-header {
    padding: 20px 25px;
    cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 700; font-size: 1.1rem; color: var(--text-main);
}

.timeline-header i {
    color: var(--text-sec);
    transition: transform 0.3s;
}

/* Accordion Content */
.timeline-content {
    display: none;
    padding: 0 25px 25px;
    border-top: 1px dashed var(--border);
    background: #ffffff;
}

.timeline-item.active .timeline-content { display: block; animation: fadeIn 0.4s; }
.timeline-item.active .timeline-header i { transform: rotate(180deg); color: var(--primary); }
.timeline-item.active .timeline-dot { background: var(--primary); color: white; }

.lesson-list { list-style: none; margin-top: 15px; }
.lesson-list li {
    padding: 8px 0;
    color: var(--text-sec);
    display: flex; align-items: center; gap: 12px;
    font-size: 0.95rem;
}
.lesson-list li::before {
    content: '\f04b'; /* Play icon unicode */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 0.7rem;
    color: var(--primary);
    background: #e0e7ff;
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}

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


/* =========================================
   💬 REVIEWS INFINITE SCROLL (FIXED)
   ========================================= */

/* Маска, щоб приховати краї */
.reviews-marquee-mask {
    overflow: hidden;
    position: relative;
    width: 100%;
    padding: 20px 0;
    /* Градієнт по краях */
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

/* Трек, який рухається */
.reviews-track {
    display: flex;
    gap: 30px; /* Відступ між картками */
    width: max-content; /* ВАЖЛИВО: Розтягує блок на всю ширину контенту */
    animation: scroll 40s linear infinite;
}

/* Зупинка при наведенні */
.reviews-track:hover {
    animation-play-state: paused;
}

/* Анімація руху */
@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Рухаємось на половину (бо ми дублюємо контент) */
}

/* Сама картка */
.review-card-scroll {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 25px;
    width: 350px; /* Фіксована ширина */
    flex-shrink: 0; /* Не стискати */
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    white-space: normal; /* Текст всередині переноситься */
}

.rc-header {
    display: flex; align-items: center; gap: 12px; margin-bottom: 15px;
}

.rc-avatar {
    width: 40px; height: 40px;
    background: #e0e7ff; color: #6366f1;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}

.rc-name { font-weight: 700; color: #0f172a; display: block; line-height: 1.2; }
.rc-stars { color: #f59e0b; font-size: 0.8rem; }
.rc-text { font-size: 0.95rem; color: #64748b; line-height: 1.6; font-style: italic; }
/* --- LAYOUT GRID --- */
.course-page-wrapper {
    background: #ffffff; /* Верхня частина біла */
    padding-bottom: 60px;
}

/* Головний фокус: Чорний хедер (Udemy style) або просто чистий */
.course-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Контент 66%, Сайдбар 33% */
    gap: 40px;
    padding-top: 40px;
    position: relative;
}

/* --- LEFT COLUMN --- */
.course-header-text h1 {
    font-size: 2.5rem; margin: 15px 0; color: var(--text-main); line-height: 1.2;
}
.hero-desc { font-size: 1.1rem; color: var(--text-main); margin-bottom: 20px; }

/* Learning Outcomes Box */
.learning-outcomes {
    border: 1px solid var(--border);
    padding: 25px;
    margin: 30px 0;
    border-radius: 8px;
    background: #f8fafc;
}
.learning-outcomes h3 { margin-bottom: 20px; font-size: 1.4rem; }
.outcomes-list {
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px; list-style: none;
}
.outcomes-list li {
    display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; color: var(--text-sec);
}
.outcomes-list li i { color: var(--text-main); margin-top: 3px; }

/* Sections */
.section-block { margin-bottom: 50px; }
.section-title { font-size: 1.5rem; margin-bottom: 20px; font-weight: 700; }

/* FAQ */
details {
    border: 1px solid var(--border); margin-bottom: 10px; border-radius: 8px; padding: 15px; cursor: pointer; transition: 0.2s;
}
details[open] { background: #f8fafc; }
summary { font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::after { content: '+'; font-size: 1.2rem; }
details[open] summary::after { content: '-'; }
details p { margin-top: 10px; color: var(--text-sec); line-height: 1.5; }

/* --- RIGHT COLUMN (STICKY SIDEBAR) --- */
.course-sidebar {
    position: relative;
    z-index: 10;
}

.sidebar-card {
    background: white;
    border: 1px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 8px;
    position: sticky;
    top: 100px; /* Відступ від верху при скролі */
    overflow: hidden;
}

.sidebar-media {
    position: relative; cursor: pointer; aspect-ratio: 16/9;
}
.sidebar-media img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-media .play-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center;
}
.sidebar-media .play-overlay i {
    font-size: 3rem; color: white; opacity: 0.9; transition: 0.2s;
}
.sidebar-media:hover .play-overlay { background: rgba(0,0,0,0.4); }

.sidebar-body { padding: 20px; }

.price-row { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.price-row div{
    display: flex; flex-direction: column; align-items: flex-start;
}
.discount-row {
    display: flex; align-items: center; gap: 10px; margin-bottom: 5px;}

.current-price { font-size: 2rem; font-weight: 800; color: var(--text-main); }
.original-price { text-decoration: line-through; color: var(--text-sec); }

.btn-sidebar-buy {
    width: 100%; padding: 14px; background: var(--primary); color: white;
    border: none; font-weight: 700; font-size: 1.1rem; cursor: pointer;
    transition: 0.2s;
}
.btn-sidebar-buy:hover { background: var(--primary-hover); }

.guarantee-text { text-align: center; font-size: 0.8rem; color: var(--text-sec); margin-top: 10px; }

.sidebar-features { margin-top: 20px; }
.sidebar-features ul { list-style: none; margin-top: 10px; }
.sidebar-features li {
    padding: 8px 0; font-size: 0.9rem; color: var(--text-main); display: flex; gap: 10px;
}
.sidebar-features i { width: 20px; text-align: center; color: var(--text-sec); }

/* --- RESPONSIVE --- */
@media (max-width: 968px) {
    /* Navbar Changes */
    .hamburger { display: flex; }
    
    .nav-menu {
        position: fixed;
        top: 0; right: -100%; /* Hidden Right */
        width: 100%; height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        flex-direction: column; justify-content: center;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        padding-bottom: 80px; /* Space for sticky bar */
    }
    
    .nav-menu.active { right: 0; }
    
    .nav-links { flex-direction: column; font-size: 1.4rem; gap: 30px; }
    .nav-actions { flex-direction: column; margin-top: 40px; width: 100%; }
    
    /* Hamburger Animation */
    .hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* Hero Changes */
    .hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
    .hero-media { order: -1; }
    .hero-stats { justify-content: center; }
    .hero-cta.desktop-only { display: none; }

    /* Sticky Footer */
    .mobile-only { display: flex; }
    .sticky-bar {
        position: fixed; bottom: 0; left: 0; width: 100%;
        background: var(--bg-white); padding: 15px 20px;
        border-top: 1px solid var(--border);
        justify-content: space-between; align-items: center;
        z-index: 2000;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    }
    .sticky-price { font-size: 1.4rem; font-weight: 800; color: var(--text-main); }
    .btn-primary.small { padding: 12px 24px; font-size: 1rem; }
    
    /* Content Padding */
    .main-content { padding-bottom: 80px; }
}
/* --- 1. GLOBAL HIDE (Ховаємо на ПК за замовчуванням) --- */
.mobile-only-flex {
    display: none !important;
}

/* --- 2. STICKY BAR STYLES (Базові стилі) --- */
.sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    padding: 15px 20px;
    border-top: 1px solid #e2e8f0;
    z-index: 2000; /* Поверх усього */
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

.sticky-info {
    display: flex;
    flex-direction: column;
}

.sticky-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.sticky-label {
    font-size: 0.8rem;
    color: #64748b;
}

/* Стиль маленької кнопки */
.btn-main.small {
    padding: 10px 24px;
    font-size: 1rem;
    border-radius: 8px;
    background: #6366f1;
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

/* --- 3. MOBILE QUERY (Показуємо тільки тут) --- */
@media (max-width: 968px) {
    
    /* Показуємо блок і вмикаємо Flex */
    .mobile-only-flex {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
    }

    /* Додаємо відступ знизу сторінки, щоб бар не перекривав контент */
    body {
        padding-bottom: 90px; /* Висота бару + відступ */
    }

    /* Ховаємо сайдбар на мобільному (він дублює цей бар) */
    .course-sidebar {
        display: block !important;
    
    }
    
    /* Робимо грід на одну колонку */
    .course-layout {
        grid-template-columns: 1fr;
    }
}
.discount-pill {
    background: #ef4444; /* Червоний колір знижки */
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse-red 2s infinite;
}

.original-price-strike {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
}

.current-price small {
    vertical-align: middle;
}

/* Легка анімація для привернення уваги */
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.mobile-sticky-bar {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: white; padding: 15px 20px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
    z-index: 1000; display: none; /* JS покаже на мобільних */
    justify-content: space-between; align-items: center;
    padding: 0 100px;
}
@media (max-width: 768px) {
    .mobile-sticky-bar { display: flex; }
    body { padding-bottom: 80px; } /* Щоб контент не перекривався */
}

.breadcrumbs { padding: 15px 0; font-size: 0.9rem; color: #6b7280; }
.breadcrumbs a { color: #4F46E5; text-decoration: none; }
.breadcrumbs span { margin: 0 5px; }

.itemtype{
    list-style: none; 
    padding: 0; 
    display: flex;
}
.span_title{
    color: #374151;
}
.fa-star{
    color: orange;
}

.course-anchor-nav{
    margin: 20px 0; 
    border-bottom: 1px solid #e5e7eb; 
    padding-bottom: 10px;
}

.course-anchor-nav a{
    margin-right: 15px; 
    text-decoration: none; 
    color: #4F46E5; 
    font-weight: 600;
}