/* ===============================
   GLOBAL
================================ */
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-family: system-ui;
}
.container {
    max-width: 1200px;
    margin: auto;
    padding: 0 14px;
}

/* ===============================
   DESKTOP
================================ */
.top-bar {
    background: #111b34;
}
.navbar {
    background: #0b1324;
}
.hero {
    padding: 16px;
}
.result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ===============================
   MOBILE
================================ */
@media (max-width: 768px) {
    .hero {
        padding: 0;
    }
    .mobile-carousel img {
        border-radius: 12px;
    }

    .quick-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-top: 10px;
    }

    .player-win {
        margin: 10px 0;
        padding: 10px;
        border-radius: 10px;
        background: #111b34;
    }

    .tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        width: 100%;
    }

    .filter-select select {
        width: 100%;
        margin-top: 8px;
        padding: 10px;
    }

    .result-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

.nav-item {
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    border-bottom: 2px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background: #111b34;
    border-bottom: 2px solid #d946ef;
    color: #f0abfc;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 14px;
    color: #cbd5f5;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: #111b34;
    color: #f0abfc;
}
.nav-item i {
    transition: color 0.25s ease;
}

.nav-item:hover i,
.nav-item.active i {
    color: #f0abfc;
}
.nav-item-mobile {
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    color: #cbd5f5;
    font-size: 15px;
    transition: background 0.2s ease;
}

.nav-item-mobile:hover,
.nav-item-mobile.active {
    background: #0b1324;
    color: #f0abfc;
}

/* ===============================
   STICKY ELEMENTS
================================ */

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 50;
}
.top-nav {
    position: sticky;
    top: 40px;
    z-index: 40;
}

.sticky-tab {
    position: sticky;
    top: calc(40px + 52px);
    z-index: 30;
}

/* ===============================
   MOBILE SIDEBAR
================================ */

.mobile-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 75%;
    max-width: 300px;
    height: 100%;
    background: #111b34;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    z-index: 100;
    overflow-y: auto;
}

.mobile-sidebar.open {
    transform: translateX(0); /* Slide in */
    box-shadow: -10px 0 20px rgba(0, 0, 0, 0.5);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 90;
}

.mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}
@media (min-width: 768px) {
    .mobile-sidebar,
    .mobile-menu-overlay {
        display: none;
    }
}
/* ===============================
   3D CAROUSEL (Desktop)
================================ */

.carousel-container {
    width: 100%;
    max-width: 900px;
    height: 320px;
    margin: auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
}

.carousel-container input {
    display: none;
}

.carousel-cards {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-card {
    position: absolute;
    width: 80%;
    height: 100%;
    left: 0;
    right: 0;
    margin: auto;
    cursor: pointer;
    transition: transform 0.5s ease, opacity 0.5s ease, border 0.3s,
        box-shadow 0.3s;
    background: #111b34;
    border: 1px solid rgba(217, 70, 239, 0.3);
    border-radius: 14px;
}

.carousel-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid transparent;
}

@media (min-width: 768px) {
    .carousel-container {
        height: 420px;
    }

    #slide-1:checked ~ .carousel-cards #card-3,
    #slide-2:checked ~ .carousel-cards #card-1,
    #slide-3:checked ~ .carousel-cards #card-2 {
        transform: translateX(-40%) scale(0.85);
        opacity: 0.4;
        z-index: 0;
    }

    #slide-1:checked ~ .carousel-cards #card-2,
    #slide-2:checked ~ .carousel-cards #card-3,
    #slide-3:checked ~ .carousel-cards #card-1 {
        transform: translateX(40%) scale(0.85);
        opacity: 0.4;
        z-index: 0;
    }

    #slide-1:checked ~ .carousel-cards #card-1,
    #slide-2:checked ~ .carousel-cards #card-2,
    #slide-3:checked ~ .carousel-cards #card-3 {
        transform: translateX(0) scale(1);
        opacity: 1;
        z-index: 1;
    }

    #slide-1:checked ~ .carousel-cards #card-1 img,
    #slide-2:checked ~ .carousel-cards #card-2 img,
    #slide-3:checked ~ .carousel-cards #card-3 img {
        box-shadow: 0 0 30px rgba(217, 70, 239, 0.35);
    }
    .fade-card {
        animation: none !important;
    }
}

/* ===============================
   FADE-IN/FADE-OUT CAROUSEL (Mobile)
================================ */

@media (max-width: 767px) {
    .carousel-card {
        transform: translateX(0) scale(1) !important;
        opacity: 0;
        z-index: 0;
        transition: opacity 0.5s ease-in-out;
        width: 100%;
    }
    .carousel-card.active-slide {
        opacity: 1;
        z-index: 1;
    }

    .carousel-container {
        perspective: none;
        height: 220px;
    }
}

/* ===============================
   LOADING OVERLAY
================================ */

.swap-loading {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: rgba(11, 19, 36, 0.92);
    backdrop-filter: blur(6px);

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.swap-loading.active {
    opacity: 1;
    pointer-events: all;
}

.loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loader-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #d946ef;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 18px rgba(217, 70, 239, 0.6);
}

.loader-text {
    font-size: 14px;
    color: #d946ef;
    letter-spacing: 0.08em;
}

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

/* ===============================
   CUSTOM SCROLLBAR
================================ */

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0b1324;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #d946ef, #a855f7);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #f0abfc, #d946ef);
}
* {
    scrollbar-width: thin;
    scrollbar-color: #d946ef #0b1324;
}
/* PAGE LOADING STATE */
#swap-container[data-loaded="true"] .page-loader {
    display: none;
}

#swap-container[data-loaded="true"] .page-content {
    display: block;
}

/* scrollbar khusus content */
.page-content,
.flex-1 {
    scrollbar-width: thin;
    scrollbar-color: #d946ef #0b1324;
}

.flex-1::-webkit-scrollbar {
    width: 8px;
}

.flex-1::-webkit-scrollbar-track {
    background: #0b1324;
}

.flex-1::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #d946ef, #a855f7);
    border-radius: 999px;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scaleIn {
    animation: scaleIn 0.25s ease-out;
}

li[data-swap="history"] {
    display: none !important;
}
.animate-fadeInOut {
    animation: fadeInOut 3s infinite;
}
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    10% {
        opacity: 1;
        transform: translateY(0);
    }
    90% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}
