/* AI Jackpot - Custom Styles & Animations */

/* ==================== CSS VARIABLES ==================== */
:root {
    --gold: #FFD700;
    --gold-light: #FFC107;
    --gold-dark: #B8860B;
    --dark-bg: #0a0a14;
    --dark-card: #12121e;
    --dark-accent: #1a1a2e;
    --dark-border: #2a2a3e;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --text: #ffffff;
    --text-muted: #9CA3AF;
    --text-dim: #6B7280;
}

/* ==================== BASE STYLES ==================== */
body {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-accent) 100%);
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* ==================== GLOW EFFECTS ==================== */
.glow-gold {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3),
                0 0 40px rgba(255, 215, 0, 0.2),
                0 0 60px rgba(255, 215, 0, 0.1);
}

.glow-gold-sm {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3),
                0 0 20px rgba(255, 215, 0, 0.15);
}

.text-glow {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5),
                 0 0 20px rgba(255, 215, 0, 0.3);
}

.glow-success {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.glow-danger {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

/* ==================== GRADIENT BACKGROUNDS ==================== */
.bg-gold-gradient {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
}

.bg-dark-gradient {
    background: linear-gradient(180deg, var(--dark-card) 0%, var(--dark-bg) 100%);
}

.bg-card {
    background: rgba(18, 18, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--dark-border);
}

/* ==================== KEYFRAME ANIMATIONS ==================== */

/* Pulse animation for buttons */
@keyframes pulse-gold {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(255, 215, 0, 0);
    }
}

.animate-pulse-gold {
    animation: pulse-gold 2s infinite;
}

/* Glow breathing effect */
@keyframes glow-breathe {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
    }
}

.animate-glow-breathe {
    animation: glow-breathe 3s ease-in-out infinite;
}

/* Number spin animation */
@keyframes number-spin {
    0% { transform: rotateX(0deg); opacity: 1; }
    25% { transform: rotateX(90deg); opacity: 0; }
    50% { transform: rotateX(180deg); opacity: 0; }
    75% { transform: rotateX(270deg); opacity: 0; }
    100% { transform: rotateX(360deg); opacity: 1; }
}

.animate-number-spin {
    animation: number-spin 0.1s linear infinite;
}

