/* ═══════════════════════════════════════════════════════════════
   PRIZERISE ENTERPRISE EFFECTS
   Premium animations, micro-interactions, 3D depth
   ═══════════════════════════════════════════════════════════════ */

/* ─── GLOBAL: Premium transitions ─── */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

/* ─── Multi-layer premium shadows ─── */
:root {
    --shadow-premium-sm: 0 1px 2px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
    --shadow-premium-md: 0 4px 8px rgba(0,0,0,0.4), 0 8px 16px rgba(0,0,0,0.3), 0 16px 32px rgba(0,0,0,0.2);
    --shadow-premium-lg: 0 8px 16px rgba(0,0,0,0.4), 0 16px 32px rgba(0,0,0,0.3), 0 32px 64px rgba(0,0,0,0.2);
    --shadow-glow-green: 0 0 0 1px rgba(16,185,129,0.15), 0 4px 16px rgba(16,185,129,0.3), 0 0 40px rgba(16,185,129,0.15);
    --shadow-glow-gold: 0 0 0 1px rgba(245,158,11,0.15), 0 4px 16px rgba(245,158,11,0.3), 0 0 40px rgba(245,158,11,0.15);
    --shadow-glow-purple: 0 0 0 1px rgba(139,92,246,0.15), 0 4px 16px rgba(139,92,246,0.3), 0 0 40px rgba(139,92,246,0.15);
    --shadow-glow-pink: 0 0 0 1px rgba(236,72,153,0.15), 0 4px 16px rgba(236,72,153,0.3), 0 0 40px rgba(236,72,153,0.15);
}

/* ═══ SKELETON LOADERS ═══ */
@keyframes premiumShimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton-premium {
    background: linear-gradient(
        90deg,
        rgba(30, 41, 59, 0.5) 0%,
        rgba(51, 65, 85, 0.7) 50%,
        rgba(30, 41, 59, 0.5) 100%
    );
    background-size: 200% 100%;
    animation: premiumShimmer 1.8s infinite linear;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.skeleton-premium::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    animation: premiumShimmer 2s infinite;
}

.skeleton-row {
    height: 76px;
    margin-bottom: 10px;
}

.skeleton-grid {
    height: 400px;
    margin-bottom: 20px;
}

.skeleton-card {
    height: 200px;
}

/* ═══ BUTTON RIPPLE EFFECT ═══ */
.btn-ripple {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.btn-ripple::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.4), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 1;
}

.btn-ripple:active::before {
    opacity: 1;
    transition: opacity 0s;
}

/* ═══ PREMIUM BUTTON SHINE ═══ */
.btn-premium {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.btn-premium::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.btn-premium:hover::after {
    left: 100%;
}

/* ═══ MAGNETIC BUTTON (JS needed) ═══ */
.btn-magnetic {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
}

/* ═══ 3D CARD TILT (JS needed) ═══ */
.card-tilt {
    transform-style: preserve-3d;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.card-tilt > * {
    transform: translateZ(20px);
}

/* ═══ NUMBER COUNTER ANIMATION ═══ */
.number-counter {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s, transform 0.3s;
}

.number-counter.updating {
    animation: numberPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #10B981;
}

@keyframes numberPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); color: #10B981; }
    100% { transform: scale(1); }
}

