/* 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);
}

/* Game Grid - Listing Pages */
.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (min-width: 640px) {
    .game-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
    .game-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 1024px) {
    .game-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (min-width: 1280px) {
    .game-grid { grid-template-columns: repeat(8, 1fr); }
}

.game-grid .game-card {
    width: 100%;
}

/* Game Carousel */
.game-carousel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 4px;
}

.game-carousel-item {
    flex-shrink: 0;
    width: 140px;
}

@media (min-width: 640px) {
    .game-carousel-item { width: 155px; }
}

@media (min-width: 768px) {
    .game-carousel-item { width: 165px; }
}

@media (min-width: 1024px) {
    .game-carousel-item { width: 175px; }
}

@media (min-width: 1280px) {
    .game-carousel-item { width: 185px; }
}

/* 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;
    }
}

/* ═══════════════════════════════════════════════════════════════
   TOP-NAV LAYOUT SYSTEM (v2 Redesign)
   ═══════════════════════════════════════════════════════════════ */

.topnav-categories {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0 16px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.topnav-categories::-webkit-scrollbar {
    display: none;
}

.topnav-cat-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    text-decoration: none;
}

.topnav-cat-item:hover,
.topnav-cat-item.active {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.topnav-cat-item.active {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: rgba(239, 68, 68, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   GAME CARD v2 - Rounded Modern with Glow
   ═══════════════════════════════════════════════════════════════ */

.game-card-v2 {
    text-decoration: none;
    display: block;
    transition: transform 0.3s ease;
}

.game-card-v2:hover {
    transform: scale(1.05);
}

.game-card-v2 .card-v2-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 14px;
    background: #0c0a09;
}

.game-card-v2 .card-v2-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    transition: transform 0.3s ease;
    color: transparent;
    font-size: 0;
}

.game-card-v2:hover .card-v2-image img {
    transform: scale(1.08);
}

.game-card-v2 .card-v2-info {
    padding: 5px 2px 0;
    text-align: center;
    height: 18px;
    overflow: hidden;
}

.game-card-v2 .card-v2-name {
    font-size: 10px;
    font-weight: 600;
    color: #e7e5e4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
}

.badge-status-v2 {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 700;
    border-radius: 6px;
    z-index: 10;
    backdrop-filter: blur(4px);
    letter-spacing: 0.5px;
}

.badge-status-v2.gacor { background: rgba(34, 197, 94, 0.85); color: white; }
.badge-status-v2.normal { background: rgba(245, 158, 11, 0.85); color: white; }
.badge-status-v2.dingin { background: rgba(239, 68, 68, 0.85); color: white; }

.badge-rtp-v2 {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 700;
    border-radius: 6px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.game-card-v2 .play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 15;
}

.game-card-v2:hover .play-overlay {
    opacity: 1;
}

.play-overlay .play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 20px var(--glow-color);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.game-card-v2:hover .play-overlay .play-btn {
    transform: scale(1);
}

/* ═══════════════════════════════════════════════════════════════
   HOMEPAGE v2 SECTIONS
   ═══════════════════════════════════════════════════════════════ */

.hot-games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (min-width: 640px) {
    .hot-games-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}

@media (min-width: 768px) {
    .hot-games-grid { grid-template-columns: repeat(5, 1fr); gap: 12px; }
}

@media (min-width: 1024px) {
    .hot-games-grid { grid-template-columns: repeat(6, 1fr); gap: 14px; }
}

@media (min-width: 1280px) {
    .hot-games-grid { grid-template-columns: repeat(8, 1fr); gap: 14px; }
}

.live-stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.live-stats-bar::-webkit-scrollbar { display: none; }

@media (max-width: 640px) {
    .live-stats-bar {
        gap: 12px;
        justify-content: space-between;
        padding: 10px 12px;
    }
}

.live-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .live-stat-item { gap: 4px; }
    .live-stat-item span { font-size: 11px !important; }
}

.live-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.provider-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (min-width: 640px) {
    .provider-strip { grid-template-columns: repeat(6, 1fr); gap: 10px; }
}

@media (min-width: 1024px) {
    .provider-strip { grid-template-columns: repeat(9, 1fr); gap: 10px; }
}

.provider-strip-item {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: linear-gradient(135deg, #1a1a32 0%, #151528 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 8px;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    font-size: 0;
    color: transparent;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.provider-strip-item:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #222245 0%, #1c1c38 100%);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.provider-strip-item img {
    max-width: 85%;
    max-height: 75%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: brightness(0.95) contrast(1.05);
    transition: filter 0.2s ease, transform 0.2s ease;
}

.provider-strip-item:hover img {
    filter: brightness(1.2) contrast(1.05);
    transform: scale(1.05);
}

.provider-strip-item .provider-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    width: 100%;
    height: 100%;
}

.section-header-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-header-v2 h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (min-width: 1024px) {
    .section-header-v2 h3 { font-size: 20px; }
}

.winners-ticker {
    display: flex;
    gap: 12px;
    overflow: hidden;
    transition: transform 0.1s linear;
}

.winners-ticker-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Game card v2 inside grid — force uniform sizing */
.hot-games-grid .game-card-v2,
.game-grid .game-card-v2 {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.hot-games-grid,
.game-grid {
    align-items: start;
}

