:root {
    /* Colors */
    --primary: #0066FF;
    --primary-dark: #005ce6;
    --primary-light: #e6f0ff;
    --secondary: #2E3A59;
    --accent: #00C853;
    /* Success Green */
    --background: #F8F9FA;
    --surface: #FFFFFF;
    --text-main: #1A1A1A;
    --text-muted: #666666;
    --border: #E5E7EB;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-round: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Utilities */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    /* Reduced from round */
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: transform 0.1s active, box-shadow 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    /* Removed large shadow for institutional look */
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--surface);
    color: var(--primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
}

.btn-outline {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-whatsapp-outline {
    color: #128C7E;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #128C7E;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-whatsapp-outline:hover {
    background-color: #E0F2F1;
}

.btn-whatsapp-outline svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
    width: 100%;
}

.btn-block {
    width: 100%;
    display: flex;
}

@media (min-width: 640px) {
    .btn-lg {
        width: auto;
    }
}

.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 102, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 102, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 102, 255, 0);
    }
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #4a5362;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo svg {
    color: var(--primary);
}

/* Hero */
.hero {
    padding: var(--spacing-xl) 0;
    /* Reduced from xxl */
    text-align: center;
}

.badge-hero {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 6px;
    /* Reduced from round */
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.hero h1 {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

.hero-sub {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-main);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    /* Clean look */
    padding: 6px 12px;
    border-radius: 6px;
    /* Removed shadow */
    border: 1px solid var(--border);
    font-weight: 500;
}

@media (min-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
}

/* Filters */
/* Filters (Catalog Style) */
.filters-section {
    position: sticky;
    top: 60px;
    /* Adjusted to sit just below header */
    background: var(--background);
    z-index: 90;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid #e5e7eb;
}

.filters-scroll {
    display: flex;
    gap: 24px;
    /* Increased gap for clear separation */
    overflow-x: auto;
    padding-bottom: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    align-items: center;
}

.filters-scroll::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background: none;
    border: none;
    padding: 8px 0;
    font-size: 1rem;
    color: #6b7280;
    /* Text muted */
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s;
    border-radius: 0;
    /* No radius */
}

.filter-btn:hover {
    color: var(--primary);
}

.filter-btn.active {
    background: none;
    color: var(--primary);
    font-weight: 600;
    border: none;
}

.filter-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    /* Align with container border */
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
}

/* Ads */
.ad-container {
    margin: var(--spacing-lg) auto;
}

.ad-slot {
    background-color: #eee;
    min-height: 250px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.ad-slot-feed {
    grid-column: 1 / -1;
    background-color: #eee;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
    position: relative;
}

.ad-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    background: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Course Grid */
.course-list {
    padding-bottom: var(--spacing-xxl);
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

@media (min-width: 640px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Cards */
.course-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #FFE082;
    color: #664d03;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}

.card-badge.popular {
    background: #FFCDD2;
    color: #B71C1C;
}

.badge-success {
    background-color: var(--accent);
    color: white;
}

.platform-badge {
    display: inline-block;
    background-color: var(--secondary);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    box-shadow: var(--shadow-sm);
}

.card-header {
    margin-bottom: var(--spacing-md);
}

.category-tag {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 4px;
}

.course-title {
    font-size: 1.25rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    margin-bottom: var(--spacing-lg);
    color: var(--text-muted);
    font-size: 0.875rem;
    flex-grow: 1;
}

.course-meta li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.card-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-direction: column;
    margin-top: auto;
}

@media (min-width: 400px) {
    .card-actions {
        flex-direction: row;
    }

    .card-actions .btn {
        flex: 1;
        padding: 10px;
        /* Compress slightly if 2 buttons */
        font-size: 0.9rem;
    }
}

.load-more-container {
    text-align: center;
    margin-top: var(--spacing-xl);
}

.btn-wide {
    width: 100%;
}

@media (min-width: 640px) {
    .btn-wide {
        width: auto;
        min-width: 200px;
    }
}

/* Footer */
.site-footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: var(--spacing-xl) 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-links {
    margin-top: var(--spacing-md);
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
}

.footer-links a:hover {
    color: var(--primary);
}

/* =========================================
   AI Tutor Styles
   ========================================= */
.ai-tutor-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.27);
    border: none;
    color: white;
}

.ai-tutor-fab:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.5);
}

.ai-tutor-fab svg {
    width: 32px;
    height: 32px;
}

/* Chat Container */
.ai-chat-container {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 350px;
    height: 500px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.ai-chat-container.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Header */
.chat-header {
    background: #4f46e5;
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-chat {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.close-chat:hover {
    color: white;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.ai {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 2px;
    align-self: flex-start;
    color: #1e293b;
}

.message.user {
    background: #4f46e5;
    color: white;
    border-bottom-right-radius: 2px;
    align-self: flex-end;
}

/* Input Area */
.chat-input-area {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #4f46e5;
}

.send-btn {
    background: #4f46e5;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.send-btn:hover {
    background: #4338ca;
}

.send-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    background: #e2e8f0;
    border-radius: 12px;
    width: fit-content;
    display: none;
    /* Hidden by default */
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #64748b;
    border-radius: 50%;
    animation: typing 1s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* =========================================
   Course Page Redesign (Mobile-First)
   ========================================= */

/* =========================================
   Course Page Redesign (Mobile-First)
   ========================================= */

.course-hero {
    background-color: white;
    /* Card Background */
    color: var(--text-main);
    padding: 24px;
    text-align: left;
    border: 1px solid #e5e7eb;
    /* Subtle border */
    border-radius: 16px;
    /* Rounded corners */
    margin: 16px 16px 0 16px;
    /* Spacing from edges */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* Soft shadow */
}

.course-hero .container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Tighter spacing */
}

/* Removed hero-badge per request */
.hero-badge {
    display: none;
}

.course-hero h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.hero-platform {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Glass Panels -> Clean Info Grid */
.glass-panel {
    background: #f8fafc;
    /* Light grey background */
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.glass-panel svg {
    color: var(--primary);
    /* Primary blue icons */
    width: 20px;
    height: 20px;
}

/* Content Sections */
.course-content {
    padding: 24px 16px;
}

.content-card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937 !important;
    /* Dark grey */
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title svg {
    color: #2563eb !important;
    /* Primary blue */
}

/* Feature Box (Green) */
.feature-box {
    background: #f0fdf4;
    /* Green-50 */
    border: 1px solid #bbf7d0;
    /* Green-200 */
    border-radius: 12px;
    padding: 16px;
}

/* Check List Items */
.check-list-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: white;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.check-list-item svg {
    color: #10b981;
    /* Green-500 */
    flex-shrink: 0;
    margin-top: 2px;
}

.check-list-item span {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.5;
}

/* Desktop Fixes */
@media (min-width: 1024px) {
    .course-hero {
        margin: 24px auto 0 auto;
        max-width: 1200px;
        position: relative;
        /* Changed from sticky to relative */
        top: 0;
        z-index: 10;
    }
}

/* =========================================
   Single Course Content Cards
   ========================================= */
.content-card {
    background: white !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title svg {
    color: #2563eb;
}

.feature-box {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 16px;
}

.course-content {
    background-color: #f9fafb;
    /* Gray background for contrast */
    padding: 32px 0;
}