:root {
    --primary: #4A148C;
    --primary-light: #7B1FA2;
    --secondary: #FF4081;
    --accent: #FFEB3B;
    --bg-magical: linear-gradient(135deg, #F3E5F5 0%, #E1F5FE 100%);
    --glass: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.6);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: url('../assets/images/magic_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--primary);
    overflow-x: hidden;
    line-height: 1.6;
    animation: magic-move 120s ease-in-out infinite alternate;
}

@keyframes magic-move {
    0% { background-position: 0% 50%; }
    50% { background-position: 50% 100%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translate(-50%, 50px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.magic-font {
    font-family: 'Fredoka', cursive;
}

/* GLASSMORPHISM UTILITIES */
.glass-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.glass-magenta {
    background: rgba(255, 0, 127, 0.4); /* Un poco más opaco para que sea magenta real */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 25px;
    box-shadow: 0 15px 45px rgba(255, 0, 127, 0.3);
}

/* HERO SECTION */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 5% 50px 5%;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 10%;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 64, 129, 0.1) 0%, transparent 70%);
    z-index: -1;
}

.hero-text h1 {
    font-size: clamp(40px, 8vw, 72px);
    font-family: 'Fredoka', cursive;
    line-height: 1.1;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 25px;
}

.btn-magic {
    display: inline-block;
    padding: 18px 45px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-family: 'Fredoka', cursive;
    letter-spacing: 1px;
    box-shadow: 0 10px 30px rgba(74, 20, 140, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-magic:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 40px rgba(74, 20, 140, 0.4);
    background: var(--primary-light);
}

/* 3D BOOK ANIMATION - ENHANCED VOLUME */
.scene {
    width: 350px;
    height: 480px;
    perspective: 1500px;
}

.book {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(-25deg) rotateX(10deg);
    transition: transform 1s ease;
    animation: floating 5s ease-in-out infinite;
}

@keyframes floating {
    0% { transform: rotateY(-25deg) rotateX(10deg) translateY(0) rotateZ(0); }
    25% { transform: rotateY(-28deg) rotateX(12deg) translateY(-15px) rotateZ(1deg); }
    50% { transform: rotateY(-20deg) rotateX(5deg) translateY(-30px) rotateZ(-1deg); }
    75% { transform: rotateY(-22deg) rotateX(8deg) translateY(-15px) rotateZ(0.5deg); }
    100% { transform: rotateY(-25deg) rotateX(10deg) translateY(0) rotateZ(0); }
}

@keyframes levitate {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.book-cover {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('../assets/images/magic_cover.png');
    background-size: cover;
    background-position: center;
    border-radius: 5px 15px 15px 5px;
    box-shadow: 10px 10px 40px rgba(0,0,0,0.3);
    z-index: 10;
    transform: translateZ(50px); /* Doblamos el grosor */
}

/* Páginas laterales */
.book-pages {
    position: absolute;
    width: 95%;
    height: 96%;
    top: 2%;
    left: 4%;
    background: #fdfdfd;
    background-image: repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.05) 3px);
    box-shadow: inset 5px 0 10px rgba(0,0,0,0.1);
    transform: translateZ(20px);
    border-radius: 0 5px 5px 0;
}

/* El lomo del libro */
.book::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100px; /* Más ancho para el lomo */
    height: 100%;
    background: linear-gradient(to right, #2c0c54, #4A148C);
    transform: rotateY(-90deg) translateZ(50px); /* Ajustado al nuevo grosor */
    border-radius: 5px 0 0 5px;
}

/* Contraportada */
.book::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #311b92;
    border-radius: 5px 15px 15px 5px;
    transform: translateZ(0);
}

/* FEATURES GRID */
.feature-card {
    padding: 40px;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-card h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--primary);
}

.feature-card p {
    font-size: 16px;
    opacity: 0.8;
}

/* COOKIE BANNER */
#cookie-banner {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    z-index: 2000;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    animation: fadeInUp 0.8s ease-out;
}

.cookie-actions {
    display: flex;
    gap: 15px;
}

.btn-cookie {
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.2s ease;
}

.btn-accept { background: #ff007f; color: white; }
.btn-settings { background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3); }

/* MODAL CONFIG */
#cookie-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 40px;
    color: white;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .hero-magenta-card {
        grid-template-columns: 1fr !important;
        text-align: center;
        padding: 40px !important;
    }
    .hero-visual { display: none !important; }
    .cta-buttons { justify-content: center; }
}

@media (max-width: 768px) {
    nav { width: 95% !important; padding: 10px !important; }
    .nav-links { display: none !important; }
    /* No eliminamos el selector de idiomas en móvil porque ahora es flotante */
    #cookie-banner { 
        flex-direction: column; 
        text-align: center; 
        bottom: 10px;
        padding: 20px;
    }
}

/* LANG BALLOON */
/* LANG BALLOON - FIXED OUTSIDE NAV (BOTTOM) */
.lang-balloon-wrap {
    position: fixed;
    bottom: 40px;
    right: 30px;
    z-index: 5000;
    display: inline-block;
    animation: levitate 4s ease-in-out infinite;
}

@media (max-width: 768px) {
    .lang-balloon-wrap {
        bottom: 20px; /* En móvil lo bajamos un poco */
        right: 20px;
    }
}

.lang-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 0, 127, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid #ff007f;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 20px;
    box-shadow: 0 5px 15px rgba(255, 0, 127, 0.4);
}

.lang-trigger:hover {
    background: rgba(255, 0, 127, 0.2);
    border-color: #ff007f;
    transform: scale(1.1);
}

.lang-dropdown {
    position: absolute;
    bottom: 80px; /* Abre hacia arriba */
    right: 0;
    width: 180px;
    padding: 15px;
    display: none;
    flex-direction: column;
    gap: 10px;
    animation: scaleIn 0.3s ease-out;
    z-index: 5001;
}

.lang-item {
    padding: 8px 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: white;
    text-decoration: none;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.lang-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}
