/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    /* Color Palette (Light Mode) */
    --primary-color: #57C5B6;
    --primary-dark: #159895;
    --secondary-color: #1A5F7A;
    --accent-color: #002B5B;
    --text-color: #333333;
    --text-light: #666666;
    --bg-light: #f9f9f9;
    --white: #ffffff;
    --card-bg: #ffffff;
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);

    /* Typography */
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    /* New font for heavy headers */
    --font-brand: 'Kalam', cursive;

    /* Spacing */
    --container-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    --border-radius-lg: 20px;
    --border-radius-xl: 40px;
}

/* DARK MODE VARIABLES */
body.dark-mode {
    --primary-color: #57C5B6;
    --primary-dark: #80ED99;
    --secondary-color: #AEE6E6;
    --accent-color: #F0F8FF;
    --text-color: #E0E0E0;
    --text-light: #B0B0B0;
    --bg-light: #121212;
    --white: #1E1E1E;
    /* Dark card bg */
    --card-bg: #1E1E1E;
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    list-style: none;
}

html {
    scroll-behavior: smooth;
    font-size: 100%;
    /* 16px base */
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-light);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* === THEME TOGGLE BTN === */
.theme-toggle-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    /* Opposite to WhatsApp */
    width: 50px;
    height: 50px;
    background-color: var(--accent-color);
    color: var(--bg-light);
    /* Inverted icon color */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    z-index: 2000;
    cursor: pointer;
    font-size: 1.5rem;
    border: none;
    transition: transform 0.3s ease;
}

.theme-toggle-btn:hover {
    transform: rotate(45deg) scale(1.1);
}

/* === PROGRESS BADGES === */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 5px;
}

.badge-complete {
    background-color: #25D366;
    color: #fff;
}

.badge-progress {
    background-color: #FFD700;
    color: #333;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   2. UTILITIES & COMPONENTS
   ========================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: var(--font-main);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
}

.highlight {
    color: var(--primary-dark);
    font-family: var(--font-brand);
}

/* =========================================
   3. HEADER & NAVIGATION
   ========================================= */
.main-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-brand);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.logo img {
    height: 40px;
    width: auto;
}

/* =========================================
   4. HERO SECTION
   ========================================= */
/* =========================================
   4. HERO SECTION (REDESIGNED)
   ========================================= */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl) var(--spacing-md);
    min-height: 90vh;
    position: relative;
    overflow: hidden;
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    color: var(--text-color);
    letter-spacing: -1px;
}

.highlight-text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge-hero {
    display: inline-block;
    background: rgba(87, 197, 182, 0.1);
    color: var(--primary-dark);
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
    border: 1px solid var(--primary-color);
}

.hero-stats {
    display: flex;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark-mode .hero-stats {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Hero Image & Floating Elements */
.hero-image-container {
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-img {
    width: 100%;
    max-width: 500px;
    z-index: 2;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.15));
}

.floating-anim {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.float-card {
    position: absolute;
    background: var(--card-bg);
    /* Uses dark/light var */
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--primary-dark);
    z-index: 3;
    animation: floatCard 5s ease-in-out infinite;
}

.card-html {
    top: 10%;
    left: 0;
    animation-delay: 0s;
    transform: rotate(-10deg);
    color: #E44D26;
}

.card-css {
    bottom: 20%;
    right: 0;
    animation-delay: 1s;
    transform: rotate(10deg);
    color: #264DE4;
}

.card-js {
    top: 50%;
    right: -20px;
    animation-delay: 2s;
    color: #F7DF1E;
}

@keyframes floatCard {

    0%,
    100% {
        transform: translateY(0) rotate(var(--r, 0deg));
    }

    50% {
        transform: translateY(-15px) rotate(var(--r, 0deg));
    }
}

/* =========================================
   5. FEATURES GRID & GLASSMORPHISM
   ========================================= */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s;
}

