/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(#3F304C 0%, #9856D2 90%);
    color: #EEEBF1;
    font-family: "P", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Fuentes */
@font-face {
    font-family: "P";
    src: url("../fonts/coolveticarg.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "PT";
    src: url("../fonts/coolveticacompressedhv.otf") format("opentype");
    font-weight: bold;
    font-style: normal;
}

/* Overlay de textura de grano */
body::after {
    content: "";
    background-image: url("https://upload.wikimedia.org/wikipedia/commons/7/76/1k_Dissolve_Noise_Texture.png");
    height: 200%;
    width: 200%;
    position: fixed;
    top: 0;
    left: 0;
    opacity: 0.05;
    animation: animateGrain 8s steps(10) infinite;
    pointer-events: none;
    z-index: 9999;
}

@keyframes animateGrain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, -20%); }
    30% { transform: translate(-5%, -10%); }
    40% { transform: translate(-15%, -20%); }
    50% { transform: translate(-5%, -10%); }
    60% { transform: translate(-15%, -20%); }
    70% { transform: translate(-5%, -10%); }
    80% { transform: translate(-15%, -20%); }
    90% { transform: translate(-5%, -10%); }
}

/* Container Principal */
.container {
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 10;
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Logo (opcional si se vuelve a poner) */
.logo-container {
    margin-bottom: 1rem;
}

.logo-img {
    max-width: 250px;
    height: auto;
    object-fit: contain;
}

/* Títulos */
.main-title {
    font-family: "P", sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: bold;
    line-height: 1.1;
    color: #EEEBF1;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-family: "P", sans-serif;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    opacity: 0.9;
    margin-bottom: 2.4rem; /* Más cerca de descarga */
}

.download-text {
    font-family: "P", sans-serif;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: bold;
    margin-bottom: 0.2rem; /* Más pegado a botones */
    color: #FFFFFF; /* Blanco puro */
    text-transform: uppercase;
}

.download-text .highlight-purple {
    color: #FFFFFF; /* Blanco también para VIB3S */
}

.highlight-purple {
    color: #9856D2; /* El lila de la marca (para otros usos) */
}

/* Botones de Descarga */
.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-items: center;
    width: 100%;
    margin-top: -0.2rem;
}

.store-link {
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    width: auto;
    max-width: 100%;
}

.store-link:hover {
    transform: translateY(-5px);
    opacity: 0.9;
}

.store-img {
    width: auto;
    object-fit: contain;
    display: block;
    max-width: none; /* Asegura que no tenga límite de ancho */
}

/* Ajuste específico para igualar tamaños visuales */
.ios-img {
    height: 156px;
}

.android-img {
    height: 50px !important;
}

/* Footer simple */
.footer {
    position: absolute;
    bottom: 2rem;
    font-family: "P", sans-serif;
    font-size: 0.8rem;
    opacity: 0.6;
    z-index: 10;
}

/* Estilos para popup (copiado de shark/style.css) */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(16, 16, 22, 0.78);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: #1A171B;
    padding: 3em;
    border-radius: 20px;
    text-align: left;
    max-width: 700px;
    width: 90%;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    z-index: 100000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2em;
}

.popup-overlay.active .popup-content {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #EEEBF1;
    transition: color 0.3s ease;
    z-index: 100001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    color: #FFFFFF;
}

.popup-text-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content p {
    font-family: "PT", sans-serif;
    font-size: 75px;
    color: #EEEBF1;
    margin-bottom: 0;
    line-height: 0.9;
    font-weight: 400;
    text-transform: uppercase;
}

.highlight-purple {
    color: #9856D2;
}

.popup-qr-container {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
}

.popup-qr {
    width: 280px;
    height: 280px;
    border-radius: 18px;
    background: #ffffff;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    object-fit: contain;
    animation: qrPulse 2.2s ease-in-out infinite;
}

@keyframes qrPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.022); }
}

.scan-text {
    font-family: "P", sans-serif;
    font-size: 34px;
    color: #EEEBF1;
    margin-bottom: 0;
    font-weight: 600;
}

/* Media Queries - Móvil */
@media (max-width: 767px) {
    .container {
        min-height: calc(100vh - 4.5rem);
        justify-content: center;
        gap: 0.8rem;
        padding: 1.15rem;
    }

    .text-content {
        margin-top: 2rem; /* Baja el bloque para centrarlo mejor en la pantalla */
    }

    .main-title {
        margin-bottom: 0.25rem;
    }

    .subtitle {
        margin-bottom: 1.5rem;
    }

    .download-text {
        margin-bottom: 0.05rem;
    }

    .ios-img {
        height: 136px;
    }
    .android-img {
        height: 46px !important;
    }
    
    /* Separar más "Descarga VIB3S" y los botones en móvil */
    .download-buttons {
        margin-top: 0;
        gap: 0.08rem; /* Mucho más juntos en móvil */
    }
}

/* Media Queries - Desktop */
@media (min-width: 768px) {
    .download-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 0.55rem; /* Juntos pero con aire mínimo */
        align-items: center; /* Alineación vertical centrada */
        width: auto;
    }
    
    .ios-img {
        height: 156px;
    }

    .android-img {
        height: 60px !important; /* Google Play un pelín más pequeño en PC */
    }
}

/* Responsive para popup */
@media (max-width: 900px) {
    .popup-content {
        padding: 2em;
        max-width: 500px;
        flex-direction: column;
        text-align: center;
        gap: 1.5em;
    }
    
    .popup-text-content {
        order: 1;
    }
    
    .popup-qr-container {
        order: 2;
    }
    
    .popup-content p {
        font-size: 36px;
    }
    
    .popup-qr {
        width: 230px;
        height: 230px;
    }
    
    .scan-text {
        font-size: 28px;
    }
}
