@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@400;600;700&display=swap');

:root {
    --bg-warm-white: #FAFAFA;
    --bg-soft-ivory: #F4F1EA;
    --accent-green: #84A59D;
    --accent-green-hover: #6a8b83;
    --accent-blue: #A8C6D9;
    --text-charcoal: #2D3748;
    --text-muted: #718096;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-warm-white);
    color: var(--text-charcoal);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-charcoal);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Estilos de Componentes Transversales (Glassmorphism) */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border-radius: 24px;
}

/* Botones Premium */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--accent-green);
    color: white;
    box-shadow: 0 8px 20px rgba(132, 165, 157, 0.3);
}

.btn-primary:hover {
    background-color: var(--accent-green-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(132, 165, 157, 0.4);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--accent-green);
    color: var(--accent-green);
}

.btn-outline:hover {
    background-color: var(--accent-green);
    color: white;
}

/* Navbar Global */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(250, 250, 250, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.nav-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--accent-green);
}

.nav-brand span {
    color: var(--accent-blue);
}

.nav-brand a {
    color: inherit;
    text-decoration: none;
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: var(--accent-green);
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* Mobile Drawer (Slide-in) */
.mobile-drawer {
    display: none;
    position: fixed;
    top: 0;
    right: -100%; /* Hidden by default */
    width: 80%;
    max-width: 350px;
    height: 100vh;
    z-index: 1002;
    padding: 40px 30px;
    flex-direction: column;
    gap: 30px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.05);
}

.mobile-drawer.active {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-drawer {
    font-size: 2.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.drawer-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.drawer-link {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-charcoal);
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Overlay */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
    z-index: 1001;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Dashboard specific base */
.dash-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 80px;
    background-color: var(--bg-warm-white);
}

/* Sidebar Kajabi Style */
.sidebar {
    width: 320px;
    background: var(--bg-soft-ivory);
    border-right: 1px solid rgba(0,0,0,0.05);
    padding: 30px 20px;
    height: calc(100vh - 80px);
    position: sticky;
    top: 80px;
    overflow-y: auto;
}

.module-title {
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    margin: 25px 0 10px;
    color: var(--accent-green);
}

.video-link {
    display: block;
    padding: 12px 15px;
    border-radius: 12px;
    color: var(--text-charcoal);
    margin-bottom: 5px;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.video-link:hover, .video-link.active {
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    font-weight: 500;
}

/* Main Content Area */
.dash-main {
    flex: 1;
    padding: 40px 6%;
    max-width: 1100px;
}

.video-player {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Reproductor Placeholder */
.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, var(--text-charcoal), #4A5568);
    color: white;
    font-size: 1.5rem;
    font-family: 'Outfit', sans-serif;
}

.resources-card {
    margin-top: 40px;
    padding: 30px;
}

/* Community Mighty Networks Style */
.community-layout {
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    gap: 30px;
    padding: 110px 4% 60px;
    max-width: 1500px;
    margin: 0 auto;
}

.feed-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-composer {
    padding: 24px;
    margin-bottom: 10px;
}

.post-composer input {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    margin-bottom: 15px;
    background: var(--bg-warm-white);
    font-size: 1rem;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.02);
}

.post-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
}

.post-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 15px;
}

@media (max-width: 768px) {
    .desktop-only { display: none; }
    .mobile-toggle { display: flex; }
    .mobile-drawer { display: flex; }
    .menu-overlay.active { display: block; }
    
    .navbar {
        padding: 15px 5%;
    }
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a.link {
    font-weight: 500;
    color: var(--text-charcoal);
    transition: color 0.3s ease;
}

.nav-links a.link:hover {
    color: var(--accent-green);
}

/* Landing Page: Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 5%;
    background: linear-gradient(135deg, var(--bg-warm-white) 0%, var(--bg-soft-ivory) 100%);
    position: relative;
}

.hero::before, .hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
}

.hero::before {
    top: -10%;
    right: -5%;
    width: 500px;
    height: 500px;
    background: var(--accent-blue);
    opacity: 0.25;
}

.hero::after {
    bottom: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: var(--accent-green);
    opacity: 0.15;
}

.hero-content {
    flex: 1;
    z-index: 1;
    padding-right: 60px;
    animation: fadeInUp 1s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hero-content h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero-content h1 span {
    color: var(--accent-green);
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 550px;
}

.hero-visual {
    flex: 1;
    z-index: 1;
    display: flex;
    justify-content: center;
    position: relative;
    animation: fadeInRight 1s cubic-bezier(0.25, 0.8, 0.25, 1) 0.2s both;
}

.hero-visual img {
    width: 100%;
    max-width: 650px;
    border-radius: 32px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.1);
    object-fit: cover;
}

/* Landing Page: Authority Section */
.authority {
    padding: 120px 5%;
    display: flex;
    align-items: center;
    gap: 80px;
    background-color: var(--bg-warm-white);
    position: relative;
    z-index: 1;
}

.auth-image {
    flex: 1;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
}

.auth-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 32px;
}

.auth-image::after {
    content: 'Dr Jesús Garrido Alergólogo Infantil';
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    color: var(--text-charcoal);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.auth-text {
    flex: 1;
}

.auth-text h2 {
    font-size: 3rem;
    margin-bottom: 24px;
    line-height: 1.2;
}

.auth-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Footer Global */
footer {
    text-align: center;
    padding: 60px 5%;
    background: var(--bg-soft-ivory);
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Utils y Animaciones */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- Mobile Bottom Navigation --- */
.mobile-bottom-nav {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 20px;
    left: 4%;
    right: 4%;
    height: 70px;
    background: rgba(255, 255, 255, 0.85); /* Slightly more opaque glass */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border-radius: 20px;
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.3s ease;
    gap: 4px;
    flex: 1;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--accent-green);
}

.mobile-bottom-nav .nav-item.active i {
    color: var(--accent-green);
    transform: translateY(-2px);
}

/* Update Mobile Media Query */
@media (max-width: 768px) {
    .desktop-only { display: none; }
    .mobile-toggle { display: flex; }
    .mobile-drawer { display: flex; }
    .menu-overlay.active { display: block; }
    
    .navbar {
        padding: 15px 5%;
    }

    /* Fixed Bottom Nav activation */
    .mobile-bottom-nav {
        display: flex;
    }

    body {
        padding-bottom: 90px; /* Spacer for the floating menu */
    }

    /* Dashboard Mobile Fixes */
    .dash-layout {
        flex-direction: column;
        display: flex;
    }

    .dash-main {
        order: 1; /* El vídeo y contenido principal va primero */
        padding: 20px 5%;
    }

    .sidebar {
        order: 2; /* El listado de lecciones va después */
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        padding: 20px 5%;
        display: none; /* Oculto por defecto en móvil */
        animation: slideDown 0.3s ease-out forwards;
    }

    .sidebar.active {
        display: block;
    }

    .mobile-only-btn {
        display: flex !important;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .resources-card {
        padding: 20px;
    }
    
    .resources-card .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

.mobile-only-btn {
    display: none;
}
