/* ========== VARIABLES & RESET ========== */
:root {
    --rojo-primario: #C8102E;
    --rojo-medio: #E53935;
    --rojo-oscuro: #8B0000;
    --dorado-primario: #F4C542;
    --dorado-medio: #FFD700;
    --dorado-oscuro: #B8860B;
    --negro-suave: #1A1A1A;
    --negro: #000000;
    --blanco: #FFFFFF;
    --sombra: 0 8px 32px rgba(0,0,0,0.25);
    --sombra-hover: 0 12px 40px rgba(200,16,46,0.3);
    --radius: 16px;
    --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--negro);
    color: var(--blanco);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

/* ========== LOADING SCREEN ========== */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--negro);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-logo {
    width: 280px;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-spinner {
    display: none;
}

.loading-bar-container {
    margin-top: 32px;
    width: 260px;
    height: 4px;
    background: rgba(244,197,66,0.15);
    border-radius: 2px;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--dorado-oscuro), var(--dorado-primario));
    border-radius: 2px;
    animation: loadBar 3s ease-in-out forwards;
}

@keyframes loadBar {
    0%   { width: 0%; }
    30%  { width: 45%; }
    60%  { width: 70%; }
    85%  { width: 90%; }
    100% { width: 100%; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.7; }
}

/* ========== ANIMACIONES FADE / SCROLL ========== */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* ========== HEADER ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(244,197,66,0.15);
    padding: 24px 0;
    transition: var(--transition);
}

.header.scrolled {
    padding: 14px 0;
    background: rgba(0,0,0,0.98);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.header-logo-link {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    z-index: 2;
}

.header-logo {
    height: 100px;
    transition: var(--transition);
    filter: drop-shadow(0 0 14px rgba(244,197,66,0.4));
    animation: logoFloat 3s ease-in-out infinite;
}

.header.scrolled .header-logo {
    height: 68px;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1;
    z-index: 3;
}

.nav-left {
    justify-content: flex-start;
}

.nav-right {
    justify-content: flex-end;
}

.nav-left a,
.nav-right a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.nav-left a i,
.nav-right a i {
    margin-right: 6px;
}

.nav-left a::after,
.nav-right a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--dorado-primario);
    transition: width 0.3s ease;
}

.nav-left a:hover,
.nav-right a:hover {
    color: var(--dorado-primario);
}

.nav-left a:hover::after,
.nav-right a:hover::after {
    width: 100%;
}

.nav-cta {
    background: linear-gradient(135deg, var(--rojo-primario), var(--rojo-medio));
    color: #FFFFFF !important;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(200,16,46,0.3);
    transition: all 0.4s ease;
}

.nav-cta::after {
    display: none !important;
}

.nav-cta:hover {
    color: #000000 !important;
    background: linear-gradient(135deg, #F4C542, #FFD700) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(244,197,66,0.5);
}

/* ========== HERO ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 140px 24px 80px;
    background: var(--negro);
    position: relative;
    overflow: hidden;
}

/* Glow de fondo */
.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200,16,46,0.18) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(80px);
    animation: glowPulse 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

/* Partículas flotantes */
.hero-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--dorado-primario);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat linear infinite;
}

.hero-particles span:nth-child(1)  { left: 10%; animation-duration: 8s;  animation-delay: 0s;   }
.hero-particles span:nth-child(2)  { left: 20%; animation-duration: 10s; animation-delay: 1s;   width: 3px; height: 3px; }
.hero-particles span:nth-child(3)  { left: 35%; animation-duration: 7s;  animation-delay: 2s;   }
.hero-particles span:nth-child(4)  { left: 50%; animation-duration: 9s;  animation-delay: 0.5s; width: 5px; height: 5px; }
.hero-particles span:nth-child(5)  { left: 65%; animation-duration: 11s; animation-delay: 3s;   }
.hero-particles span:nth-child(6)  { left: 75%; animation-duration: 8s;  animation-delay: 1.5s; width: 3px; height: 3px; }
.hero-particles span:nth-child(7)  { left: 85%; animation-duration: 10s; animation-delay: 2.5s; }
.hero-particles span:nth-child(8)  { left: 45%; animation-duration: 12s; animation-delay: 4s;   width: 6px; height: 6px; }
.hero-particles span:nth-child(9)  { left: 5%;  animation-duration: 9s;  animation-delay: 1s;   }
.hero-particles span:nth-child(10) { left: 90%; animation-duration: 7s;  animation-delay: 3.5s; width: 3px; height: 3px; }

@keyframes particleFloat {
    0%   { bottom: -10px; opacity: 0; }
    10%  { opacity: 0.6; }
    90%  { opacity: 0.6; }
    100% { bottom: 110%; opacity: 0; }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 820px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(244,197,66,0.1);
    border: 1px solid rgba(244,197,66,0.3);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--dorado-primario);
    margin-bottom: 28px;
    animation: fadeInDown 1s ease-out 0.3s both;
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.8rem);
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    animation: fadeInDown 1s ease-out 0.5s both;
}

.hero h1 .gradient-text {
    background: linear-gradient(135deg, var(--dorado-primario), var(--dorado-medio), var(--rojo-medio));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.6);
    max-width: 580px;
    margin: 0 auto 40px;
    animation: fadeInDown 1s ease-out 0.7s both;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInDown 1s ease-out 0.9s both;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.05rem;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 56px;
    animation: fadeInDown 1s ease-out 1.1s both;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.hero-stat-number {
    font-size: 1.4rem;
    color: var(--dorado-primario);
    filter: drop-shadow(0 0 6px rgba(244,197,66,0.3));
}

