/* Contador - Elegante Minimalista Mejorado - TEMA CLARO */
.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(139, 115, 85, 0.08) 0%,
        rgba(139, 105, 20, 0.04) 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: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.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(248, 248, 248, 0.9) 0%, 
        rgba(242, 242, 242, 0.8) 100%);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-card);
    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(139, 115, 85, 0.06) 50%, 
        transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.countdown-grid:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(139, 115, 85, 0.3);
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(139, 115, 85, 0.15);
    transition: var(--transition-smooth);
}

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

.time-unit:hover {
    background: var(--accent-champagne);
    border-color: var(--accent-beige);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 115, 85, 0.25);
}

.time-unit:hover::before {
    opacity: 0.1;
}

.time-unit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        var(--accent-beige) 0%, 
        var(--bg-card) 100%);
    border-radius: 12px;
    opacity: 0.05;
    transition: var(--transition-smooth);
    z-index: -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: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.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.1);
    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 8px rgba(139, 105, 20, 0.4);
    }
    100% {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

/* Estados especiales mejorados */
.countdown-expired {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 300px;
}

.countdown-expired .time-unit {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.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: ' ✨';
}

/* Para el contador completo cuando expira */
.countdown-grid.final-day {
    display: flex;
    justify-content: center;
    align-items: center;
    grid-template-columns: 1fr;
}

@keyframes celebrate {
    0%, 100% {
        transform: scale(1);
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.08);
        text-shadow: 0 0 15px rgba(139, 115, 85, 0.4);
    }
}

/* Estados de celebración adaptados - MEJORADO */
.celebration-content {
    text-align: center;
    padding: 2rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.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;
    width: 100%;
}

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

/* Animación de rebote para el emoji */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Estados de error adaptados */
.error-message {
    text-align: center;
    padding: 2rem;
    color: #c74545;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 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;
        background: rgba(248, 248, 248, 0.9);
    }
    
    .time-unit {
        background: rgba(255, 255, 255, 0.8);
        border: 1px solid rgba(139, 115, 85, 0.25);
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
    }
    
    .time-unit::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, 
            rgba(139, 115, 85, 0.05) 0%, 
            transparent 100%);
        opacity: 0;
        transition: var(--transition-smooth);
    }
    
    .time-unit:hover {
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(139, 115, 85, 0.4);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    
    .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);
    }
    
    .countdown-expired {
        min-height: 250px;
    }
    
    .celebration-emoji {
        font-size: 3rem;
    }
    
    .celebration-text {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }
    
    .celebration-subtitle {
        font-size: 1rem;
    }
}

@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 {
        background: rgba(255, 255, 255, 0.85);
        border: 1px solid rgba(139, 115, 85, 0.3);
        padding: 1.25rem 0.75rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
        margin-bottom: 1.5rem;
    }

    .time-unit:hover {
        background: rgba(255, 255, 255, 0.95);
        border-color: rgba(139, 115, 85, 0.5);
    }
    
    .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;
    }
    
    .countdown-expired {
        min-height: 200px;
    }
    
    .celebration-content {
        padding: 1.5rem;
    }
    
    .celebration-emoji {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }
    
    .celebration-text {
        font-size: clamp(1.2rem, 3.5vw, 1.5rem);
    }
    
    .celebration-subtitle {
        font-size: 0.9rem;
    }
}

@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 para tema claro */
.contador.very-close {
    background: linear-gradient(135deg, 
        var(--bg-dark-light) 0%, 
        rgba(139, 105, 20, 0.08) 100%);
}

.contador.final-countdown::before {
    animation-duration: 15s;
    background: radial-gradient(
        circle at center,
        rgba(139, 115, 85, 0.12) 0%,
        rgba(139, 105, 20, 0.06) 50%,
        transparent 70%
    );
}

/* Contador Simple - Adaptado de Plantilla 2 */
.contador-simple {
    background: var(--bg-dark-light);
    min-height: 60vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.contador-simple .contador-content {
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 2;
}

.contador-simple .contador-header {
    margin-bottom: 3rem;
}

.contador-simple .contador-header h2 {
    font-family: var(--font-script);
    font-size: clamp(2rem, 5vw, 2.8rem);
    color: var(--accent-beige);
    font-weight: 400;
    margin-bottom: 1rem;
}

.contador-simple .countdown-simple {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
}

.contador-simple .time-unit-large {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 2rem;
}

.contador-simple .time-unit-large .number {
    font-family: var(--font-serif);
    font-size: clamp(4rem, 12vw, 8rem);
    color: var(--gold-accent);
    font-weight: 400;
    line-height: 1;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.contador-simple .time-unit-large .label {
    font-family: var(--font-sans);
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: var(--accent-beige);
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    opacity: 0.9;
}

/* Partículas para el contador simple */
.contador-simple .particle {
    position: absolute;
    background: var(--gold-accent);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.contador-simple .particle:nth-child(1) {
    width: 6px;
    height: 6px;
    top: 20%;
    left: 30%;
    animation: floatParticle 3s ease-in-out infinite;
}

.contador-simple .particle:nth-child(2) {
    width: 4px;
    height: 4px;
    top: 60%;
    left: 70%;
    animation: floatParticle 4s ease-in-out infinite 0.5s;
}

.contador-simple .particle:nth-child(3) {
    width: 5px;
    height: 5px;
    top: 80%;
    left: 40%;
    animation: floatParticle 3.5s ease-in-out infinite 1s;
}

@keyframes floatParticle {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    50% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.6;
    }
}

/* Efecto de actualización para el número simple */
.contador-simple .time-unit-large .number.updating {
    animation: pulseSimple 0.8s ease;
}

@keyframes pulseSimple {
    0% {
        transform: scale(1);
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.05);
        text-shadow: 0 0 20px rgba(139, 115, 85, 0.3);
        color: var(--accent-beige);
    }
    100% {
        transform: scale(1);
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    }
}

/* Estados especiales para contador simple */
.contador-simple.final-countdown .time-unit-large .number {
    animation: celebrateSimple 2s infinite ease-in-out;
    color: var(--gold-accent);
}

@keyframes celebrateSimple {
    0%, 100% {
        transform: scale(1);
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.08);
        text-shadow: 0 0 25px rgba(139, 115, 85, 0.4);
    }
}

/* Para contador simple cuando expira - MEJORADO */
.contador-simple .time-unit-large.celebration {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
}

.contador-simple .time-unit-large.celebration .label {
    order: 1;
    margin-bottom: 1rem;
}

.contador-simple .time-unit-large.celebration .number {
    order: 2;
}

.contador-simple.countdown-expired .time-unit-large {
    animation: bounceIn 1s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive para contador simple */
@media (max-width: 768px) {
    .contador-simple {
        min-height: 50vh;
        padding: 2rem 0;
    }
    
    .contador-simple .time-unit-large {
        margin: 0 1rem;
    }
    
    .contador-simple .time-unit-large .number {
        font-size: clamp(3rem, 10vw, 6rem);
    }
    
    .contador-simple .time-unit-large .label {
        font-size: clamp(0.9rem, 2.5vw, 1.1rem);
        letter-spacing: 1px;
    }
}

@media (max-width: 480px) {
    .contador-simple {
        min-height: 40vh;
    }
    
    .contador-simple .time-unit-large {
        margin: 0 0.5rem;
    }
    
    .contador-simple .time-unit-large .number {
        font-size: clamp(2.5rem, 8vw, 4rem);
    }
    
    .contador-simple .time-unit-large .label {
        font-size: 0.8rem;
        letter-spacing: 0.5px;
    }
}