/* =========================================
   PAGEWORM OFFICIAL STYLESHEET (Final Bug-Free Version)
   Fixed: Ghost Menu Scroll, Tablet Overlap, 120fps Animation
   ========================================= */

/* 1. CORE VARIABLES & RESET
   ========================================= */
:root {
    /* Brand Colors */
    --primary: #4F46E5;       /* Indigo */
    --primary-dark: #4338ca;  /* Darker Indigo */
    --accent: #F59E0B;        /* Amber (Badges) */
    
    /* Text & Backgrounds */
    --text-main: #1E293B;     /* Dark Slate */
    --text-light: #64748B;    /* Cool Grey */
    --bg-body: #F8FAFC;       /* Off-White Background */
    --white: #FFFFFF;
    
    /* Animation & Effects */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Pro Smoothness */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent; /* No blue tap box on mobile */
}

/* CRITICAL FIX: Stops the "Right Swipe" Ghost Menu Bug */
html, body {
    width: 100%;
    overflow-x: hidden; /* Strictly cuts off anything outside screen width */
    scroll-behavior: smooth;
    position: relative;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* Global Container */
.container {
    width: 90%; 
    max-width: 1200px;
    margin: 0 auto;
}

/* 2. HEADER & NAVIGATION
   ========================================= */
.header {
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px); /* Glass Effect */
    position: sticky;
    top: 0;
    z-index: 1000; /* Header Layer */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

.logo img {
    height: 35px;
    margin-right: 8px;
}

/* 3. MOBILE MENU (Default State)
   ========================================= */
.nav-links {
    position: fixed;
    top: 0; 
    right: 0;
    height: 100vh;
    width: 75%; /* Drawer Width */
    background: var(--white);
    
    /* Vertical Centering */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    
    /* Animation & Logic */
    transform: translateX(100%); /* Hidden by default */
    
    /* FIX: Visibility ensure it's "Gone" when closed so you can't scroll to it */
    visibility: hidden; 
    
    /* Transition: Delay visibility so it doesn't disappear before sliding out */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
    will-change: transform; 
    
    /* Layering */
    z-index: 1001; 
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}

.nav-links.nav-active {
    transform: translateX(0%); /* Slide In */
    visibility: visible; /* Make visible immediately */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

.nav-links li a {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-main);
}

/* Hide Desktop Button on Mobile/Tablet */
.header-actions .btn-primary {
    display: none; 
}

/* Hamburger Icon */
.hamburger {
    display: block;
    font-size: 1.8rem;
    color: var(--text-main);
    cursor: pointer;
    z-index: 1002; /* Always clickable */
}

/* 4. OVERLAY (Dark Background)
   ========================================= */
.menu-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999; /* Below Header */
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(3px);
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 5. HERO SECTION
   ========================================= */
.hero-section {
    padding: 60px 0 40px;
    text-align: center;
}

.hero-content {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 30px;
}

.hero-image img {
    width: 70%; 
    max-width: 400px;
    margin: 0 auto;
    animation: float 4s ease-in-out infinite;
}

.hero-text h1 {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 15px;
}

.hero-text p {
    color: var(--text-light);
    margin-bottom: 25px;
    font-size: 1rem;
}

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

/* 6. BUTTONS
   ========================================= */
.btn-primary, .btn-secondary, .btn-small {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

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

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    margin-top: 15px;
    width: 100%; /* Full width on mobile */
}

.btn-secondary:hover { background: #EEF2FF; }

/* 7. CLASSES GRID
   ========================================= */
.classes-section { padding: 50px 0; }

.section-header { text-align: center; margin-bottom: 40px; }

.class-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

.class-card {
    background: var(--white);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid #E2E8F0;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.class-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.class-card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.class-card p { font-size: 0.9rem; color: var(--text-light); margin-bottom: 20px; }
.class-card a { color: var(--primary); font-weight: 600; font-size: 0.95rem; }

.badge {
    position: absolute;
    top: 15px; right: 15px;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 12px;
    font-weight: bold;
}

/* 8. FOOTER & RESOURCES
   ========================================= */
.resource-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.video-wrapper {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.iframe-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: black;
}

.iframe-container iframe {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

.footer {
    background: #0F172A;
    color: #94A3B8;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
}

.footer h4 { color: var(--white); margin-bottom: 20px; font-size: 1.2rem; }
.footer ul li { margin-bottom: 10px; }
.footer ul li a:hover { color: var(--white); text-decoration: underline; }

.newsletter-form input {
    width: 100%; padding: 14px;
    background: #1E293B; color: white;
    border: none; border-radius: 8px; margin-bottom: 10px;
}

.newsletter-form button {
    width: 100%; padding: 14px;
    background: var(--primary); color: white;
    border: none; border-radius: 8px; font-weight: bold;
}

.footer-bottom {
    margin-top: 40px; padding-top: 20px;
    border-top: 1px solid #1E293B;
    text-align: center;
}

/* =========================================
   9. RESPONSIVE LOGIC (The "No-Cut" & No-Overlap Fix)
   ========================================= */

@media (min-width: 768px) {
    /* Tablet Tweaks (Still Hamburger, but better layout) */
    .class-grid { grid-template-columns: 1fr 1fr; }
    .hero-content { flex-direction: row; text-align: left; }
    .btn-secondary { width: auto; margin-left: 15px; margin-top: 0; }
}

/* CRITICAL: Desktop Mode starts ONLY at 1024px to prevent overlapping on Tablets */
@media (min-width: 1024px) {
    /* --- DESKTOP MODE ACTIVATED --- */
    
    /* 1. Show Header Button, Hide Hamburger */
    .header-actions .btn-primary { display: inline-block; }
    .hamburger { display: none; }

    /* 2. Reset Nav Links to Horizontal Bar */
    .nav-links {
        position: static;
        height: auto; width: auto;
        background: transparent;
        flex-direction: row;
        transform: none;
        visibility: visible; /* Always visible on Desktop */
        box-shadow: none;
        padding: 0;
    }
    
    .nav-links li { margin: 0 20px; }
    .nav-links li a { font-size: 1rem; }

    /* 3. Desktop Layouts */
    .hero-content { gap: 60px; }
    .hero-text { width: 50%; align-items: flex-start; }
    .hero-image { width: 50%; }

    .class-grid { grid-template-columns: repeat(4, 1fr); }
    
    .resource-layout { grid-template-columns: 1.5fr 1fr; }
    .footer-row { grid-template-columns: 1.5fr 1fr 1fr 1.5fr; text-align: left; }
}
