body {
    font-family: 'Quicksand', sans-serif;
    overflow-x: hidden;
    /* Transisi background dihapus agar pergantian tema terjadi instan */
}

/* Animated Mesh Gradient Background (Tetap dipertahankan karena memberi tekstur, namun sekarang background dasar solid) */
.bg-mesh {
    background-color: #f8fafc;
    background-image: 
        radial-gradient(at 40% 20%, hsla(253,16%,7%,0) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(189,100%,56%,0.15) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(355,100%,93%,0.5) 0px, transparent 50%),
        radial-gradient(at 80% 50%, hsla(340,100%,76%,0.15) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(22,100%,77%,0.15) 0px, transparent 50%),
        radial-gradient(at 80% 100%, hsla(242,100%,70%,0.15) 0px, transparent 50%),
        radial-gradient(at 0% 0%, hsla(343,100%,76%,0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

.dark .bg-mesh {
    background-color: #0f172a;
    background-image: 
        radial-gradient(at 40% 20%, hsla(253,16%,7%,0) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(189,100%,56%,0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(355,100%,93%,0.05) 0px, transparent 50%),
        radial-gradient(at 80% 50%, hsla(340,100%,76%,0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(22,100%,77%,0.1) 0px, transparent 50%),
        radial-gradient(at 80% 100%, hsla(242,100%,70%,0.1) 0px, transparent 50%),
        radial-gradient(at 0% 0%, hsla(343,100%,76%,0.05) 0px, transparent 50%);
}

/* --- PERUBAHAN: Glass Effect Menjadi Solid --- */
.glass {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.dark .glass {
    background: #1e293b;
    border: 1px solid #334155;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.glass-input {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: #ffffff;
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.dark .glass-input {
    background: #0f172a;
    border: 1px solid #334155;
    color: white;
}

.dark .glass-input:focus {
    background: #1e293b;
    border-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}
/* --------------------------------------------- */

.slide-up { animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.fade-in { animation: fadeIn 0.4s ease forwards; }

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

@keyframes slideOutLeft { 0% { transform: translateX(0) scale(1); opacity: 1; } 100% { transform: translateX(-30px) scale(0.8); opacity: 0; } }
@keyframes slideInRight { 0% { transform: translateX(30px) scale(0.8); opacity: 0; } 100% { transform: translateX(0) scale(1); opacity: 1; } }
@keyframes slideOutRight { 0% { transform: translateX(0) scale(1); opacity: 1; } 100% { transform: translateX(30px) scale(0.8); opacity: 0; } }
@keyframes slideInLeft { 0% { transform: translateX(-30px) scale(0.8); opacity: 0; } 100% { transform: translateX(0) scale(1); opacity: 1; } }

.anim-out-left { animation: slideOutLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.anim-in-right { animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.anim-out-right { animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.anim-in-left { animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

.hidden-view { display: none !important; }

#toast {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    transform: translate(-50%, -100%);
    opacity: 0;
    z-index: 9999;
    max-width: 90vw;
    width: max-content;
}
#toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

/* Avatar perfectly centered UI Fix */
.avatar-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0;
    position: relative;
}

.avatar-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    position: absolute;
    top: 0;
    left: 0;
}

.hover\:-translate-y-0\.5:hover {
    transform: translateY(-2px);
}

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

/* Translate Dropdown Animation */
.dropdown-enter {
    animation: dropdownFadeScale 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes dropdownFadeScale {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* --- ANIMASI BARU: Theme Toggle --- */
@keyframes spinScale {
    0% { transform: scale(0.5) rotate(-180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
.theme-icon-anim {
    animation: spinScale 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* =========================================================================
   ANIMASI TAMBAHAN (UI/UX SPECIALIST UPDATE)
========================================================================= */

/* 1 & 2. Animasi Perisai & Foto Profile (Drop dari atas, Fade In, lalu Floating) */
@keyframes dropFadeIn {
    0% { transform: translateY(-40px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

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

/* Class ini memanggil 2 animasi berurutan (chaining). 
   dropFadeIn berjalan 0.6s, setelah 0.6s selesai, floatUpDown langsung berjalan infinite */
.anim-drop-float {
    animation: dropFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards, floatUpDown 3s ease-in-out 0.6s infinite;
}

/* 3. Animasi Theme Toggle Spesifik (Matahari & Bulan) */

/* Matahari: mengecil -> membesar -> berputar searah jarum jam */
@keyframes sunSpinGrow {
    0% { transform: scale(1) rotate(0deg); }
    30% { transform: scale(0.3) rotate(0deg); }
    70% { transform: scale(1.3) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}
.anim-sun-custom {
    animation: sunSpinGrow 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Bulan: Muncul membesar -> Goyang kiri kanan (Rock/Wobble) */
@keyframes moonWobble {
    0% { transform: scale(0.3) rotate(-30deg); opacity: 0; }
    40% { transform: scale(1.15) rotate(15deg); opacity: 1; }
    60% { transform: scale(1) rotate(-10deg); }
    80% { transform: scale(1.05) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.anim-moon-custom {
    animation: moonWobble 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 4. Transisi Smooth untuk Sistem Rating Bintang & Chips Pesan */
.star-btn {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
}
.star-btn:hover {
    transform: scale(1.2);
}
.star-btn:active {
    transform: scale(0.9);
}

.chip-msg {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.chip-msg:active {
    transform: scale(0.95);
}

/* =========================================================================
   UPDATE UI/UX POLISH (RATING & SOSMED)
========================================================================= */

/* 1. Style Bintang Rating (SVG) */
svg polygon, .star-btn svg, .star-btn-history svg {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.star-inactive {
    color: #cbd5e1; /* abu-abu */
    fill: transparent;
    transition: 0.2s ease;
}

.dark .star-inactive {
    color: #475569; /* abu-abu gelap */
}

.star-active {
    color: #facc15; /* kuning */
    fill: currentColor;
    transition: 0.2s ease;
}

.star-btn svg, .star-btn-history svg {
    transition: all 0.3s ease;
}

.star-btn:hover svg, .star-btn-history:hover svg {
    transform: scale(1.1);
}

/* 2. Polish Animasi Klik Bintang (Pop) */
@keyframes starClickPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); fill: #facc15; }
    100% { transform: scale(1); }
}

.star-btn:active svg, .star-btn-history:active svg {
    animation: starClickPop 0.25s ease-out forwards;
}

/* 3. Style Icon Sosmed */
.social-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #ccc;
    animation: floatUpDown 2s ease-in-out infinite;
    transition: all 0.3s ease;
}

.dark .social-icon {
    border: 2px solid white;
}

.whatsapp { animation-delay: 0s; }
.youtube { animation-delay: 0.5s; }
.tiktok { animation-delay: 1s; }

/* Review/Testimonial button spacing under Withdraw Funds */
#review-action-container,
.review-action-container {
    margin-top: 6px !important;
}

/* Paksa tombol di dalamnya tidak punya margin tambahan */
#review-action-container > button,
#review-action-container > a,
.review-action-container > button,
.review-action-container > a {
    margin-top: 0 !important;
}

/* Kurangi jarak bawah tombol Withdraw Funds jika elemen sebelumnya punya margin besar */
#btn-withdraw,
.withdraw-btn,
button[onclick="window.openWithdrawModal()"] {
    margin-bottom: 6px !important;
}

/* =========================================================================
   DASHBOARD CARD WATERMARK (STATIC ONLY)
========================================================================= */
.dashboard-card-icon-wrap {
    position: relative;
    overflow: hidden;
}

.dashboard-card-watermark {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 72px;
    height: 72px;
    color: #6366f1;
    opacity: 0.075;
    pointer-events: none;
    z-index: 0;
}

.dashboard-card-icon-wrap > *:not(.dashboard-card-watermark) {
    position: relative;
    z-index: 1;
}

.dark .dashboard-card-watermark {
    opacity: 0.055;
}

@media (max-width: 400px) {
    .dashboard-card-watermark {
        width: 58px;
        height: 58px;
        right: -10px;
    }
}

.google-setup-avatar-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.google-setup-avatar-option {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    border: 2px solid rgba(148, 163, 184, 0.35);
    background: rgba(248, 250, 252, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.google-setup-avatar-option:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.65);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.18);
}

.google-setup-avatar-option.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
}

.google-setup-avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
    pointer-events: none;
}

.dark .google-setup-avatar-option {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(71, 85, 105, 0.8);
}

.dark .google-setup-avatar-option.selected {
    border-color: #818cf8;
    background: rgba(129, 140, 248, 0.12);
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.16);
}

@media (max-width: 380px) {
    .google-setup-avatar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

#google-avatar-preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#google-avatar-preview-container img,
#google-avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9999px;
}

.password-eye-icon,
.password-eye-off-icon {
    transition: transform 0.2s ease, color 0.2s ease;
}

button:active .password-eye-icon,
button:active .password-eye-off-icon {
    transform: scale(0.9);
}

.profile-press-btn,
.google-setup-action-btn,
.google-setup-cancel-btn {
    transform: scale(1);
    transition:
        transform 0.14s cubic-bezier(0.2, 0.9, 0.3, 1.2),
        box-shadow 0.14s ease,
        border-color 0.14s ease;
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.profile-press-btn:active,
.google-setup-action-btn:active,
.google-setup-cancel-btn:active {
    transform: scale(0.94);
}

.profile-press-btn:focus-visible,
.google-setup-action-btn:focus-visible,
.google-setup-cancel-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

.google-email-menu {
    transform-origin: top right;
    animation: googleEmailMenuIn 0.16s ease forwards;
}

@keyframes googleEmailMenuIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#profile-gradient-bg {
    transition: background-image 0.45s ease, background-color 0.45s ease;
}

.google-email-menu .google-setup-action-btn {
    min-height: 52px;
}

.google-email-menu .google-setup-action-btn:active {
    transform: scale(0.97);
}

/* Premium Purple Refresh Button + Sonar Ripple */
.refresh-btn.option-50.datzon-refresh-btn {
    position: relative;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    border: none;
    color: #ffffff;
    background: linear-gradient(135deg, #a855f7, #4f46e5);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.42),
        0 4px 10px rgba(79, 70, 229, 0.30);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease;
    overflow: visible;
    isolation: isolate;
}

.refresh-btn.option-50.datzon-refresh-btn::before,
.refresh-btn.option-50.datzon-refresh-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    z-index: -1;
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.45);
}

.refresh-btn.option-50.datzon-refresh-btn:active {
    transform: scale(0.92);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.30),
        0 2px 5px rgba(79, 70, 229, 0.22);
}

.refresh-btn.option-50.datzon-refresh-btn svg {
    width: 22px;
    height: 22px;
    display: block;
    transition: transform 0.2s ease;
}

.refresh-btn.option-50.datzon-refresh-btn.is-refreshing {
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.34),
        0 0 15px rgba(168, 85, 247, 0.62),
        0 8px 22px rgba(79, 70, 229, 0.35);
}

.refresh-btn.option-50.datzon-refresh-btn.is-refreshing svg {
    animation: datzonRefreshSpin 3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.refresh-btn.option-50.datzon-refresh-btn.is-refreshing::before {
    animation: datzonRefreshSonar 1.5s ease-out infinite;
}

.refresh-btn.option-50.datzon-refresh-btn.is-refreshing::after {
    animation: datzonRefreshSonar 1.5s ease-out infinite;
    animation-delay: 0.45s;
}

@keyframes datzonRefreshSpin {
    0% {
        transform: rotate(0deg) scale(1);
    }

    45% {
        transform: rotate(520deg) scale(1.08);
    }

    100% {
        transform: rotate(1080deg) scale(1);
    }
}

@keyframes datzonRefreshSonar {
    0% {
        opacity: 0.65;
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.50);
    }

    70% {
        opacity: 0.18;
        box-shadow: 0 0 0 16px rgba(168, 85, 247, 0.08);
    }

    100% {
        opacity: 0;
        box-shadow: 0 0 0 24px rgba(168, 85, 247, 0);
    }
}

.dark .refresh-btn.option-50.datzon-refresh-btn {
    background: linear-gradient(135deg, #8b5cf6, #4338ca);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.26),
        0 4px 12px rgba(139, 92, 246, 0.34);
}

.dark .refresh-btn.option-50.datzon-refresh-btn.is-refreshing {
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.22),
        0 0 18px rgba(168, 85, 247, 0.72),
        0 8px 24px rgba(67, 56, 202, 0.42);
}
