/* ============================================
    HOME - UI
    Anúncio reduzido + Animações + Refinamentos
    © 2026 LITE STUDIO
    ============================================ */

/* ============================================
   ANIMAÇÕES DE FOGO (STREAK)
   ============================================ */
@keyframes stSpin {
    to { transform: rotate(360deg); }
}

@keyframes fireFlicker {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-3deg); }
    50% { transform: scale(1.05) rotate(2deg); }
    75% { transform: scale(1.12) rotate(-2deg); }
}

@keyframes fireIntense {
    0%, 100% { transform: scale(1) rotate(0deg); }
    20% { transform: scale(1.15) rotate(-4deg); }
    40% { transform: scale(1.08) rotate(3deg); }
    60% { transform: scale(1.18) rotate(-3deg); }
    80% { transform: scale(1.1) rotate(2deg); }
}

@keyframes sproutSway {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-5deg) scale(1.05); }
    75% { transform: rotate(5deg) scale(1.05); }
}

.st-streak-fire .st-streak-icon-svg {
    animation: fireFlicker 1.5s ease-in-out infinite;
}

.st-streak-fire.sprout .st-streak-icon-svg {
    color: var(--text-tertiary);
    animation: sproutSway 2s ease-in-out infinite;
}

.st-streak-fire.intense .st-streak-icon-svg {
    color: var(--gold);
    animation: fireIntense 0.8s ease-in-out infinite;
    filter: drop-shadow(0 0 10px var(--gold-glow));
}

/* ============================================
   PARTÍCULAS DE STREAK
   ============================================ */
.st-streak-particles {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.st-streak-particle {
    width: 4px;
    height: 4px;
    background: var(--accent);
    opacity: 0;
    animation: particleFloat 2s ease-out infinite;
}

.st-streak-particle:nth-child(2) {
    animation-delay: 0.4s;
    background: var(--gold);
    width: 3px;
    height: 3px;
}

.st-streak-particle:nth-child(3) {
    animation-delay: 0.8s;
    background: var(--accent-light);
    width: 5px;
    height: 5px;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(1);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0);
    }
}

/* ============================================
   ✅ REFINAMENTOS DO CONTADOR DE DIAS
   ============================================ */

/* Efeito de pulso suave no contador de dias */
.st-home-days-counter {
    position: relative;
}

.st-home-days-counter::after {
    content: '';
    position: absolute;
    inset: -8px -12px;
    background: radial-gradient(ellipse, var(--gold-glow) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
    animation: daysGlow 3s ease-in-out infinite;
}

@keyframes daysGlow {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

/* Badge de "NOVO DIA" quando muda de 0 para 1+ dia */
.st-home-days-counter[data-just-unlocked="true"] {
    animation: dayUnlock 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dayUnlock {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.5) rotate(-10deg);
    }
    50% {
        opacity: 1;
        transform: translateY(-5px) scale(1.2) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0);
    }
}

/* ============================================
   ✅ CLOCK TIME - ESTADOS ESPECIAIS
   ============================================ */

/* Quando está prestes a completar 24h (23h+), pulsa */
.st-home-clock-time.st-home-clock-time-near-day {
    animation: nearDayPulse 2s ease-in-out infinite;
}

@keyframes nearDayPulse {
    0%, 100% {
        text-shadow: 0 0 24px var(--accent-glow), 2px 2px 0 #000;
    }
    50% {
        text-shadow: 0 0 40px var(--gold-glow), 2px 2px 0 #000, 0 0 60px var(--gold-glow);
        color: var(--gold-light);
    }
}

/* Quando acabou de completar 1 dia (celebração) */
.st-home-clock-time.st-home-clock-time-celebrate {
    animation: celebrateDay 1.5s ease-out;
}

