/* Refined, Delicate Neo-Brutalist & Adventure Time Variables - Mobile First */
:root {
    /* Brand Colors */
    --bg-color: #fdfaf6; /* Lighter, softer cream */
    --accent-yellow: #fce277; /* Softer Jake yellow */
    --accent-blue: #7bb5e3; /* Softer Finn blue */
    --accent-pink: #ffb8d9; /* Softer Bubblegum pink */
    --accent-green: #bcebda; /* Softer BMO green */
    --text-color: #111827; /* Darker for better contrast */
    --border-color: #111827;
    
    /* Playful Design Tokens (Generated via UI Design System) */
    --border-width: 2px;
    --radius: 16px;
    --radius-sm: 8px;
    --radius-full: 9999px;
    
    /* Bouncy Shadows for Neo-Brutalism */
    --shadow: 4px 4px 0 0 var(--border-color);
    --shadow-hover: 6px 6px 0 0 var(--border-color);
    --shadow-active: 0px 0px 0 0 var(--border-color);
    
    /* Fluid Typography */
    --fluid-h1: clamp(1.5rem, 8vw, 4.5rem); /* Ajustado para móviles */
    --fluid-h2: clamp(1.75rem, 4vw + 1rem, 3rem);
    --fluid-body: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
    
    /* Bouncy Animations */
    --ease-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    font-size: var(--fluid-body);
    line-height: 1.5;
}

/* Delicate Background Pattern */
.bg-pattern {
    background-image: radial-gradient(rgba(43, 43, 43, 0.15) 1px, transparent 1px);
    background-size: 24px 24px;
    background-position: 0 0;
}

/* Sparkles Decoration */
.sparkle {
    position: absolute;
    font-family: monospace;
    color: var(--accent-yellow);
    font-size: 1.5rem;
    z-index: 1;
    animation: twinkle 3s ease-in-out infinite alternate;
    text-shadow: 1px 1px 0 var(--border-color);
    pointer-events: none;
}
.sparkle-1 { top: 20%; left: 10%; animation-delay: 0s; }
.sparkle-2 { top: 65%; right: 8%; font-size: 1rem; color: var(--accent-pink); animation-delay: 1s; }
.sparkle-3 { top: 12%; right: 15%; font-size: 1.2rem; color: var(--accent-blue); animation-delay: 2s; }
.sparkle-4 { bottom: 15%; left: 15%; font-size: 1.8rem; animation-delay: 0.5s; }

@keyframes twinkle {
    0% { transform: scale(0.8) rotate(0deg); opacity: 0.6; }
    100% { transform: scale(1.2) rotate(20deg); opacity: 1; }
}

/* Entrance Animations */
@keyframes fallFromSky {
    0% { transform: translateY(-100vh); opacity: 0; }
    50% { transform: translateY(30px); opacity: 1; }
    75% { transform: translateY(-15px); }
    100% { transform: translateY(0); opacity: 1; }
}

/* Floating Clouds Animation (More delicate) */
.cloud {
    position: absolute;
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: 50px;
    z-index: 0;
    animation: float linear infinite;
    opacity: 0.8;
    box-shadow: 2px 2px 0 0 var(--border-color); /* Added brutalist shadow to clouds */
}

.cloud-1 { width: 80px; height: 25px; top: 15%; left: -100px; animation-duration: 35s; }
.cloud-1::before { content: ''; position: absolute; background: white; border: var(--border-width) solid var(--border-color); border-bottom: none; border-radius: 50%; width: 40px; height: 40px; top: -20px; left: 10px; z-index: -1;}
.cloud-1::after { content: ''; position: absolute; background: white; border: var(--border-width) solid var(--border-color); border-bottom: none; border-radius: 50%; width: 30px; height: 30px; top: -15px; right: 10px; z-index: -1;}

.cloud-2 { width: 120px; height: 35px; top: 80%; left: -150px; animation-duration: 45s; animation-delay: 10s; transform: scale(0.8); }
.cloud-2::before { content: ''; position: absolute; background: white; border: var(--border-width) solid var(--border-color); border-bottom: none; border-radius: 50%; width: 55px; height: 55px; top: -25px; left: 15px; z-index: -1;}
.cloud-2::after { content: ''; position: absolute; background: white; border: var(--border-width) solid var(--border-color); border-bottom: none; border-radius: 50%; width: 40px; height: 40px; top: -20px; right: 15px; z-index: -1;}

@keyframes float {
    from { transform: translateX(-20vw); }
    to { transform: translateX(120vw); }
}

/* Common Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-family: inherit;
    font-weight: 800; /* Bolder text for neo-brutalism */
    cursor: pointer;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-full);
    transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-spring), background-color 0.2s;
    padding: 0.8rem 2rem;
    font-size: var(--fluid-body);
    color: var(--text-color);
    box-shadow: var(--shadow);
    background-color: white;
    position: relative;
    overflow: hidden;
}

