/* Contador - Elegante Minimalista Mejorado */
.contador {
    background: var(--bg-dark-light);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.contador::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(212, 196, 168, 0.05) 0%,
        rgba(201, 169, 110, 0.02) 50%,
        transparent 70%
    );
    animation: rotateGradient 25s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.contador-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.contador-header {
    text-align: center;
    margin-bottom: 4rem;
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
}

.contador-header h2 {
    font-family: var(--font-script);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    color: var(--accent-beige);
    font-weight: 400;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.contador-subtitle {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--text-muted);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.5px;
    margin: 0;
}

.countdown-wrapper {
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s both;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(1rem, 3vw, 2rem);
    max-width: 800px;
    margin: 0 auto 3rem;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: linear-gradient(135deg, 
        rgba(21, 21, 21, 0.9) 0%, 
        rgba(26, 26, 26, 0.8) 100%);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
    position: relative;
}

.countdown-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(212, 196, 168, 0.03) 50%, 
        transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.countdown-grid:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(212, 196, 168, 0.1);
    border-color: rgba(212, 196, 168, 0.2);
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.time-card {
    text-align: center;
    transition: var(--transition-smooth);
    width: 100%;
    position: relative;
}

.time-card:hover {
    transform: scale(1.05);
}

.time-card::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle at center, 
        rgba(212, 196, 168, 0.1) 0%, 
        transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: -1;
}

.time-card:hover::before {
    opacity: 1;
}

.time-number {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 8vw, 4rem);
    color: var(--accent-beige);
    font-weight: 400;
    line-height: 1;
    margin-bottom: 0.5rem;
    position: relative;
    transition: var(--transition-smooth);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.time-number::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-accent), transparent);
    transition: var(--transition-smooth);
}

.time-card:hover .time-number {
    color: var(--gold-accent);
    transform: translateY(-2px);
}

.time-card:hover .time-number::after {
    width: 100%;
}

.time-label {
    font-family: var(--font-sans);
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.8;
    transition: var(--transition-smooth);
}

.time-card:hover .time-label {
    color: var(--accent-beige);
    opacity: 1;
}

.countdown-message {
    text-align: center;
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s both;
    max-width: 600px;
    margin: 0 auto;
}

.countdown-message .script-text {
    font-family: var(--font-script);
    font-size: clamp(1.3rem, 3.5vw, 1.8rem);
    color: var(--gold-accent);
    font-weight: 400;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
}

/* Animaciones mejoradas */
@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

/* Efectos de actualización de números mejorados */
.time-number.updating {
    animation: numberFlip 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes numberFlip {
    0% {
        transform: rotateY(0deg);
        opacity: 1;
    }
    50% {
        transform: rotateY(90deg);
        opacity: 0.7;
        color: var(--gold-accent);
        text-shadow: 0 0 15px rgba(201, 169, 110, 0.5);
    }
    100% {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

/* Estados especiales mejorados */
.countdown-expired .time-number {
    color: var(--gold-accent);
    animation: celebrate 2s infinite ease-in-out;
}

.countdown-expired .countdown-message .script-text {
    color: var(--accent-beige);
}

.countdown-expired .countdown-message .script-text::after {
    content: ' ✨';
}

@keyframes celebrate {
    0%, 100% {
        transform: scale(1);
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: scale(1.08);
        text-shadow: 0 0 20px rgba(212, 196, 168, 0.6);
    }
}

/* Responsive Design Mejorado */
@media (max-width: 992px) {
    .contador {
        min-height: 90vh;
    }
    
    .countdown-grid {
        max-width: 700px;
        gap: 1.5rem;
    }
    
    .time-number {
        font-size: clamp(2.2rem, 7vw, 3.5rem);
    }
}

@media (max-width: 768px) {
    .contador {
        min-height: auto;
        padding: 3rem 0;
    }
    
    .contador-header {
        margin-bottom: 3rem;
    }
    
    .countdown-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        padding: 2rem 1.5rem;
        margin-bottom: 2.5rem;
        max-width: 500px;
    }
    
    .time-unit {
        padding: 1.5rem 1rem;
        background: rgba(10, 10, 10, 0.6);
        border: 1px solid var(--border-subtle);
        transition: var(--transition-smooth);
        position: relative;
        overflow: hidden;
    }
    
    .time-unit::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, 
            rgba(212, 196, 168, 0.02) 0%, 
            transparent 100%);
        opacity: 0;
        transition: var(--transition-smooth);
    }
    
    .time-unit:hover {
        background: rgba(10, 10, 10, 0.8);
        border-color: rgba(212, 196, 168, 0.2);
        transform: translateY(-3px);
    }
    
    .time-unit:hover::before {
        opacity: 1;
    }
    
    .time-number {
        font-size: clamp(2rem, 6vw, 3rem);
        margin-bottom: 0.5rem;
    }
    
    .time-label {
        font-size: clamp(0.75rem, 2vw, 0.9rem);
    }
}