/* Bounce in animation */
@keyframes bounce-in {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.animate-bounce-in {
    animation: bounce-in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Fade in up */
@keyframes fade-in-up {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.animate-fade-in-up {
    animation: fade-in-up 0.4s ease-out forwards;
}

/* Fade in */
@keyframes fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.animate-fade-in {
    animation: fade-in 0.3s ease-out forwards;
}

/* Shimmer effect */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-shimmer {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 215, 0, 0.1) 50%,
        transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* Float animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Rotate animation */
@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-rotate {
    animation: rotate 1s linear infinite;
}

/* Slide in from right */
@keyframes slide-in-right {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

.animate-slide-in-right {
    animation: slide-in-right 0.3s ease-out forwards;
}

/* Slide out to right */
@keyframes slide-out-right {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

.animate-slide-out-right {
    animation: slide-out-right 0.3s ease-in forwards;
}

/* Scale pulse */
@keyframes scale-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-scale-pulse {
    animation: scale-pulse 2s ease-in-out infinite;
}

/* ==================== LOTTERY BALL STYLES ==================== */
.lottery-ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
    background: linear-gradient(145deg, #ffffff 0%, #e0e0e0 100%);
    color: #1a1a2e;
    box-shadow:
        inset -3px -3px 6px rgba(0, 0, 0, 0.2),
        inset 3px 3px 6px rgba(255, 255, 255, 0.8),
        3px 3px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.lottery-ball::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 10px;
    width: 15px;
    height: 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transform: rotate(-30deg);
}

.lottery-ball.bonus {
    background: linear-gradient(145deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #1a1a2e;
}

.lottery-ball.small {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

/* Scrambling numbers effect */
.number-scramble {
    display: inline-block;
    min-width: 2ch;
    text-align: center;
}

/* ==================== BUTTON STYLES ==================== */
.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #1a1a2e;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

.btn-gold:active {
    transform: translateY(0);
}

.btn-outline-gold {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
    transition: all 0.3s ease;
}

.btn-outline-gold:hover {
    background: var(--gold);
    color: #1a1a2e;
}

/* ==================== CARD STYLES ==================== */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--gold);
}

/* ==================== PROGRESS BAR ==================== */
.progress-bar {
    height: 4px;
    background: var(--dark-border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
    transition: width 0.3s ease;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 16px 24px;
    border-radius: 12px;
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

.toast.warning {
    border-color: var(--warning);
}

.toast.info {
    border-color: var(--info);
}

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 20, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

/* AI Processing animation */
.ai-processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.ai-brain {
    width: 120px;
    height: 120px;
    position: relative;
}

.ai-brain-core {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: glow-breathe 1.5s ease-in-out infinite;
}

.ai-brain-ring {
    width: 100%;
    height: 100%;
    border: 3px solid var(--gold);
    border-radius: 50%;
    position: absolute;
    border-top-color: transparent;
    animation: rotate 1s linear infinite;
}

.ai-brain-ring:nth-child(2) {
    width: 90%;
    height: 90%;
    top: 5%;
    left: 5%;
    animation-duration: 1.5s;
    animation-direction: reverse;
}

/* ==================== HEATMAP STYLES ==================== */
.heatmap-cell {
    transition: all 0.3s ease;
}

.heatmap-cell:hover {
    transform: scale(1.1);
}

.heat-low { background: rgba(16, 185, 129, 0.2); }
.heat-medium { background: rgba(245, 158, 11, 0.4); }
.heat-high { background: rgba(239, 68, 68, 0.6); }
.heat-max { background: rgba(255, 215, 0, 0.8); }

/* ==================== NAVIGATION ==================== */
.nav-item {
    transition: all 0.3s ease;
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-item.active::after,
.nav-item:hover::after {
    width: 100%;
}

.nav-item.active {
    color: var(--gold);
}

/* Bottom nav for mobile */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dark-card);
    border-top: 1px solid var(--dark-border);
    padding: 8px 0;
    padding-bottom: env(safe-area-inset-bottom, 8px);
    z-index: 100;
}

/* Sidebar hidden on mobile, visible on desktop */
#sidebar {
    display: none !important;
}

@media (min-width: 768px) {
    #sidebar.flex {
        display: flex !important;
    }

    #bottom-nav {
        display: none !important;
    }
}

@media (max-width: 767px) {
    #sidebar {
        display: none !important;
    }

    #bottom-nav.flex {
        display: flex !important;
    }

    #app-container {
        padding-left: 0 !important;
    }
}

/* ==================== SCREEN TRANSITIONS ==================== */
.screen {
    display: none;
    opacity: 0;
}

.screen.active {
    display: block;
    animation: fade-in 0.3s ease-out forwards;
}

/* Login screen special handling */
#screen-login {
    display: none !important;
}

#screen-login.active {
    display: flex !important;
}

/* ==================== STATS CARD ==================== */
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== ALERT BADGE ==================== */
.alert-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: var(--danger);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    animation: scale-pulse 2s infinite;
}

/* ==================== COUNTDOWN TIMER ==================== */
.countdown-segment {
    background: var(--dark-accent);
    border-radius: 8px;
    padding: 8px 12px;
    min-width: 60px;
    text-align: center;
}

.countdown-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--gold);
}

.countdown-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .lottery-ball {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .toast {
        min-width: auto;
        width: calc(100% - 40px);
    }

    .toast-container {
        left: 20px;
    }
}

/* ==================== UTILITY CLASSES ==================== */
.text-gold { color: var(--gold); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

.border-gold { border-color: var(--gold); }
.border-dark { border-color: var(--dark-border); }

.bg-dark-card { background: var(--dark-card); }
.bg-dark-accent { background: var(--dark-accent); }

/* Delay utilities for staggered animations */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }
