/* 
   Xavi de la Salud - Official Website Styles
   Aesthetics: Jazz Blue, Gold Accents, Elegant & Dynamic
*/

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Outfit:wght@100..900&display=swap');

:root {
    --bg-color: #050b16; /* Near black blue */
    --deep-blue: #0b1e3b;
    --deep-blue-dark: #040d1a;
    --accent-gold: #c5a059;
    --accent-gold-bright: #e6c27a;
    --accent-gold-shadow: rgba(197, 160, 89, 0.4);
    --text-white: #f8f9fa;
    --text-gray: #a0a0a0;
    --glass-bg: rgba(11, 30, 59, 0.4);
    --transition-slow: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-white);
    font-family: 'Outfit', sans-serif;
    overflow: hidden; /* Scroll handled by parallax-wrapper */
    line-height: 1.6;
}

h1, h2, h3, .jazz-font {
    font-family: 'Playfair Display', serif;
}

/* Loader Styles */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-out, visibility 1s;
}

#loader-logo {
    width: 250px;
    margin-bottom: 2rem;
    animation: fadeInOut 2s infinite ease-in-out;
}

#loader-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 10000;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1); }
}

/* Header Styles */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 5%;
    z-index: 5000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(5,11,22,1), rgba(5,11,22,0));
    transition: var(--transition-smooth);
    opacity: 0; /* Shown after load */
}

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

.header-logo img {
    height: 40px;
}

.header-logo span {
    font-size: 1.5rem;
    color: var(--accent-gold);
    letter-spacing: 2px;
}

.nav-links a {
    color: var(--text-white);
    text-decoration: none;
    margin-left: 30px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-smooth);
}

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

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 5500;
}

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

.lang-selector {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.lang-btn {
    background-color: #1a3a63; /* Vibrant Trumpet Blue */
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.lang-btn:hover {
    background-color: var(--accent-gold);
    color: #1a3a63;
    box-shadow: 0 0 20px var(--accent-gold-bright), 0 0 40px var(--accent-gold-shadow);
    filter: brightness(1.2);
}

/* Parallax Container */
.parallax-wrapper {
    height: 100vh;
    width: 100vw;
    overflow-x: hidden;
    overflow-y: scroll; /* Force scrolling if content exists */
    perspective: 300px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.parallax-layer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
}

.parallax-bg {
    transform: translateZ(-200px) scale(2.5);
    z-index: -10;
    background: linear-gradient(to bottom, rgba(5,11,22,0.8), rgba(5,11,22,0.95)), 
                url('./img/foto_footer.webp') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    height: 100%; /* Height matched to viewport, fixed covers the scroll */
}

.parallax-content {
    transform: translateZ(0);
    z-index: 1;
    position: relative;
    pointer-events: auto;
    /* Removed large min-height to eliminate empty space at bottom */
}

/* Sections */
section {
    padding: 100px 8%;
    max-width: 100%;
    position: relative;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-full-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(5,11,22,0.3) 0%, rgba(5,11,22,0.8) 100%);
    z-index: -1;
}

.hero-text-content {
    text-align: center;
    z-index: 1;
}

.hero-title {
    font-size: 6.5rem;
    color: var(--accent-gold);
    margin: 0;
    font-weight: 900;
    line-height: 0.8;
    text-transform: uppercase;
    text-shadow: 0 10px 40px rgba(0,0,0,0.8);
    animation: slideUpFade 1.8s ease-out;
}

.hero-subtitle {
    font-size: 1.8rem;
    letter-spacing: 15px;
    margin-top: 30px;
    text-transform: uppercase;
    color: var(--text-white);
    opacity: 0.9;
    animation: fadeIn 2.5s ease-in;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent-gold);
    font-size: 0.8rem;
    letter-spacing: 3px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);}
    40% {transform: translateX(-50%) translateY(-10px);}
    60% {transform: translateX(-50%) translateY(-5px);}
}

@keyframes slideUpFade {
    0% { transform: translateY(100px); opacity: 0; filter: blur(10px); }
    100% { transform: translateY(0); opacity: 1; filter: blur(0); }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 0.9; }
}

/* Events Section */
#events {
    background: linear-gradient(180deg, transparent 0%, var(--deep-blue-dark) 50%, transparent 100%);
    position: relative;
    z-index: 10;
}