@keyframes celebrateDay {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        color: var(--gold);
        text-shadow: 0 0 40px var(--gold-glow);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   SLIDE ANIMAÇÕES
   ============================================ */
.st-home-slide {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.st-home-slide:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
}

/* Efeito ao adicionar novo slide */
.st-home-slide.st-home-slide-new {
    animation: slideNew 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideNew {
    from {
        opacity: 0;
        transform: translateX(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* ============================================
   DOTS MELHORADOS
   ============================================ */
.st-home-dot {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 3px;
}

.st-home-dot:hover:not(.active) {
    background: var(--border-strong);
    transform: scale(1.3);
}

.st-home-dot.active {
    border-radius: 3px;
}

/* ============================================
   BREAKDOWN (UNIDADES DE TEMPO)
   ============================================ */
.st-home-slide-unit {
    transition: background 0.2s ease;
}

.st-home-slide-unit:hover {
    background: rgba(229, 229, 229, 0.02);
}

.st-home-slide-unit-value {
    transition: color 0.3s ease, transform 0.3s ease;
}

/* Quando segundos mudam, leve efeito */
.st-home-slide-unit-value.changing {
    animation: valueChange 0.3s ease;
}

@keyframes valueChange {
    0% { transform: translateY(0); }
    50% { transform: translateY(-2px); color: var(--accent); }
    100% { transform: translateY(0); }
}

/* ============================================
   ACHIEVEMENT BADGE MELHORADO
   ============================================ */
.st-home-slide-achievement {
    transition: all 0.3s ease;
}

.st-home-slide-achievement:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.2);
}

/* Efeito ao subir de nível */
.st-home-slide-achievement.level-up {
    animation: levelUp 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes levelUp {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 30px var(--gold-glow);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   BOTÃO DE DETALHES
   ============================================ */
.st-home-clock-btn {
    position: relative;
    overflow: hidden;
}

.st-home-clock-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.st-home-clock-btn:hover::before {
    transform: translateX(100%);
}

/* ============================================
   DELETE BUTTON
   ============================================ */
.st-home-slide-delete {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.st-home-slide-delete:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* ============================================
   STATS BAR - ANIMAÇÃO AO ATUALIZAR
   ============================================ */
.st-home-stat-value.updating {
    animation: statUpdate 0.6s ease;
}

@keyframes statUpdate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: var(--accent);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   COUNTER BADGE ANIMAÇÃO
   ============================================ */
.st-home-counter-badge-count.updating {
    animation: counterUpdate 0.5s ease;
}

@keyframes counterUpdate {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
        color: var(--gold);
    }
}

/* ============================================
   LIMIT WARNING ANIMAÇÃO
   ============================================ */
.st-home-limit-warning {
    animation: warningPulse 2s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.2);
    }
}

/* ============================================
   EMPTY STATE ANIMAÇÕES
   ============================================ */
.st-home-empty-icon {
    animation: emptyFloat 3s ease-in-out infinite;
}

@keyframes emptyFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.st-home-empty-btn {
    position: relative;
    overflow: hidden;
}

.st-home-empty-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.st-home-empty-btn:hover::before {
    transform: translateX(100%);
}

/* ============================================
   PROGRESS CIRCLE ANIMATION
   ============================================ */
.st-home-clock-progress {
    transition: stroke-dashoffset 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Efeito shimmer no progress */
.st-home-clock-progress::after {
    content: '';
    filter: drop-shadow(0 0 12px var(--accent-glow));
}

/* ============================================
   BRAND LOGO ANIMATION
   ============================================ */
.st-home-brand-logo {
    animation: brandPulse 3s ease-in-out infinite;
}

@keyframes brandPulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 6px var(--accent-glow));
    }
}

/* ============================================
   RESPONSIVE REFINEMENTS
   ============================================ */
@media (max-width: 380px) {
    .st-home-days-value {
        font-size: clamp(1.8rem, 7.5vw, 2.2rem);
    }
    .st-home-days-label {
        font-size: 0.5rem;
    }
    .st-home-clock-time.st-home-clock-time-compact {
        font-size: clamp(1.2rem, 6vw, 1.5rem);
    }
    .st-streak-particles {
        display: none;
    }
}

@media (min-width: 600px) {
    .st-home-days-value {
        font-size: 3rem;
    }
    .st-home-days-label {
        font-size: 0.7rem;
    }
    .st-home-clock-time.st-home-clock-time-compact {
        font-size: 2rem;
    }
}

/* ============================================
   ACESSIBILIDADE
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .st-home-days-counter::after,
    .st-streak-fire .st-streak-icon-svg,
    .st-streak-particle,
    .st-home-empty-icon,
    .st-home-brand-logo {
        animation: none !important;
    }
    
    .st-home-clock-progress {
        transition: none;
    }
}

/* Dark mode adjustments (sempre ativo) */
@media (prefers-color-scheme: dark) {
    .st-home-days-value {
        text-shadow:
            2px 2px 0 #000,
            0 0 25px var(--gold-glow);
    }
}