@media (max-width: 480px) {
    .contador {
        padding: 2rem 0;
    }
    
    .contador-header {
        margin-bottom: 2rem;
    }
    
    .countdown-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
        margin-bottom: 2rem;
        max-width: 300px;
    }
    
    .time-unit {
        padding: 1.25rem 0.75rem;
        margin: 0;
    }
    
    .time-number {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
        margin-bottom: 0.25rem;
    }
    
    .time-label {
        font-size: 0.8rem;
        letter-spacing: 0.5px;
    }
    
    .countdown-message .script-text {
        font-size: clamp(1.1rem, 4vw, 1.4rem);
        padding: 0 1rem;
    }
}

@media (max-width: 320px) {
    .countdown-grid {
        padding: 1rem 0.5rem;
        max-width: 280px;
    }
    
    .time-unit {
        padding: 1rem 0.5rem;
    }
    
    .time-number {
        font-size: 1.6rem;
    }
    
    .time-label {
        font-size: 0.75rem;
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .countdown-separator,
    .time-number.updating,
    .contador::before,
    .countdown-expired .time-number {
        animation: none;
    }
    
    .countdown-grid:hover,
    .time-card:hover {
        transform: none;
    }
}

/* Estados de carga mejorados */
.loading .countdown-wrapper {
    opacity: 0;
    transform: translateY(50px);
}

.loaded .countdown-wrapper {
    opacity: 1;
    transform: translateY(0);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Efectos adicionales para pantallas grandes */
@media (min-width: 1200px) {
    .countdown-grid {
        padding: 3.5rem;
    }
    
    .time-number {
        font-size: 4.5rem;
    }
    
    .time-label {
        font-size: 1.1rem;
    }
}

/* Estados especiales mejorados */
.contador.very-close {
    background: linear-gradient(135deg, 
        var(--bg-dark-light) 0%, 
        rgba(201, 169, 110, 0.05) 100%);
}

.contador.final-countdown::before {
    animation-duration: 15s;
    background: radial-gradient(
        circle at center,
        rgba(212, 196, 168, 0.08) 0%,
        rgba(201, 169, 110, 0.03) 50%,
        transparent 70%
    );
}

/* Animación de partículas de celebración */
@keyframes celebrate-particle {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-100px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) scale(0);
    }
}

/* Estados de celebración */
.celebration-content {
    text-align: center;
    padding: 2rem;
}

.celebration-emoji {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    animation: bounce 1s infinite;
}

.celebration-text {
    font-family: var(--font-script);
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--gold-accent);
    display: block;
    margin-bottom: 0.5rem;
}

.celebration-subtitle {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--accent-beige);
    font-style: italic;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-15px);
    }
    70% {
        transform: translateY(-7px);
    }
    90% {
        transform: translateY(-3px);
    }
}

/* Estados de error */
.error-message {
    text-align: center;
    padding: 2rem;
    color: #ff6b6b;
}

/* Transiciones del mensaje */
.countdown-message .script-text {
    transition: opacity 0.3s ease-in-out;
}

/* Layout móvil optimizado */
.contador.mobile-layout .countdown-grid {
    gap: 1rem;
}

/* Contador Simple - Versión Minimalista Elegante */
.contador-simple {
    background: var(--bg-dark-light);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.contador-simple::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(212, 196, 168, 0.04) 0%,
        rgba(201, 169, 110, 0.015) 50%,
        transparent 70%
    );
    animation: rotateGradient 30s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.contador-simple .contador-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contador-simple .contador-header {
    text-align: center;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
}

