/* RAJACUAN - Custom Styles with Theme System */

/* ═══════════════════════════════════════════════════════════════
   THEME CSS VARIABLES
   ═══════════════════════════════════════════════════════════════ */

/* Default Theme - Golden (with gradient) */
:root,
[data-theme="default"] {
    --color-primary: #1a1a2e;
    --color-secondary: #16213e;
    --color-accent: #f59e0b;
    --color-accent-hover: #d97706;
    --color-dark: #0f0f1a;
    --color-card: #1e1e32;
    --color-sidebar: #141428;
    --color-text: #ffffff;
    --color-text-muted: #9ca3af;
    --color-border: rgba(255, 255, 255, 0.1);
    --bg-gradient: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a2a 100%);
    --glow-color: rgba(245, 158, 11, 0.3);
}

/* Ocean Blue Theme (no gradient) */
[data-theme="ocean"] {
    --color-primary: #0f172a;
    --color-secondary: #1e293b;
    --color-accent: #06b6d4;
    --color-accent-hover: #0891b2;
    --color-dark: #020617;
    --color-card: #1e293b;
    --color-sidebar: #0f172a;
    --color-text: #ffffff;
    --color-text-muted: #94a3b8;
    --color-border: rgba(255, 255, 255, 0.1);
    --bg-gradient: #0f172a;
    --glow-color: rgba(6, 182, 212, 0.3);
}

/* Ruby Red Theme (no gradient) */
[data-theme="ruby"] {
    --color-primary: #1c1917;
    --color-secondary: #292524;
    --color-accent: #ef4444;
    --color-accent-hover: #dc2626;
    --color-dark: #0c0a09;
    --color-card: #292524;
    --color-sidebar: #1c1917;
    --color-text: #ffffff;
    --color-text-muted: #a8a29e;
    --color-border: rgba(255, 255, 255, 0.1);
    --bg-gradient: #1c1917;
    --glow-color: rgba(239, 68, 68, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════════════════════════ */

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

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Hide scrollbar */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Body with theme background */
body {
    background: var(--bg-gradient);
    overflow-x: hidden;
    max-width: 100vw;
}

/* ═══════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════ */

/* Form inputs - dark text for admin/light backgrounds only */
.bg-white input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.bg-white textarea,
.bg-white select,
form.light-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
form.light-form textarea,
form.light-form select {
    color: #1f2937;
}

/* Form inputs - light text for dark backgrounds (frontend) */
.bg-dark input,
.bg-dark textarea,
.bg-dark select,
.bg-card input,
.bg-card textarea,
.bg-card select,
input.text-white,
textarea.text-white,
select.text-white {
    color: #ffffff !important;
}

/* Fix for inputs with dark background classes */
input.bg-dark\/50,
textarea.bg-dark\/50,
select.bg-dark\/50,
input[class*="bg-dark"],
textarea[class*="bg-dark"],
select[class*="bg-dark"] {
    background-color: rgba(15, 15, 26, 0.5) !important;
    color: #ffffff !important;
}

/* Ensure number inputs also show white text */
input[type="number"] {
    color: inherit;
}

input[type="number"].text-white,
input[type="number"][class*="bg-dark"] {
    color: #ffffff !important;
    background-color: rgba(15, 15, 26, 0.5) !important;
}

/* Placeholder text */
input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

/* Global fix for all inputs on dark theme pages */
body.bg-dark input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
body.bg-dark textarea,
body.bg-dark select,
.bg-card input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.bg-card textarea,
.bg-card select {
    background-color: rgba(15, 15, 26, 0.5);
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Chrome/Safari autofill fix for dark inputs */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff;
    -webkit-box-shadow: 0 0 0px 1000px rgba(15, 15, 26, 0.9) inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* ═══════════════════════════════════════════════════════════════
   COMPONENT STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Slider dots */
.slider-dot {
    transition: all 0.3s ease;
}

.slider-dot.active {
    background: var(--color-accent);
    width: 24px;
    border-radius: 4px;
}

/* Game card hover */
.game-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Jackpot animation */
@keyframes jackpotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.jackpot-counter {
    animation: jackpotPulse 2s ease-in-out infinite;
}

/* Marquee animation */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-marquee {
    animation: marquee 30s linear infinite;
}

/* Safe area for mobile */
.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Glow effects - using theme variable */
.glow-accent {
    box-shadow: 0 0 20px var(--glow-color);
}

/* Loading spinner - using theme variable */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Slow spin animation for lucky spin button */
@keyframes spin-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-spin-slow {
    animation: spin-slow 8s linear infinite;
}

/* Shine effect */
@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.animate-shine {
    position: relative;
    overflow: hidden;
}

.animate-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 3s infinite;
}

/* Confetti animation */
@keyframes confetti-fall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti {
    animation: confetti-fall 3s ease-in-out forwards;
}

/* Wheel glow pulse */
@keyframes wheel-glow {
    0%, 100% { box-shadow: 0 0 30px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 60px rgba(245, 158, 11, 0.6), 0 0 100px rgba(245, 158, 11, 0.3); }
}

.wheel-glow {
    animation: wheel-glow 2s ease-in-out infinite;
}

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

.level-badge-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Toast notification */
.toast-enter {
    transform: translateX(100%);
    opacity: 0;
}

.toast-enter-active {
    transform: translateX(0);
    opacity: 1;
    transition: all 0.3s ease;
}

.toast-exit {
    transform: translateX(0);
    opacity: 1;
}

.toast-exit-active {
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Selection color - using theme variable */
::selection {
    background: var(--glow-color);
    color: white;
}

/* Focus styles - using theme variable */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   THEME-AWARE UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */

/* Background colors */
.bg-theme-primary { background-color: var(--color-primary); }
.bg-theme-secondary { background-color: var(--color-secondary); }
.bg-theme-accent { background-color: var(--color-accent); }
.bg-theme-dark { background-color: var(--color-dark); }
.bg-theme-card { background-color: var(--color-card); }
.bg-theme-sidebar { background-color: var(--color-sidebar); }

/* Text colors */
.text-theme-accent { color: var(--color-accent); }
.text-theme-muted { color: var(--color-text-muted); }

/* Border colors */
.border-theme { border-color: var(--color-border); }
.border-theme-accent { border-color: var(--color-accent); }

/* Hover states */
.hover\:bg-theme-accent:hover { background-color: var(--color-accent-hover); }

/* ═══════════════════════════════════════════════════════════════
   MEDIA QUERIES
   ═══════════════════════════════════════════════════════════════ */

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

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .no-print {
        display: none !important;
    }
}