body.dark-mode .glass-card {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-card:hover {
    transform: translateY(-5px);
}

.icon-box {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

/* =========================================
   6. COURSES SECTION (CARDS)
   ========================================= */
.courses {
    padding-bottom: var(--spacing-xl);
}

/* =========================================
   6. COURSES SECTION (CARDS REVAMP)
   ========================================= */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    /* Slightly wider */
    gap: var(--spacing-md);
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.card-image {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
    position: relative;
    overflow: hidden;
}

/* Gradients for Card Backgrounds */
.gradient-intro {
    background: linear-gradient(135deg, #fceabba0, #f8b50030);
}

.gradient-html {
    background: linear-gradient(135deg, #FFEFBA, #FFFFFF);
}

.gradient-css {
    background: linear-gradient(135deg, #E0EAFC, #CFDEF3);
}

.gradient-js {
    background: linear-gradient(135deg, #fff1eb, #ace0f9);
}

.gradient-node {
    background: linear-gradient(135deg, #d4fc7940, #96e6a140);
}

.gradient-react {
    background: linear-gradient(135deg, #a18cd130, #fbc2eb30);
}

.gradient-sql {
    background: linear-gradient(135deg, #e6e9f0, #eef1f5);
}

.gradient-git {
    background: linear-gradient(135deg, #fbc2eb30, #a6c1ee30);
}

.gradient-ux {
    background: linear-gradient(135deg, #fa709a20, #fee14020);
}

.card-image img {
    height: 80px;
    /* Consistent height */
    width: auto;
    transition: transform 0.5s ease;
}

.card:hover .card-image img {
    transform: scale(1.1) rotate(5deg);
}

.card-content {
    padding: var(--spacing-md);
}

.card-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.course-meta {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* =========================================
   7. FLOATING WHATSAPP
   ========================================= */
.btn-floating-whatsapp {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    z-index: 2000;
    transition: transform 0.3s ease;
}

.btn-floating-whatsapp:hover {
    transform: scale(1.1);
}

.btn-floating-whatsapp img {
    width: 35px;
    height: 35px;
}

/* =========================================
   8. TESTIMONIALS & FOOTER
   ========================================= */
.mb-xl {
    margin-bottom: var(--spacing-xl);
}

.glass-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.testimonial-item {
    background: var(--card-bg);
    padding: var(--spacing-md);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    text-align: left;
}

.testimonial-item p {
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.user-info strong {
    display: block;
    color: var(--primary-dark);
}

.main-footer {
    background-color: var(--card-bg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

.footer-column h3 {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: var(--spacing-sm);
}

.footer-column ul li {
    margin-bottom: 0.8rem;
}

.footer-column ul li a {
    color: var(--text-light);
    transition: color 0.2s;
}

.footer-column ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding: var(--spacing-md);
    background-color: var(--bg-light);
    color: var(--text-light);
    font-size: 0.9rem;
}

/* =========================================
   9. RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 992px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: var(--spacing-md);
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .hero-content p {
        margin: 0 auto var(--spacing-md);
    }
}

@media (max-width: 768px) {
    .features-intro h2 {
        font-size: 2rem;
    }

    .card-image {
        height: 180px;
    }

    .footer-container {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .logo .nombre {
        font-size: 1.2rem;
    }
}

/* =========================================
   10. INTERNAL PAGES & COURSE CONTENT
   ========================================= */
.course-header {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-dark));
    color: var(--white);
    padding: var(--spacing-xl) 0;
    text-align: center;
    border-radius: 0 0 30px 30px;
    margin-bottom: var(--spacing-lg);
}

.course-header h1 {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.course-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.course-navigation {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.lesson-container {
    background: var(--white);
    padding: var(--spacing-lg);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-xl);
}

/* Slider / Lesson Content */
.slider {
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.slide {
    display: none;
    animation: fadeIn 0.5s ease;
}

.slide.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-md);
    background: #000;
}

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

.lesson-title {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: var(--spacing-sm);
}

.lesson-text {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
}

.slider-controls {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid #eee;
}

.slider-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
    box-shadow: none;
}

/* =========================================
   11. QUIZ & INTERACTIVITY
   ========================================= */
.quiz-container {
    background: #f4f6f8;
    padding: var(--spacing-md);
    border-radius: 12px;
    margin-top: var(--spacing-sm);
    text-align: left;
}

.quiz-question {
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--secondary-color);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    font-family: var(--font-main);
}

.option-btn:hover {
    border-color: var(--primary-color);
    background: #eefcfb;
}

.option-btn.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--white);
}

.option-btn.correct {
    border-color: #25D366;
    background: #25D366;
    color: var(--white);
}

.option-btn.incorrect {
    border-color: #e34c26;
    background: #e34c26;
    color: var(--white);
}

/* Celebration Overlay */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.celebration-content {
    background: var(--white);
    padding: var(--spacing-xl);
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
    }
}