.contador-simple .contador-header h2 {
    font-family: var(--font-script);
    font-size: clamp(2.2rem, 5vw, 3rem);
    color: var(--accent-beige);
    font-weight: 400;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.contador-simple .contador-subtitle {
    font-family: var(--font-serif);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-muted);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Countdown Simple Styles */
.countdown-simple {
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s both;
    margin-bottom: 3rem;
}

.time-unit-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, 
        rgba(21, 21, 21, 0.95) 0%, 
        rgba(26, 26, 26, 0.85) 100%);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    transition: var(--transition-smooth);
    overflow: hidden;
}

.time-unit-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 40%, 
        rgba(212, 196, 168, 0.05) 50%, 
        transparent 60%);
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transition: var(--transition-smooth);
}

.time-unit-large:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(212, 196, 168, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(212, 196, 168, 0.3);
}

.time-unit-large:hover::before {
    opacity: 1;
}

.time-unit-large .particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gold-accent);
    border-radius: 50%;
    opacity: 0;
    animation: floatParticle 3s ease-in-out infinite;
}

.time-unit-large .particle:nth-child(1) {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.time-unit-large .particle:nth-child(2) {
    top: 70%;
    right: 20%;
    animation-delay: 1s;
}

.time-unit-large .particle:nth-child(3) {
    bottom: 30%;
    left: 25%;
    animation-delay: 2s;
}

.time-unit-large .label {
    font-family: var(--font-serif);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.8;
    transition: var(--transition-smooth);
}

.time-unit-large:hover .label {
    color: var(--accent-beige);
    opacity: 1;
    transform: translateY(-2px);
}

.time-unit-large .number {
    font-family: var(--font-serif);
    font-size: clamp(4rem, 15vw, 8rem);
    color: var(--accent-beige);
    font-weight: 300;
    line-height: 1;
    position: relative;
    transition: var(--transition-smooth);
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(212, 196, 168, 0.3);
    margin: 0.5rem 0;
}

.time-unit-large .number::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--gold-accent), 
        transparent);
    transition: var(--transition-smooth);
    border-radius: 2px;
}

.time-unit-large:hover .number {
    color: var(--gold-accent);
    transform: scale(1.05);
    text-shadow: 
        2px 2px 6px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(201, 169, 110, 0.5);
}

.time-unit-large:hover .number::before {
    width: 80%;
}

/* Animaciones específicas para contador simple */
@keyframes floatParticle {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    10% {
        opacity: 1;
        transform: translateY(-10px) scale(1);
    }
    90% {
        opacity: 0.5;
        transform: translateY(-30px) scale(0.8);
    }
}

@keyframes pulseSimple {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 10px 30px rgba(0, 0, 0, 0.3),
            0 0 0 1px rgba(212, 196, 168, 0.1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 
            0 15px 40px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(212, 196, 168, 0.2);
    }
}

/* Estados especiales para contador simple */
.contador-simple.countdown-expired .time-unit-large {
    animation: pulseSimple 2s infinite ease-in-out;
}

.contador-simple.countdown-expired .number {
    color: var(--gold-accent);
    animation: celebrateSimple 3s infinite ease-in-out;
}

.contador-simple.countdown-expired .label {
    color: var(--gold-accent);
    opacity: 1;
}

@keyframes celebrateSimple {
    0%, 100% {
        transform: scale(1);
        text-shadow: 
            2px 2px 4px rgba(0, 0, 0, 0.4),
            0 0 20px rgba(212, 196, 168, 0.3);
    }
    50% {
        transform: scale(1.1);
        text-shadow: 
            2px 2px 8px rgba(0, 0, 0, 0.6),
            0 0 40px rgba(201, 169, 110, 0.6);
    }
}