/* ═══ STAGGERED FADE-IN ═══ */
.stagger-in {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes staggerIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-in:nth-child(1) { animation-delay: 0.05s; }
.stagger-in:nth-child(2) { animation-delay: 0.10s; }
.stagger-in:nth-child(3) { animation-delay: 0.15s; }
.stagger-in:nth-child(4) { animation-delay: 0.20s; }
.stagger-in:nth-child(5) { animation-delay: 0.25s; }
.stagger-in:nth-child(6) { animation-delay: 0.30s; }
.stagger-in:nth-child(7) { animation-delay: 0.35s; }
.stagger-in:nth-child(8) { animation-delay: 0.40s; }

/* ═══ RIPPLE ON CELL (Full Pack / Single Pick) ═══ */
.fp-cell {
    position: relative;
    overflow: hidden;
}

.fp-cell.ripple-active::after {
    content: '';
    position: absolute;
    top: var(--ripple-y, 50%);
    left: var(--ripple-x, 50%);
    width: 10px;
    height: 10px;
    background: rgba(16, 185, 129, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: cellRipple 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

@keyframes cellRipple {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(8); opacity: 0; }
}

/* ═══ GRADIENT BORDER (Glow) ═══ */
.gradient-border {
    position: relative;
    background: linear-gradient(135deg, rgba(30,41,59,0.9), rgba(15,23,42,0.95));
    border-radius: 16px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    padding: 1px;
    background: linear-gradient(135deg, #10B981, #3B82F6, #F59E0B, #10B981);
    background-size: 300% 300%;
    border-radius: 16px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: gradientRotate 4s linear infinite;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.gradient-border:hover::before {
    opacity: 1;
}

@keyframes gradientRotate {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* ═══ FLOATING PULSE (Live indicator) ═══ */
.live-pulse-dot {
    position: relative;
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #EF4444;
    border-radius: 50%;
}

.live-pulse-dot::before,
.live-pulse-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #EF4444;
    animation: livePulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.live-pulse-dot::after {
    animation-delay: 0.5s;
}

@keyframes livePulseRing {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* ═══ SECTION REVEAL ON SCROLL (JS needed) ═══ */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ═══ PREMIUM TOAST ═══ */
.toast-premium {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(30,41,59,0.95), rgba(15,23,42,0.98));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    box-shadow: var(--shadow-premium-lg);
    backdrop-filter: blur(20px);
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-premium.toast-success { border-left: 3px solid #10B981; }
.toast-premium.toast-error { border-left: 3px solid #EF4444; }
.toast-premium.toast-warning { border-left: 3px solid #F59E0B; }
.toast-premium.toast-info { border-left: 3px solid #3B82F6; }

.toast-premium-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    flex-shrink: 0;
}

.toast-premium.toast-success .toast-premium-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.toast-premium.toast-error .toast-premium-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.toast-premium.toast-warning .toast-premium-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
}

.toast-premium.toast-info .toast-premium-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3B82F6;
}

.toast-premium-content {
    flex: 1;
}

.toast-premium-title {
    font-weight: 800;
    font-size: 14px;
    color: #F1F5F9;
}

.toast-premium-message {
    font-size: 12px;
    color: #94A3B8;
    margin-top: 2px;
}

.toast-premium-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: #10B981;
    animation: toastProgress 3s linear forwards;
}

.toast-premium.toast-error .toast-premium-progress { background: #EF4444; }
.toast-premium.toast-warning .toast-premium-progress { background: #F59E0B; }
.toast-premium.toast-info .toast-premium-progress { background: #3B82F6; }

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ═══ EMPTY STATE ═══ */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-state-icon {
    font-size: 80px;
    opacity: 0.15;
    margin-bottom: 20px;
    animation: emptyFloat 4s ease-in-out infinite;
}

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

.empty-state-title {
    font-size: 18px;
    font-weight: 800;
    color: #94A3B8;
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 24px;
}

/* ═══ GAME ROW HOVER GLOW ═══ */
.game-row {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-row::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(16,185,129,0.08), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.game-row:hover::before {
    opacity: 1;
}

/* ═══ MARQUEE PAUSE ON HOVER ═══ */
.marquee-row:hover .marquee-track,
.info-ticker:hover .ticker-track {
    animation-play-state: paused;
}

/* ═══ MARQUEE EDGE FADE ═══ */
.marquee-row::before,
.marquee-row::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 2;
    pointer-events: none;
}

.marquee-row::before {
    left: 0;
    background: linear-gradient(90deg, #0F172A, transparent);
}

.marquee-row::after {
    right: 0;
    background: linear-gradient(270deg, #0F172A, transparent);
}

.marquee-row-alt::before {
    background: linear-gradient(90deg, #1E293B, transparent);
}

.marquee-row-alt::after {
    background: linear-gradient(270deg, #1E293B, transparent);
}

/* ═══ TIME BAR PULSE ═══ */
.time-item.highlight-large {
    position: relative;
    overflow: hidden;
}

.time-item.highlight-large::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.15), transparent);
    animation: timeBarScan 3s linear infinite;
}

@keyframes timeBarScan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ═══ TIME VALUE PULSE ═══ */
.time-value.countdown {
    animation: countdownPulse 1s ease-in-out infinite;
}

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

/* ═══ FILTER CHIP SPRING ═══ */
.filter-chip {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.filter-chip:active {
    transform: scale(0.95);
}

/* ═══ SIDEBAR LINK SLIDE ═══ */
.sidebar-link {
    position: relative;
    overflow: hidden;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: #10B981;
    border-radius: 3px;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-link:hover::before {
    height: 60%;
}

/* ═══ LOTTERY CARD SHINE ═══ */
.lottery-card {
    position: relative;
    overflow: hidden;
}

.lottery-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transform: rotate(25deg);
    transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.lottery-card:hover::after {
    left: 150%;
}

/* ═══ MODAL SPRING ANIMATION ═══ */
.fp-modal-overlay {
    animation: modalBackdropIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalBackdropIn {
    from { opacity: 0; backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(8px); }
}

.fp-modal {
    animation: modalSpringIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSpringIn {
    from { transform: scale(0.85) translateY(30px); opacity: 0; }
    60% { transform: scale(1.02) translateY(0); opacity: 1; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.fp-modal-number-row {
    animation: staggerRowIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.fp-modal-number-row:nth-child(1) { animation-delay: 0.05s; }
.fp-modal-number-row:nth-child(2) { animation-delay: 0.10s; }
.fp-modal-number-row:nth-child(3) { animation-delay: 0.15s; }
.fp-modal-number-row:nth-child(4) { animation-delay: 0.20s; }
.fp-modal-number-row:nth-child(5) { animation-delay: 0.25s; }
.fp-modal-number-row:nth-child(6) { animation-delay: 0.30s; }
.fp-modal-number-row:nth-child(7) { animation-delay: 0.35s; }
.fp-modal-number-row:nth-child(8) { animation-delay: 0.40s; }
.fp-modal-number-row:nth-child(9) { animation-delay: 0.45s; }
.fp-modal-number-row:nth-child(10) { animation-delay: 0.50s; }

@keyframes staggerRowIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ═══ NUMBER INPUT GLOW ON FOCUS ═══ */
.fp-modal-number-input:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15), 0 0 20px rgba(16, 185, 129, 0.3);
}

/* ═══ PREMIUM CELL PRESS ═══ */
.fp-cell {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fp-cell:active {
    transform: scale(0.92);
}

/* ═══ PULSE ON FILLED CELL ═══ */
.fp-cell.filled {
    animation: cellFilledPulse 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cellFilledPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); box-shadow: 0 0 20px rgba(16, 185, 129, 0.8); }
    100% { transform: scale(1); }
}

/* ═══ BALANCE CHIP ANIMATION ═══ */
.balance-chip {
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.balance-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}



.balance-chip:hover::before {
    left: 100%;
}

/* ═══ PREMIUM PAGE ENTRANCE ═══ */
.home-content {
    animation: pageEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ═══ SESSION BADGE PULSE ═══ */
.session-badge {
    position: relative;
    overflow: hidden;
}

.session-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16,185,129,0.3), transparent);
    animation: sessionScan 3s ease-in-out infinite;
}

@keyframes sessionScan {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

/* ═══ FAB PULSE + ROTATE ═══ */
.fab-main svg {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fab-main:hover svg {
    transform: rotate(90deg) scale(1.15);
}

/* ═══ TEXT SHIMMER ON HEADINGS ═══ */
h2.shimmer-text {
    background: linear-gradient(90deg, #F1F5F9, #10B981, #F1F5F9);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShimmer 3s linear infinite;
}

@keyframes textShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ═══ MOBILE OPTIMIZATIONS ═══ */
@media (max-width: 640px) {
    .marquee-row::before,
    .marquee-row::after {
        width: 40px;
    }
    .empty-state-icon {
        font-size: 60px;
    }
}

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* PHASE 26: SYSTEM POLISH */
body { opacity: 1; transition: opacity 0.3s ease-out; }



.skeleton {
    background: linear-gradient(90deg, var(--bg-700) 25%, var(--bg-600) 50%, var(--bg-700) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

@media print {
    .app-header, .sidebar, .in-play-bar, .fab, .toast { display: none !important; }
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(16, 185, 129, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-400); }
.empty-state-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 18px; font-weight: 700; color: var(--text-100); margin-bottom: 8px; }

/* FIX: Force body visible (override earlier opacity:0) */
body,
body.page-loaded,
body.page-leaving {
    opacity: 1 !important;
    transform: none !important;
}
