/* ============================================================
   Melon Pay - Index Styles
   ============================================================ */

/* ========== Classes comuns para decoração de fundo dos cartões ========== */
.card-decoration {
    position: absolute;
    inset: 0;
    z-index: -10;
    background: linear-gradient(to bottom right, rgba(251, 207, 232, 0.4), rgba(254, 205, 211, 0.3), rgba(253, 242, 248, 0.2));
}

.card-radial-overlay {
    position: absolute;
    inset: 0;
    z-index: -10;
    opacity: 0.3;
    background-image: radial-gradient(600px 300px at -20% -10%, rgba(255, 255, 255, 0.65), transparent), 
                      radial-gradient(400px 260px at 120% 110%, rgba(255, 255, 255, 0.45), transparent);
}

.card-grid-overlay {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(0, 0, 0, 0.08) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: 0.15;
}

.card-glow {
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: -10;
    border-radius: 30px;
    opacity: 0;
    filter: blur(20px);
    transition: opacity 0.3s;
    background: conic-gradient(from 180deg at 50% 50%, 
                               rgba(244, 114, 182, 0.35) 0%, 
                               rgba(244, 114, 182, 0) 25%, 
                               rgba(244, 114, 182, 0.35) 50%, 
                               rgba(244, 114, 182, 0) 75%, 
                               rgba(244, 114, 182, 0.35) 100%);
}

.group:hover .card-glow {
    opacity: 1;
}

/* ========== Efeito de brilho deslizante ========== */
.shimmer-light {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.animate-glow {
    animation: glowPulse 2.2s ease-in-out infinite;
}

@keyframes glowPulse {
    0% { box-shadow: 0 0 10px rgba(225, 29, 72, 0.3); }
    50% { box-shadow: 0 0 30px rgba(225, 29, 72, 0.55); }
    100% { box-shadow: 0 0 10px rgba(225, 29, 72, 0.3); }
}

.is-visible {
    animation: fadeSlide 0.6s ease-out forwards;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.7; }
}

@keyframes floatGlow {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.55; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* ========== CSS para troca de abas ========== */
.showcase .panel {
    display: none;
}

#pay-tab-shopping:checked ~ .showcase .panel-shopping {
    display: grid;
}

#pay-tab-travel:checked ~ .showcase .panel-travel {
    display: grid;
}

#pay-tab-social:checked ~ .showcase .panel-social {
    display: grid;
}

#pay-tab-shopping:checked ~ .tabs label[for="pay-tab-shopping"] {
    color: #881337;
    font-weight: 700;
}

#pay-tab-shopping:checked ~ .tabs label[for="pay-tab-shopping"] span {
    opacity: 1;
}

#pay-tab-travel:checked ~ .tabs label[for="pay-tab-travel"] {
    color: #881337;
    font-weight: 700;
}

#pay-tab-travel:checked ~ .tabs label[for="pay-tab-travel"] span {
    opacity: 1;
}

#pay-tab-social:checked ~ .tabs label[for="pay-tab-social"] {
    color: #881337;
    font-weight: 700;
}

#pay-tab-social:checked ~ .tabs label[for="pay-tab-social"] span {
    opacity: 1;
}

.panels .panel-virtual {
    display: grid;
}

/* ========== Vídeo mobile (preenche, sem bordas pretas) ========== */
.hero-video-wrapper {
    display: block;
    width: 100%;
    height: 300px;
    margin-bottom: 0;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 40px -10px rgba(225, 29, 72, 0.25);
    position: relative;
    background: #000;
}

.hero-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Indicador de carregamento do vídeo */
.video-loading-indicator {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdf2f8, #fce7f3);
    z-index: 5;
    transition: opacity 0.5s ease;
}

.video-loading-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.video-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(225, 29, 72, 0.2);
    border-top-color: #e11d48;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.video-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 3;
}

@media (min-width: 768px) {
    .hero-video-wrapper {
        display: none;
    }
}

/* ========== Contagem regressiva ========== */
.countdown-wrapper {
    margin-top: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 1.25rem;
    background: linear-gradient(145deg, #ffffff, #fff5f6);
    border: 2px solid rgba(244, 63, 94, 0.25);
    box-shadow:
        0 10px 30px -10px rgba(225, 29, 72, 0.3),
        0 4px 10px -4px rgba(225, 29, 72, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.9);
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
}

.countdown-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
    border-radius: 9999px;
}

/* Texto "Aguarde" antes do contador */
.countdown-waiting-text {
    display: inline-flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 700;
    color: #be123c;
    letter-spacing: 0.02em;
    white-space: nowrap;
    animation: waitingPulse 1.5s ease-in-out infinite;
}

@keyframes waitingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.countdown-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.countdown-digit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 3.25rem;
    border-radius: 0.625rem;
    background: linear-gradient(180deg, #ffffff 0%, #fef2f2 100%);
    border: 1.5px solid rgba(244, 63, 94, 0.2);
    box-shadow:
        0 4px 10px -2px rgba(225, 29, 72, 0.18),
        0 2px 4px -1px rgba(225, 29, 72, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -2px 4px rgba(244, 63, 94, 0.06);
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    color: #be123c;
    font-variant-numeric: tabular-nums;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.countdown-digit::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent);
    pointer-events: none;
    border-radius: 0.625rem 0.625rem 0 0;
}

.countdown-digit::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 8%;
    right: 8%;
    height: 1px;
    background: rgba(244, 63, 94, 0.08);
    pointer-events: none;
}

.countdown-separator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 1.75rem;
    font-weight: 800;
    color: #e11d48;
    line-height: 1;
    padding-bottom: 0.25rem;
    animation: separatorBlink 1s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes separatorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.countdown-digit.flip {
    animation: digitFlip 0.35s ease-out;
}

@keyframes digitFlip {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.12);
        box-shadow:
            0 6px 16px -2px rgba(225, 29, 72, 0.35),
            0 3px 6px -1px rgba(225, 29, 72, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* ========== Adaptação para tablet/celular ========== */
@media (max-width: 640px) {
    .countdown-wrapper {
        margin-top: 1.25rem;
        padding: 0.6rem 0.85rem;
        border-radius: 1rem;
        gap: 0.5rem;
    }
    
    .countdown-waiting-text {
        font-size: 0.85rem;
    }
    
    .countdown-timer {
        gap: 0.25rem;
    }
    
    .countdown-digit {
        width: 1.85rem;
        height: 2.35rem;
        font-size: 1.15rem;
        border-radius: 0.4rem;
    }
    
    .countdown-separator {
        font-size: 1.15rem;
    }
}

/* ========== Adaptação para telas muito pequenas ========== */
@media (max-width: 380px) {
    .countdown-wrapper {
        padding: 0.5rem 0.75rem;
        gap: 0.4rem;
    }
    
    .countdown-waiting-text {
        font-size: 0.75rem;
    }
    
    .countdown-digit {
        width: 1.6rem;
        height: 2.1rem;
        font-size: 1rem;
    }
    
    .countdown-separator {
        font-size: 1rem;
    }
}

/* ========== Prevenir overflow no mobile ========== */
@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    section {
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .max-w-2xl {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .relative.mx-auto {
        max-width: 100%;
        box-sizing: border-box;
    }
}