/* Efecto de actualización para número simple */
.time-unit-large .number.updating {
    animation: numberFlipSimple 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes numberFlipSimple {
    0% {
        transform: rotateX(0deg);
        opacity: 1;
    }
    50% {
        transform: rotateX(90deg);
        opacity: 0.5;
        color: var(--gold-accent);
    }
    100% {
        transform: rotateX(0deg);
        opacity: 1;
    }
}

/* Mensaje del contador simple */
.contador-simple .countdown-message {
    text-align: center;
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s both;
    max-width: 500px;
    margin: 0 auto;
}

.contador-simple .countdown-message .script-text {
    font-family: var(--font-script);
    font-size: clamp(1.4rem, 4vw, 2rem);
    color: var(--gold-accent);
    font-weight: 400;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
    padding: 0 1rem;
}

/* Estados de celebración para contador simple */
.contador-simple.celebration .time-unit-large {
    background: linear-gradient(135deg, 
        rgba(21, 21, 21, 0.9) 0%, 
        rgba(201, 169, 110, 0.1) 100%);
    border-color: rgba(201, 169, 110, 0.3);
}

.contador-simple.celebration .number {
    animation: celebrateSimple 2s infinite ease-in-out;
}

/* Responsive Design para Contador Simple */
@media (max-width: 768px) {
    .contador-simple {
        min-height: 80vh;
        padding: 2rem 0;
    }
    
    .contador-simple .contador-header {
        margin-bottom: 2rem;
    }
    
    .time-unit-large {
        padding: 2.5rem 1.5rem;
        margin: 0 auto;
        max-width: 300px;
    }
    
    .time-unit-large .number {
        font-size: clamp(3.5rem, 12vw, 6rem);
    }
    
    .time-unit-large .label {
        font-size: clamp(0.8rem, 2.5vw, 1rem);
        margin-bottom: 1rem;
    }
    
    .contador-simple .countdown-message .script-text {
        font-size: clamp(1.2rem, 4vw, 1.6rem);
    }
}

@media (max-width: 480px) {
    .contador-simple {
        min-height: 70vh;
        padding: 1.5rem 0;
    }
    
    .contador-simple .contador-header {
        margin-bottom: 1.5rem;
    }
    
    .time-unit-large {
        padding: 2rem 1rem;
        max-width: 250px;
        border-radius: 15px;
    }
    
    .time-unit-large .number {
        font-size: clamp(3rem, 10vw, 4.5rem);
    }
    
    .time-unit-large .label {
        font-size: 0.85rem;
        margin-bottom: 0.8rem;
    }
    
    .time-unit-large:hover {
        transform: translateY(-5px);
    }
    
    .contador-simple .countdown-message .script-text {
        font-size: clamp(1.1rem, 4vw, 1.4rem);
        padding: 0 0.5rem;
    }
}

@media (max-width: 320px) {
    .time-unit-large {
        padding: 1.5rem 0.8rem;
        max-width: 220px;
    }
    
    .time-unit-large .number {
        font-size: 2.8rem;
    }
    
    .time-unit-large .label {
        font-size: 0.8rem;
    }
}

/* Mejoras de accesibilidad para contador simple */
@media (prefers-reduced-motion: reduce) {
    .contador-simple::before,
    .time-unit-large .particle,
    .time-unit-large .number.updating,
    .contador-simple.countdown-expired .number,
    .contador-simple.celebration .number {
        animation: none;
    }
    
    .time-unit-large:hover {
        transform: none;
    }
}

/* Estados de carga para contador simple */
.contador-simple.loading .countdown-simple {
    opacity: 0;
    transform: translateY(30px);
}

.contador-simple.loaded .countdown-simple {
    opacity: 1;
    transform: translateY(0);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Efectos adicionales para pantallas grandes en contador simple */
@media (min-width: 1200px) {
    .contador-simple .contador-content {
        max-width: 700px;
    }
    
    .time-unit-large {
        padding: 4rem 3rem;
    }
    
    .time-unit-large .number {
        font-size: 9rem;
    }
    
    .time-unit-large .label {
        font-size: 1.2rem;
    }
}

/* Estados de proximidad para contador simple */
.contador-simple.very-close {
    background: linear-gradient(135deg, 
        var(--bg-dark-light) 0%, 
        rgba(201, 169, 110, 0.08) 100%);
}

.contador-simple.final-countdown::before {
    animation-duration: 20s;
    background: radial-gradient(
        circle at center,
        rgba(212, 196, 168, 0.06) 0%,
        rgba(201, 169, 110, 0.02) 50%,
        transparent 70%
    );
}

/* Transiciones suaves para el mensaje del contador simple */
.contador-simple .countdown-message .script-text {
    transition: all 0.3s ease-in-out;
}

.contador-simple:hover .countdown-message .script-text {
    transform: translateY(-2px);
}

/* Layout móvil optimizado para contador simple */
.contador-simple.mobile-layout .time-unit-large {
    margin: 0 1rem;
}