/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;700&display=swap');

:root {
    --primary-bg: #FF9EAA;
    --primary-border: #86E3CE;
    --primary-shadow: #6eb5a3;
    --text-color: #5D4037;
    --accent-yellow: #FFF59D;
    --alert-red: #FF8A80;
    --bg-top: #E0F7FA;
    --bg-bottom: #FCE4EC;
}

body {
    font-family: 'Nunito', sans-serif;
    color: var(--text-color);
    background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center vertically */
    /* Assets & Backgrounds */
    /* TV View: Default body background handled by JS or media query, but let's set defaults here if specific classes used */
    /* Actually updating the previous body rule or adding specific classes as originally intended in agents.md but simpler here */
    /* Default to mobile view */
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-image: url('img/fondo_movil.jpg');
}

/* Desktop Background Override */
@media (min-width: 769px) {
    body {
        background-image: url('img/fondo_tv.jpg');
        /* Use landscape image for desktop */
    }
}

/* TV Specific Background */
.tv-mode {
    background-image: url('img/fondo_tv.jpg');
    background-size: cover;
    background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Fredoka One', cursive;
    text-shadow: 2px 2px 0px #fff, 4px 4px 0px rgba(0, 0, 0, 0.1);
    color: var(--primary-bg);
}

/* Kawaii Button */
.btn-kawaii {
    background-color: var(--primary-bg);
    color: white;
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    padding: 10px 30px;
    border-radius: 50px;
    border: 4px solid var(--primary-border);
    box-shadow: 0px 6px 0px var(--primary-shadow);
    transition: transform 0.1s, box-shadow 0.1s;
    cursor: pointer;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
    margin: 10px;
}

.btn-kawaii:active,
.btn-kawaii.active {
    transform: translateY(4px);
    box-shadow: 0px 2px 0px var(--primary-shadow);
}

.btn-kawaii:hover {
    filter: brightness(1.1);
}



/* Kawaii Box Container */
.kawaii-box {
    background: rgba(255, 255, 255, 0.85);
    /* Transparent white */
    border-radius: 30px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    width: 400px;
    text-align: center;
    margin: 0 20px 20px 20px;
    /* Reduced top margin */
    border: 2px solid rgba(255, 255, 255, 0.6);
    /* Softer border */
}

/* Inputs */
input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 15px;
    border-radius: 20px;
    border: 2px solid var(--primary-border);
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    margin-bottom: 15px;
    box-sizing: border-box;
    background: rgba(253, 253, 253, 0.9);
}

input:focus {
    outline: none;
    border-color: var(--primary-bg);
}

/* Logo Animation */
.logo {
    animation: float 1.5s ease-in-out infinite;
    width: 95%;
    max-width: 400px;
    /* Wider on mobile */
    margin-bottom: -20px;
    /* pull closer overlap if needed */
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
        /* Subtle float */
    }

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

@keyframes float-tv {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    25% {
        transform: translateY(-12px) rotate(-2deg);
    }

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

    75% {
        transform: translateY(-12px) rotate(2deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

.tv-logo-animated {
    animation: float-tv 2.5s ease-in-out infinite;
}

/* Helper Classes */
.hidden {
    display: none !important;
}

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

.mt-2 {
    margin-top: 1rem;
}

.w-full {
    padding: 20px;
}

/* Desktop Layout for Index */
.main-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 40px;
    /* Reduced gap slightly */
    width: 100%;
    max-width: 1200px;
}

.logo-wrapper,
.content-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
}

.logo-wrapper {
    justify-content: flex-end;
    /* Push logo to right (towards center) */
}

.content-wrapper {
    justify-content: flex-start;
    /* Push box to left (towards center) */
}

.main-container .kawaii-box {
    width: 100%;
    max-width: 400px;
    margin: 0;
}

/* Force larger logo on desktop side-by-side */
.main-container .logo {
    width: 100%;
    max-width: 450px;
    margin-bottom: 0;
    /* Remove bottom margin for perfect vertical centering */
}

/* Mobile Specific (Original Stacked) */
@media (max-width: 768px) {
    body {
        background-image: url('img/fondo_movil.jpg');
    }

    .main-container {
        flex-direction: column;
        gap: 20px;
    }

    .logo-wrapper,
    .content-wrapper {
        justify-content: center;
        width: 100%;
    }

    .main-container .logo {
        width: 95%;
        max-width: 480px;
    }

    .main-container .kawaii-box {
        width: 90%;
        max-width: 90%;
    }
}

/* TV Specific */
.tv-mode {
    width: 100vw;
    height: 100vh;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tv-mode .kawaii-box {
    width: 96vw;
    max-width: none;
    /* Allow full expansion */
    padding: 1rem;
    height: 93vh;
    /* Occupy almost full height */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Align top so flex-grow works */
}

.tv-mode h1 {
    font-size: 4rem;
}

.tv-mode h2 {
    font-size: 2.5rem;
}

/* Floating Icons Restored */
.floating-icons {
    position: fixed;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 5000;
    /* Ensure on top of everything including overlays */
    pointer-events: auto;
    /* Ensure clickable */
}

.btn-icon-float {
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid var(--primary-border);
    color: var(--text-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, background 0.2s;
    padding: 0;
}

.btn-icon-float:hover {
    transform: scale(1.1) rotate(5deg);
    background: white;
}

.btn-icon-float:active {
    transform: scale(0.9);
}

/* TV Layout Specifics (Added for Lobby QR Fix) */
.tv-split-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    flex: 1;
    /* Fill remaining vertical space */
    min-height: 0;
    /* Allow shrinking if needed */
    gap: 40px;
    align-items: flex-start;
    overflow: hidden;
}

/* Left Column: Logo + QR */
.tv-left-col {
    flex: 0 0 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    /* Distribute space */
    border-right: 2px dashed #ff9eaa;
    padding-right: 20px;
    height: 100%;
    min-height: 0;
    /* Allow shrinking */
}

/* Right Column: Stats + Grid */
.tv-right-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Logo shrinking is handled inline in HTML now */
.tv-logo {
    /* Kept for safety but main styling is inline */
    object-fit: contain;
}

.tv-qr-wrapper {
    background: white;
    padding: 10px;
    border-radius: 20px;
    border: 4px solid var(--primary-border);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);

    /* Maximize space now that logo is gone */
    width: 90%;
    max-width: 500px;
    height: auto;
    aspect-ratio: 1 / 1;

    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin: auto;
    /* Center vertically and horizontally */
}

.tv-qr-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* TV Mode Override for Main Box */
body.tv-mode .kawaii-box {
    width: 90vw !important;
    max-width: 1400px !important;
    height: 85vh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding-top: 10px !important;
    margin-top: 5vh !important;
}

/* Pop In Animation for Modals */
@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}