.hero-stat-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.45);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Scroll indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.25);
    font-size: 1.2rem;
    animation: scrollBounce 2s ease-in-out infinite;
    z-index: 2;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.3; }
    50% { transform: translateX(-50%) translateY(10px); opacity: 0.7; }
}

/* ========== BOTONES ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.4s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--rojo-primario), var(--rojo-medio));
    color: var(--blanco);
    box-shadow: 0 4px 20px rgba(200,16,46,0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #F4C542, #FFD700) !important;
    color: #000000 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(244,197,66,0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--dorado-primario);
    border: 2px solid rgba(244,197,66,0.4);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #F4C542, #FFD700) !important;
    color: #000000 !important;
    border-color: #F4C542;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(244,197,66,0.5);
}

/* ========== SECCIÓN EN VIVO ========== */
.section {
    padding: 80px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    margin-bottom: 12px;
}

.section-header p {
    color: rgba(255,255,255,0.55);
    font-size: 1.05rem;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(229,57,53,0.15);
    border: 1px solid rgba(229,57,53,0.4);
    color: var(--rojo-medio);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.live-badge .live-dot {
    width: 10px;
    height: 10px;
    background: var(--rojo-medio);
    border-radius: 50%;
    animation: blink 1s ease-in-out infinite;
    box-shadow: 0 0 8px var(--rojo-medio);
}

.live-container {
    background: linear-gradient(135deg, rgba(200,16,46,0.08), rgba(26,26,26,0.9));
    border: 1px solid rgba(200,16,46,0.2);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.live-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--rojo-medio), transparent);
    animation: liveScan 3s linear infinite;
}

@keyframes liveScan {
    to { left: 100%; }
}

.live-video-placeholder {
    background: rgba(0,0,0,0.5);
    border-radius: 12px;
    padding: 80px 24px;
    margin: 24px 0;
    border: 1px dashed rgba(255,255,255,0.1);
}

.live-video-placeholder p {
    color: rgba(255,255,255,0.4);
    font-size: 1.1rem;
}

/* ========== GRID DE RIFAS ========== */
.rifas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

.rifa-card {
    background: linear-gradient(145deg, rgba(26,26,26,0.95), rgba(0,0,0,0.9));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.rifa-card:hover {
    transform: translateY(-6px);
    border-color: rgba(244,197,66,0.3);
    box-shadow: var(--sombra-hover);
}

.rifa-card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.rifa-card:hover .rifa-card-img {
    transform: scale(1.05);
}

.rifa-card-img-wrapper {
    overflow: hidden;
    position: relative;
}

.rifa-card-img-wrapper .rifa-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(200,16,46,0.9);
    color: var(--blanco);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.rifa-card-body {
    padding: 24px;
}

.rifa-card-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--blanco);
}

.rifa-card-body .rifa-desc {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rifa-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.rifa-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dorado-primario);
}

.rifa-price small {
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255,255,255,0.4);
}

.rifa-date {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Barra de progreso */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dorado-oscuro), var(--dorado-primario));
    border-radius: 3px;
    transition: width 1.2s ease-out;
}

.progress-text {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 16px;
}

.rifa-card .btn {
    width: 100%;
    justify-content: center;
}

/* ========== SECCIÓN CÓMO FUNCIONA ========== */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-top: 40px;
}

.step-card {
    text-align: center;
    padding: 40px 24px;
    background: rgba(26,26,26,0.6);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius);
    transition: var(--transition);
}

.step-card:hover {
    border-color: rgba(244,197,66,0.2);
    background: rgba(26,26,26,0.8);
}

.step-icon {
    font-size: 2rem;
    color: var(--dorado-primario);
    margin-bottom: 12px;
    filter: drop-shadow(0 0 8px rgba(244,197,66,0.3));
}

.step-number {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--rojo-primario), var(--rojo-oscuro));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 auto 20px;
    box-shadow: 0 4px 16px rgba(200,16,46,0.3);
}

.step-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.step-card p {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}

/* ========== WHY HERO ========== */
.why-hero {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 160px 24px 60px;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(244,197,66,0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 50%, rgba(200,16,46,0.1) 0%, transparent 60%),
        var(--negro);
}

.why-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    animation: fadeInDown 1s ease-out 0.3s both;
}

.why-hero p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.6);
    max-width: 550px;
    margin: 0 auto;
    animation: fadeInDown 1s ease-out 0.5s both;
}

/* ========== FOOTER ========== */
.footer {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 16px 24px;
    text-align: center;
}

.footer p {
    color: rgba(255,255,255,0.3);
    font-size: 0.78rem;
}

/* ========== NO HAY RIFAS ========== */
.empty-state {
    text-align: center;
    padding: 80px 24px;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    color: rgba(255,255,255,0.4);
    font-size: 1.1rem;
}

/* ========== FONT AWESOME SPACING ========== */
.btn i,
.nav-links i,
.footer-links i,
.section-header h2 i,
.rifa-date i {
    margin-right: 6px;
}

.rifa-tag i {
    margin-right: 4px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .nav-left,
    .nav-right {
        display: none;
    }

    .header-inner {
        justify-content: center;
    }

    .rifas-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-stats {
        gap: 24px;
    }

    .hero-stat-number {
        font-size: 1.1rem;
    }

    .live-container {
        padding: 24px;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .hero-glow {
        width: 350px;
        height: 350px;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========== SCROLLBAR CUSTOM ========== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--negro);
}

::-webkit-scrollbar-thumb {
    background: rgba(244,197,66,0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(244,197,66,0.5);
}
