/* --- GLOBAL THEME --- */
:root {
    --bg-dark: #0f172a;
    --bg-light: #f9fafb;
    --text-light: #f8fafc;
    --text-dim: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #6366f1;
    --accent: #f59e0b;
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #f59e0b;
    --accent-color: #10b981;
    --text-primary: #111827; /* Darker for better contrast */
    --text-secondary: #4b5563; /* Darker gray for better contrast */
    --text-light: #9ca3af;
    --background: #ffffff;
    --background-light: #f9fafb;
    --background-dark: #f3f4f6;
    --border-color: #d1d5db; /* Darker border for visibility */
    --border-light: #e5e7eb;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding-top: 80px; /* Space for fixed navbar */
}


/* --- BACKGROUND ANIMATION --- */
.background-wrap {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite alternate;
}

.shape-1 {
    top: -10%; left: -10%; width: 500px; height: 500px;
    background: radial-gradient(circle, #4338ca 0%, transparent 70%);
}
.shape-2 {
    bottom: 10%; right: -10%; width: 600px; height: 600px;
    background: radial-gradient(circle, #be185d 0%, transparent 70%);
    animation-delay: -5s;
}
.shape-3 {
    top: 40%; left: 40%; width: 300px; height: 300px;
    background: radial-gradient(circle, #059669 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.navbar {
    position: fixed; top: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: #ffffff;
    box-shadow: var(--shadow-md);
    border-bottom-color: var(--border-color);
}

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

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

/* Wrapper for Links & Buttons */
.nav-menu-wrapper {
    display: flex; align-items: center; gap: 2rem;
}

/* Links */
.nav-links {
    display: flex; list-style: none; gap: 2rem; align-items: center; margin: 0;
}

.nav-link {
    text-decoration: none; color: var(--text-primary);
    font-weight: 500; font-size: 1rem;
    transition: color 0.3s ease; position: relative;
}

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

/* --- BUTTONS (Login & Trial) --- */
.nav-actions {
    display: flex; align-items: center; gap: 1rem;
}

/* Кнопка Входу (прозора) */
.btn-login {
    text-decoration: none; color: var(--text-primary);
    font-weight: 600; font-size: 0.95rem;
    padding: 0.5rem 1rem; border-radius: 6px;
    transition: 0.2s;
}
.btn-login:hover { color: var(--primary); background: #eff6ff; }

/* Кнопка Пробного уроку (акцентна) */
.btn-trial {
    text-decoration: none; background: var(--primary);
    color: white; font-weight: 600; font-size: 0.95rem;
    padding: 0.6rem 1.2rem; border-radius: 100px;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    transition: all 0.3s ease;
}
.btn-trial:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

/* --- Dropdown --- */
.dropdown { position: relative; }
.dropdown-toggle { display: flex; align-items: center; gap: 4px; }
.dropdown-toggle i { font-size: 0.75rem; transition: 0.3s; }
.dropdown:hover .dropdown-toggle i { transform: rotate(180deg); }

.dropdown-menu {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(10px);
    background: white; border-radius: 10px;
    box-shadow: var(--shadow-xl); border: 1px solid var(--border-color);
    padding: 0.5rem; min-width: 200px;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
    padding-top: 10px; /* Відступ, щоб курсор не губився */
}
.dropdown:hover .dropdown-menu {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.dropdown-link {
    display: block; padding: 10px 15px; border-radius: 6px;
    color: var(--text-primary); text-decoration: none; font-weight: 500;
}
.dropdown-link:hover { background: #f3f4f6; color: var(--primary-color); }

/* --- HAMBURGER (Mobile Icon) --- */
.hamburger {
    display: none; cursor: pointer; background: none; border: none; padding: 5px;
}
.hamburger span {
    display: block; width: 25px; height: 3px; margin: 5px 0;
    background: var(--text-primary); border-radius: 3px; transition: 0.3s;
}
/* Анімація хрестика */
.hamburger.active span:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }

/* --- RESPONSIVE (Mobile) --- */
@media (max-width: 968px) {
    .hamburger { display: block; }

    .nav-menu-wrapper {
        position: fixed; top: 70px; left: -100%;
        width: 100%; height: calc(100vh - 70px);
        background: white;
        flex-direction: column; align-items: center; justify-content: start;
        padding-top: 40px; gap: 30px;
        transition: 0.4s ease;
        border-top: 1px solid var(--border-color);
    }

    .nav-menu-wrapper.active { left: 0; }
    
    .nav-links { flex-direction: column; gap: 20px; font-size: 1.2rem; }
    .nav-actions { flex-direction: column; width: 100%; padding: 0 20px; }
    .btn-login, .btn-trial { width: 100%; text-align: center; padding: 12px; }
    
    /* Dropdown на мобільному */
    .dropdown-menu {
        position: static; opacity: 1; visibility: visible;
        transform: none; box-shadow: none; border: none;
        background: #f9fafb; display: none; margin-top: 10px;
    }
    .dropdown.active .dropdown-menu { display: block; }
}

/* --- HEADER --- */
.pricing-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.pricing-header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease-out;
}

.badge-pill {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.pricing-header h1 {
    font-size: 3.5rem;
    margin: 20px 0;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pricing-header p {
    font-size: 1.2rem;
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto;
}

/* --- TOGGLE (Month Selector) --- */
.toggle-container {
    margin-top: 40px;
    display: inline-block;
    padding: 5px;
    background: rgba(255,255,255,0.05);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.duration-options {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.dur-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    position: relative;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dur-btn:hover { color: white; background: rgba(255,255,255,0.05); }

.dur-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.discount-tag {
    font-size: 0.7rem;
    background: rgba(255,255,255,0.15);
    padding: 2px 6px;
    border-radius: 4px;
}

.discount-tag.fire {
    background: #f59e0b;
    color: black;
    font-weight: 800;
}

/* --- CARDS GRID --- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    perspective: 1000px;
}

/* --- CARD DESIGN --- */
.price-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.price-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* Popular Ribbon */
.popular-ribbon {
    position: absolute;
    top: 20px; right: -30px;
    background: var(--accent);
    color: #000;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 5px 30px;
    transform: rotate(45deg);
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

/* Card Header */
.pc-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.pc-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.pc-info h3 { margin: 0; font-size: 1.3rem; }
.pc-info span { font-size: 0.85rem; color: var(--text-dim); }

/* Price Area */
.pc-price-area {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.final-price {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.price-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.old-price {
    text-decoration: line-through;
    opacity: 0.6;
}

.save-badge {
    color: #4ade80;
    font-weight: 700;
    background: rgba(74, 222, 128, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Features */
.pc-features {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    flex-grow: 1;
}

.pc-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #e2e8f0;
    font-size: 0.95rem;
}

.pc-features li i {
    color: var(--primary);
    font-size: 1rem;
}

/* Button */
.pc-btn {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.pc-btn:hover {
    background: white;
    color: black;
    transform: scale(1.02);
}

.pc-btn.glow {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}
.pc-btn.glow:hover {
    background: #4f46e5;
    color: white;
}

/* Footer Trust */
.trust-footer {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 60px;
    flex-wrap: wrap;
    color: var(--text-dim);
    font-size: 0.9rem;
}
.trust-item { display: flex; align-items: center; gap: 8px; }
/* --- ВАЖЛИВО: Z-INDEX FIX --- */
/* Піднімаємо контент над анімованим фоном, щоб кнопки працювали */
.pricing-wrapper {
    position: relative;
    z-index: 10; 
}

/* --- SELECTED CARD STATE --- */
.price-card.selected-card {
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.9); /* Трохи темніший фон */
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3); /* "Glow" рамка */
    transform: scale(1.02);
}

.price-card {
    cursor: pointer; /* Курсор руки, щоб видно було, що можна клікати */
}

/* Стиль для популярної картки (автоматичний glow) */
.price-card.popular-card {
    border-color: rgba(245, 158, 11, 0.5); /* Жовтуватий відтінок */
}

.price-card.popular-card:hover {
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.2);
}

/* Оновлення кнопки */
.pc-btn {
    display: block; /* Щоб займала всю ширину */
    margin-top: auto; /* Притиснути до низу */
}
/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.animate-card { animation: slideUp 0.6s ease-out forwards; opacity: 0; }
.animate-card:nth-child(1) { animation-delay: 0.1s; }
.animate-card:nth-child(2) { animation-delay: 0.2s; }
.animate-card:nth-child(3) { animation-delay: 0.3s; }

/* Mobile */
@media (max-width: 768px) {
    .pricing-header h1 { font-size: 2.5rem; }
    .duration-options { flex-direction: column; width: 100%; }
    .dur-btn { width: 100%; justify-content: center; }
}
/* --- TEXTURE GRID (Сітка) --- */
.bg-grid {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* --- PARTICLES (Частинки) --- */
#particles-js {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden;
    z-index: 0; /* Над плямами, але під контентом */
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: white;
    opacity: 0.3;
    animation: floatUp linear infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
        transform: translateY(90vh) scale(1);
    }
    90% {
        opacity: 0.5;
        transform: translateY(10vh) scale(1);
    }
    100% {
        transform: translateY(-10vh) scale(0);
        opacity: 0;
    }
}

/* Оновлення для плям, щоб вони рухались плавно */
.floating-shape {
    transition: transform 0.2s ease-out; /* Плавність руху за мишкою */
    will-change: transform;
}
@media (max-width: 900px) {
    .desktop-only { display: none; }
    .hamburger { display: flex; }
    .pricing-header h1 { font-size: 2rem; }
    .duration-selector { flex-direction: column; width: 100%; }
    .dur-btn { width: 100%; }
}

/* --- Subject Tabs Styling --- */
.subject-tabs-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.subject-tabs {
    display: inline-flex;
    background: white;
    padding: 6px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    gap: 5px;
}

.tab-btn {
    padding: 10px 24px;
    border: none;
    background: transparent;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: #1f2937;
}

.tab-btn.active {
    background: #6366f1; /* Primary Color */
    color: white;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.tab-btn i {
    font-size: 1.1em;
}

/* --- Card Updates --- */
.price-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Розтягуємо контент */
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #6366f1;
    margin-bottom: 5px;
}

.plan-duration {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

.old-price {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 1rem;
    display: block;
}

.save-badge {
    background: #ecfdf5;
    color: #059669;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
    margin-top: 5px;
}

/* Mobile Tabs Adaption */
@media (max-width: 600px) {
    .subject-tabs {
        flex-direction: column;
        width: 100%;
        border-radius: 16px;
    }
    .tab-btn {
        width: 100%;
        justify-content: center;
    }
}

.discount-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

.old-price {
    text-decoration: line-through;
    color: #9ca3af; /* Сірий колір */
    font-size: 1.1rem;
    font-weight: 500;
}

.discount-badge {
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

/* Оновлення для ціни */
.pc-price-area {
    margin: 20px 0;
    text-align: center;
    min-height: 100px; /* Фіксуємо висоту, щоб картки були рівними */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.final-price {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

/* Якщо знижки немає, додаємо відступ, щоб вирівняти з іншими картками */
.final-price:only-child {
    margin-bottom: 25px; 
}
.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-top: 5px;
    margin-bottom: 15px;
    font-size: 1rem;
}
.form-group{
    margin-bottom:0px;
}
.form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.btn-primary {
    background: #6366f1; 
    color: white; 
    padding: 15px; 
    border: none; 
    border-radius: 8px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: 0.2s;
    font-size: 1.1rem;
}
.btn-primary:hover { 
    background: #4f46e5; 
}

@media (max-width: 768px) {
    .booking-layout { 
        grid-template-columns: 1fr !important; /* На мобільному - одна колонка */
        gap: 20px !important;
    }
    /* Змінюємо порядок: спочатку форма, потім інфо (опціонально) */
    /* .booking-info { order: 2; } */
}

.tab-btn.unavailable {
    opacity: 0.6;              /* Робимо напівпрозорою */
    cursor: not-allowed;       /* Курсор у вигляді перекресленого кола */
    background-color: #f3f4f6; /* Легкий сірий фон */
    color: #9ca3af;            /* Сірий текст */
    border: 1px dashed #d1d5db; /* Пунктирна рамка */
}

/* Прибираємо ефект наведення для недоступних */
.tab-btn.unavailable:hover {
    color: #9ca3af;
    background-color: #f3f4f6;
    box-shadow: none;
    transform: none;
}

/* Бейдж "Скоро" всередині кнопки */
.soon-badge {
    background-color: #ef4444; /* Червоний (або #f59e0b помаранчевий) */
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    text-transform: uppercase;
    vertical-align: super; /* Трохи піднімає текст вгору */
}