/* ============================================
   BrainUp Kids Webinar Platform
   Main Stylesheet
   ============================================ */

/* CSS Variables */
:root {
    /* Colors */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;

    --secondary-50: #f0fdf4;
    --secondary-100: #dcfce7;
    --secondary-500: #22c55e;
    --secondary-600: #16a34a;

    --accent-50: #fef3c7;
    --accent-400: #fbbf24;
    --accent-500: #f59e0b;

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --white: #ffffff;
    --black: #000000;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-text: linear-gradient(135deg, var(--primary-500) 0%, #a855f7 50%, #ec4899 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 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-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-primary: 0 10px 40px -10px rgba(99, 102, 241, 0.5);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--white);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   Header
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition-normal);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: var(--shadow-primary);
}

.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gray-900);
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--gray-600);
    font-weight: 500;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--gray-900);
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    color: var(--gray-700);
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.btn-icon-right {
    width: 18px;
    height: 18px;
    margin-left: 0.25rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-md), var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-primary);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-white {
    background: var(--white);
    color: var(--primary-600);
}

.btn-white:hover {
    background: var(--gray-50);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-500);
    color: var(--primary-600);
}

.btn-outline:hover {
    background: var(--primary-50);
}

.btn-danger {
    background: #ef4444;
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--secondary-500);
    color: var(--white);
}

.btn-success:hover {
    background: var(--secondary-600);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 72px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 119, 198, 0.15), transparent),
        radial-gradient(ellipse 60% 50% at 80% 50%, rgba(99, 102, 241, 0.1), transparent),
        radial-gradient(ellipse 50% 50% at 20% 80%, rgba(168, 85, 247, 0.08), transparent);
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, var(--gray-200) 1px, transparent 0);
    background-size: 40px 40px;
    opacity: 0.5;
}

.hero-content {
    text-align: center;
    padding: 4rem 0;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-600);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--secondary-500);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 2.5rem;
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--gray-200);
}

/* ============================================
   Animations
   ============================================ */
.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Section Styles
   ============================================ */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: var(--primary-50);
    color: var(--primary-600);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.section-description {
    font-size: 1.125rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Features Section
   ============================================ */
.features {
    padding: 6rem 0;
    background: var(--gray-50);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    padding: 2rem;
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-200);
}

.feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    color: var(--primary-500);
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.feature-description {
    color: var(--gray-600);
    line-height: 1.6;
}

/* ============================================
   Upcoming Webinars Section
   ============================================ */
.upcoming-section {
    padding: 6rem 0;
}

.webinars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
}

.webinar-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.webinar-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.webinar-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.webinar-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.webinar-thumbnail-placeholder {
    color: var(--white);
}

.webinar-thumbnail-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.8;
}

.webinar-status {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
}

.webinar-status.live {
    background: #ef4444;
    color: var(--white);
    animation: pulse 2s infinite;
}

.webinar-status.scheduled {
    background: var(--secondary-500);
    color: var(--white);
}

.webinar-content {
    padding: 1.5rem;
}

.webinar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.webinar-description {
    color: var(--gray-600);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.webinar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.webinar-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.webinar-meta-item svg {
    width: 16px;
    height: 16px;
}

.webinar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.webinar-registrations {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.webinar-registrations strong {
    color: var(--gray-900);
}

/* ============================================
   CTA Section
   ============================================ */
.cta-section {
    padding: 6rem 0;
    background: var(--gray-50);
}

.cta-card {
    position: relative;
    padding: 4rem;
    background: var(--gradient-primary);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    text-align: center;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.75rem;
}

.cta-description {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.cta-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.cta-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.cta-circle-1 {
    width: 400px;
    height: 400px;
    top: -200px;
    right: -100px;
}

.cta-circle-2 {
    width: 300px;
    height: 300px;
    bottom: -150px;
    left: -100px;
}

.cta-circle-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 20%;
    transform: translateY(-50%);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer-brand .logo {
    margin-bottom: 1rem;
}

.footer-brand .logo-text {
    color: var(--white);
}

.footer-tagline {
    max-width: 300px;
    line-height: 1.6;
}

.footer-column h4 {
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.footer-column a {
    display: block;
    padding: 0.375rem 0;
    color: var(--gray-400);
    transition: var(--transition-fast);
}

.footer-column a:hover {
    color: var(--white);
}

.footer-bottom {
    padding: 1.5rem 0;
    border-top: 1px solid var(--gray-800);
    text-align: center;
    font-size: 0.875rem;
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-menu {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    z-index: 999;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu-content {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-link {
    padding: 0.75rem 0;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
}

/* ============================================
   Loading & Empty States
   ============================================ */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    grid-column: 1 / -1;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--gray-400);
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
}

.hidden {
    display: none !important;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input.error {
    border-color: #ef4444;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.form-checkbox input {
    width: 18px;
    height: 18px;
    margin-top: 0.125rem;
    accent-color: var(--primary-500);
}

.form-checkbox label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.form-error {
    display: block;
    font-size: 0.8125rem;
    color: #ef4444;
    margin-top: 0.375rem;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .hero-stats {
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .stat-divider {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero-content {
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .hero-stats {
        padding: 1rem 1.5rem;
        width: 100%;
        justify-content: space-around;
    }

    .features-grid,
    .webinars-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand .logo {
        justify-content: center;
    }

    .footer-tagline {
        max-width: none;
    }

    .cta-card {
        padding: 2.5rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-badge {
        font-size: 0.75rem;
    }

    .section-header {
        margin-bottom: 2.5rem;
    }

    .feature-card,
    .webinar-card {
        margin: 0 -0.5rem;
    }
}