.section-title {
    font-size: 4rem;
    color: var(--accent-gold);
    margin-bottom: 4rem;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.event-card {
    background: var(--glass-bg);
    border: 1px solid rgba(197, 160, 89, 0.2);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition-smooth);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.event-card:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: var(--accent-gold);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-gold-shadow);
}

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

.event-details {
    padding: 1.5rem;
}

.event-date {
    color: var(--accent-gold);
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.event-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.event-info {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* Contact Form */
.category-title {
    font-size: 2.2rem;
    color: var(--accent-gold);
    margin-bottom: 2rem;
    margin-top: 2rem;
    letter-spacing: 5px;
    text-align: left;
    border-bottom: 1px solid rgba(197, 160, 89, 0.3);
    padding-bottom: 10px;
    display: inline-block;
}

.gallery-category-section {
    margin-bottom: 4rem;
}

.contact-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--glass-bg);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

input, textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 5px;
    color: white;
    font-family: inherit;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
}

button.submit-btn {
    background: var(--accent-gold);
    color: #000;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-smooth);
}

button.submit-btn:hover {
    background: var(--accent-gold-bright);
    transform: scale(1.05);
}

/* Floating Elements */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    right: 40px;
    background: #25d366;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3), 0 0 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: var(--transition-smooth);
    border: 1px solid rgba(255,255,255,0.1);
}

.whatsapp-btn:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4), 0 0 25px rgba(37, 211, 102, 0.6);
}

.back-to-top {
    position: fixed;
    bottom: 110px;
    right: 40px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fdfcfb 0%, #e2d1c3 1%, #c5a059 40%, #8e6d13 100%);
    color: #3b2b00; /* Dark brass contrast */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4), inset 0 2px 2px rgba(255,255,255,0.4);
    transition: var(--transition-smooth);
    border: 1px solid rgba(0,0,0,0.1);
}

.back-to-top::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5), 0 0 20px var(--accent-gold-shadow);
    background: linear-gradient(135deg, #fff 0%, #c5a059 50%, #8e6d13 100%);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: var(--transition-smooth);
}

/* Responsive & Mobile Optimizations */
@media (max-width: 991px) {
    .hero-title { font-size: 7rem; }
}

@media (max-width: 768px) {
    /* Header & Menu */
    .main-header {
        padding: 15px 5%;
        background-color: var(--bg-color); /* More opaque on mobile */
    }

    .header-logo span { font-size: 1.1rem; }
    
    .mobile-menu-toggle { display: flex; }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: var(--deep-blue-dark);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: var(--transition-smooth);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }

    .nav-links.active { right: 0; }

    .nav-links a {
        margin: 20px 0;
        font-size: 1.5rem;
    }

    .lang-selector {
        position: absolute;
        bottom: 50px;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
    }

    /* Active Hamburger */
    .mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

    /* Hero */
    .hero-title {
        font-size: 3rem;
        letter-spacing: 0;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        letter-spacing: 5px;
    }

    /* Sections */
    section { padding: 80px 5%; }
    .section-title { font-size: 2.2rem; margin-bottom: 2.5rem; }

    .events-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Form */
    .contact-container { padding: 40px 20px; }

    /* Floatings */
    .whatsapp-btn, .back-to-top {
        width: 50px;
        height: 50px;
        right: 20px;
    }
    .back-to-top { bottom: 100px; }
}

/* Redesigned Premium Footer */
.site-footer {
    position: relative;
    width: 100%;
    min-height: 400px;
    padding: 80px 5% 40px;
    overflow: hidden;
    color: var(--text-white);
    background-color: var(--bg-color);
    border-top: 2px solid var(--accent-gold);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.footer-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.footer-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4; /* Subtle background */
    filter: grayscale(0.5) brightness(0.6);
}

.footer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--bg-color) 0%, rgba(5, 11, 22, 0.4) 50%, transparent 100%);
}

/* Responsive Gallery Refinements */
@media (max-width: 768px) {
    .category-tiles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .category-card {
        height: 300px;
    }

    .category-title-big {
        font-size: 1.8rem;
    }

    .mosaic-header h2 {
        font-size: 1.6rem !important;
        letter-spacing: 3px !important;
    }

    .events-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .back-btn {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
}

.footer-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

.footer-branding {
    margin-bottom: 3rem;
    animation: fadeIn 1.5s ease-out;
}

.footer-logo {
    height: 160px; /* Doubled from 80px */
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 15px var(--accent-gold-shadow));
    animation: goldGlow 3s infinite alternate ease-in-out;
}

@keyframes goldGlow {
    0% {
        filter: drop-shadow(0 0 10px rgba(197, 160, 89, 0.4)) brightness(1);
    }
    100% {
        filter: drop-shadow(0 0 30px rgba(197, 160, 89, 0.9)) brightness(1.2);
    }
}

.footer-branding h3 {
    font-size: 2.5rem;
    color: var(--accent-gold);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    color: var(--text-white);
    letter-spacing: 6px;
    text-transform: uppercase;
    font-weight: 300;
    opacity: 0.9;
    margin-bottom: 2.5rem;
}

.footer-social-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}

.footer-btn {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.1) 0%, rgba(197, 160, 89, 0.05) 100%);
    border: 1px solid var(--accent-gold);
    border-radius: 50px;
    color: var(--accent-gold);
    font-weight: 700;
    letter-spacing: 1.5px;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3), inset 0 0 10px rgba(197, 160, 89, 0.1);
    position: relative;
    overflow: hidden;
}

.footer-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(230, 194, 122, 0.2), transparent);
    transition: 0.5s;
}

.footer-btn:hover::before {
    left: 100%;
}

.footer-btn .btn-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}

.footer-btn:hover {
    transform: translateY(-5px) scale(1.05);
    background: linear-gradient(135deg, var(--accent-gold) 0%, #8e6d13 100%);
    color: #fff; /* Solid contrast on hover */
    border-color: var(--accent-gold-bright);
    box-shadow: 0 10px 25px var(--accent-gold-shadow);
}

/* Gold Engraving Effect for Footer Bottom */
.footer-copy {
    border-top: 1px solid rgba(197, 160, 89, 0.3);
    padding-top: 2rem;
    position: relative;
}

.footer-copy::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--accent-gold);
    box-shadow: 0 0 15px var(--accent-gold);
}

.footer-copy p {
    color: var(--text-gray);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .footer-branding h3 { font-size: 1.8rem; }
    .footer-social-buttons { gap: 10px; }
    .footer-btn { padding: 10px 15px; font-size: 0.8rem; }
    .footer-btn .btn-icon svg { width: 18px; height: 18px; }
}

/* Gallery Page Premium Styles */
.gallery-hero {
    padding: 150px 8% 80px;
    text-align: center;
}

.category-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    margin-bottom: 80px;
}

.category-card {
    position: relative;
    height: 450px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(197, 160, 89, 0.2);
    transition: var(--transition-smooth);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.category-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--accent-gold);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 25px var(--accent-gold-shadow);
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
    filter: brightness(0.6) grayscale(0.2);
}

.category-card:hover img {
    filter: brightness(0.8) grayscale(0);
    transform: scale(1.1);
}

.category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px;
    background: linear-gradient(to top, rgba(5,11,22,1), transparent);
    z-index: 2;
}

.category-title-big {
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin: 0;
    letter-spacing: 5px;
    text-transform: uppercase;
}

.mosaic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    opacity: 0;
    transform: translateY(-20px);
    transition: var(--transition-smooth);
}

.mosaic-header.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-btn {
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 2px;
    transition: var(--transition-smooth);
}

.back-btn:hover {
    background: var(--accent-gold);
    color: #000;
}

/* Lightbox Styles */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#lightbox-img {
    max-height: 90vh;
    max-width: 90vw;
    box-shadow: 0 0 50px rgba(0,0,0,1);
    border: 1px solid rgba(255,255,255,0.1);
    animation: zoomIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-lightbox {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 3rem;
    color: var(--accent-gold);
    font-weight: 300;
}

/* Image Captions (Cartelitos) */
.gallery-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: galleryFadeIn 0.8s ease forwards;
}

.image-caption {
    background: rgba(197, 160, 89, 0.1);
    border-left: 3px solid var(--accent-gold);
    color: #fff;
    padding: 8px 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: inherit;
    min-height: 40px;
    display: flex;
    align-items: center;
}

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