/* Flashy shine effect on hover for buttons */
.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    transition: left 0.6s ease;
}

@media (hover: hover) {
    .btn:hover::after {
        left: 200%;
    }

    .btn:hover {
        transform: translateY(-4px) rotate(-1deg) scale(1.02);
        box-shadow: var(--shadow-hover);
    }
}

.btn:active {
    transform: translate(2px, 2px) rotate(0deg) scale(0.98);
    box-shadow: var(--shadow-active);
}

/* Simpler button for toggle actions to prevent mobile layout sticking */
.btn-toggle {
    transition: opacity 0.1s ease !important;
    transform: none !important;
}
.btn-toggle:active, .btn-toggle:hover, .btn-toggle:focus {
    transform: none !important;
    box-shadow: var(--shadow) !important;
}
.btn-toggle:active {
    opacity: 0.7;
}

.btn-primary { background-color: var(--accent-yellow); }
.btn-primary:hover { background-color: #fae896; }
.btn-secondary { background-color: white; }
.btn-secondary:hover { background-color: #f5f5f5; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; border-radius: var(--radius-sm);}


/* --- LANDING PAGE LAYOUT --- */
.landing-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 1.5rem;
    position: relative;
    z-index: 10;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.2rem 0.5rem;
    z-index: 20;
}

.info-container {
    position: relative;
    z-index: 100;
}

/* Notification Dot */
.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background-color: #ff4444;
    border: 2px solid white;
    border-radius: 50%;
    display: none;
    z-index: 10;
    pointer-events: none;
}

.has-update .notification-dot {
    display: block;
}

.info-menu-btn {
    position: relative; /* For the dot */
}

.info-menu {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.8rem;
    display: none;
    flex-direction: column;
    gap: 0.6rem;
    width: max-content;
    z-index: 101;
    transform-origin: top left;
    animation: menuPop 0.4s var(--ease-spring);
}

.brand-logo-small {
    width: 50px;
    height: auto;
    filter: drop-shadow(2px 2px 0px var(--border-color));
    transition: transform 0.3s ease;
    display: block;
}

.info-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: transparent;
    border: var(--border-width) solid var(--text-color);
    color: var(--text-color);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (hover: hover) {
    .info-btn:hover {
        transform: scale(1.1);
        background-color: rgba(0,0,0,0.05);
    }
}

.info-btn:active {
    transform: scale(0.95);
}

.info-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.8rem;
    display: none;
    flex-direction: column;
    gap: 0.6rem;
    width: max-content;
    z-index: 30;
    animation: menuPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.info-menu.active {
    display: flex !important;
}

@keyframes menuPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.info-menu-btn {
    background: var(--text-color);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    color: white;
}

@media (hover: hover) {
    .info-menu-btn:hover {
        background-color: #444;
        transform: translateX(4px);
    }
}

.tool-item {
    padding: 1.2rem;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    border-bottom: var(--border-width) solid var(--border-color);
    transition: background-color 0.2s;
}

.tool-item:last-child {
    border-bottom: none;
}

@media (hover: hover) {
    .tool-item:hover {
        background-color: var(--accent-green);
    }
}

/* Wraps the title and buttons, keeping them centered and cohesive */
.content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1; /* Fills remaining space so it's vertically centered */
    width: 100%;
    padding-bottom: 2rem;
}

.title-container {
    text-align: center;
    margin-bottom: 3rem;
    animation: fallFromSky 1s var(--ease-spring) forwards;
}

.main-title {
    font-size: var(--fluid-h1);
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-color);
    line-height: 1.1;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
    z-index: 1;
    white-space: nowrap; /* Evita que se parta en dos líneas en móviles */
}

.main-title::after {
    content: '';
    position: absolute;
    bottom: 2px; /* Ceñida a la base */
    left: 0;
    width: 100%;
    height: 6px; /* Fina y elegante */
    background-color: var(--accent-yellow);
    z-index: -1;
    border-radius: 0; /* Línea completamente recta */
    transform: none; /* Sin rotación */
    opacity: 1; /* Opacidad completa para colores de marca claros */
}

.subtitle-decoration {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.center-nav-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 320px;
}

.nav-btn {
    width: 100%;
    padding: 1.2rem 1.5rem;
    font-size: 1.1rem;
    border-radius: var(--radius);
    text-align: center;
    display: block;
    background-color: white;
}

.nav-btn-1 { background-color: var(--accent-blue); color: white; animation: fallFromSky 1s var(--ease-spring) forwards; animation-delay: 0.1s; opacity: 0; }
.nav-btn-2 { background-color: var(--accent-pink); color: var(--text-color); animation: fallFromSky 1s var(--ease-spring) forwards; animation-delay: 0.2s; opacity: 0; }
.nav-btn-3 { background-color: var(--accent-yellow); color: var(--text-color); animation: fallFromSky 1s var(--ease-spring) forwards; animation-delay: 0.3s; opacity: 0; }
.nav-btn-1:hover { background-color: #8cc3ee; }
.nav-btn-2:hover { background-color: #ffcce3; }
.nav-btn-3:hover { background-color: #fae896; }

.ranking-wrapper {
    display: flex;
    justify-content: center;
    position: relative;
    width: 100%;
}

.badge-pruebas {
    position: absolute;
    top: -12px;
    right: 5%;
    background-color: var(--text-color);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    border: var(--border-width) solid var(--border-color);
    z-index: 20;
    transform: rotate(5deg);
    box-shadow: 2px 2px 0 0 var(--border-color);
    animation: fallFromSky 1s var(--ease-spring) forwards, pulse-badge 2s infinite ease-in-out;
    animation-delay: 0.4s;
    opacity: 0;
}

@keyframes pulse-badge {
    0%, 100% { transform: rotate(5deg) scale(1); }
    50% { transform: rotate(8deg) scale(1.1); }
}

.footer-text {
    font-size: 0.75rem;
    color: #888;
    margin-top: 1.5rem;
    font-weight: 500;
    animation: fallFromSky 1s forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

/* Tools Dropdown Animation */
.tools-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tools-dropdown {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s var(--ease-spring);
    background: white;
    border: 0 solid var(--border-color); /* Hidden initially */
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
}

.tools-dropdown.active {
    max-height: 400px;
    opacity: 1;
    margin-top: 0.8rem; /* Espacio para que respire la sombra del botón */
    border-width: var(--border-width);
    border-radius: var(--radius); /* Redondeado completo para coherencia */
    box-shadow: var(--shadow);
    z-index: 5;
}

/* Estado del botón cuando el menú está abierto */
.nav-btn.active {
    position: relative;
    z-index: 10;
    /* Conserva todas las propiedades originales de .btn para ser coherente */
}

.tool-item {
    padding: 1.2rem;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    border-bottom: var(--border-width) solid var(--border-color);
    transition: background-color 0.2s;
}

.tool-item:last-child {
    border-bottom: none;
}

.tool-item:hover {
    background-color: var(--accent-green);
}

.tool-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.tool-desc {
    font-size: 0.8rem;
    color: #555;
    line-height: 1.3;
}


/* --- EVENTOS PAGE --- */
.events-wrapper {
    padding: 2rem 1.5rem 4rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    z-index: 10;
}

.page-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    position: relative;
    width: 100%;
    gap: 1.5rem;
}

.back-link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: 50%;
    color: var(--text-color);
    text-decoration: none;
    box-shadow: 2px 2px 0 0 var(--border-color);
    transition: all 0.2s;
    font-weight: 700;
    font-size: 1.2rem;
}

@media (hover: hover) {
    .back-link:hover {
        transform: translate(-2px, -2px);
        box-shadow: 4px 4px 0 0 var(--border-color);
    }
}

.back-link:active {
    transform: translate(1px, 1px);
    box-shadow: 0 0 0 0 var(--border-color);
}

.page-title {
    font-size: clamp(1.4rem, 5vw, 2.2rem);
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.1;
    margin: 0;
}

@media (max-width: 480px) {
    .page-header {
        justify-content: flex-start;
        gap: 1rem;
    }
    .page-title {
        text-align: left;
    }
}

.events-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.event-card {
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

@media (hover: hover) {
    .event-card:hover { transform: translateY(-4px); }
}

.event-image-container {
    width: 100%;
    height: 200px;
    border-bottom: var(--border-width) solid var(--border-color);
    background-color: var(--accent-green);
    overflow: hidden;
}

.event-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.event-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.event-desc {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex: 1;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 1.1rem;
    font-weight: 500;
}


/* --- DESKTOP ENHANCEMENTS --- */
@media (min-width: 768px) {
    /* Make the landing structure absolutely beautiful and centered */
    .landing-layout {
        padding: 3rem;
        justify-content: center;
        align-items: center;
    }
    
    /* Logo and Info float to top corners */
    .top-bar {
        position: absolute;
        top: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
        width: calc(100% - 1rem);
        margin: 0;
        padding: 0;
    }
    
    .brand-logo-small { 
        width: 70px; 
    }
    
    .content-wrapper {
        flex: none; /* Do not stretch anymore, stay grouped */
        margin-top: 2rem; /* Give space just in case */
    }

    .main-title { 
        font-size: 4rem; 
    }

    .title-container {
        margin-bottom: 4rem; /* More generous breathing room on PC */
    }

    .center-nav-container { 
        max-width: 380px; 
        gap: 1.8rem; 
    }
    
    .nav-btn { 
        font-size: 1.2rem; 
        padding: 1.4rem; 
    }

    /* Eventos Page Enhancements */
    .events-grid { 
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
        gap: 2.5rem;
    }
    .event-image-container { 
        height: 250px; 
    }
    .back-link { 
        width: 50px; 
        height: 50px; 
    }
}
