@import url('/users/assets/css/variables.css');

/* ╔════════════════════════════════════════════════════════════════╗ */
/* ║                     GLOBAL BASE STYLES                         ║ */
/* ╚════════════════════════════════════════════════════════════════╝ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-light-2);
    min-height: 100vh;
}

.mono {
    font-family: 'Space Mono', monospace;
}

#app {
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg-light);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.modal-backdrop {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: var(--glass-modal-overlay);
}

/* ╔════════════════════════════════════════════════════════════════╗ */
/* ║                 SHARED ANIMATIONS (All Pages)                  ║ */
/* ║     Animation keyframes used across multiple pages             ║ */
/* ╚════════════════════════════════════════════════════════════════╝ */

/* Slide-up animations */
@keyframes slideUp-full {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp-card {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Fade animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeUp-md {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp-sm {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-slide-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinning/rotating animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Pulse animations */
@keyframes pulse-dot-v1 {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

@keyframes pulse-dot-v2 {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.35;
    }
}

@keyframes pulse-ring {
    0%,
    100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.2;
    }
}

/* Pop/scale animations */
@keyframes checkPop {
    0% {
        transform: scale(0) rotate(-20deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.2) rotate(3deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ╔════════════════════════════════════════════════════════════════╗ */
/* ║              SHARED ANIMATION CLASSES (All Pages)              ║ */
/* ║              Apply keyframe animations to elements             ║ */
/* ╚════════════════════════════════════════════════════════════════╝ */

.animate-slide-up {
    animation: slideUp-full 0.35s cubic-bezier(0.32, 0.72, 0, 1) both;
}

.animate-fade-in {
    animation: fadeIn 0.25s ease both;
}

.animate-fade-up {
    animation: fadeUp-md 0.3s ease both;
}

.anim-slide-up {
    animation: slideUp-full 0.32s cubic-bezier(0.32, 0.72, 0, 1) both;
}

.anim-fade-in {
    animation: fadeIn 0.2s ease both;
}

.anim-fade-up {
    animation: fadeUp-sm 0.28s ease both;
}

.check-pop {
    animation: checkPop 0.45s cubic-bezier(0.32, 0.72, 0, 1) both;
}

.fade-up {
    animation: fadeUp-sm 0.3s ease both;
}

.card-enter {
    animation: fade-slide-up 0.5s ease both;
}

/* Spinner animations */
.spinner-fast {
    animation: spin 0.8s linear infinite;
}

.spinner {
    animation: spin 0.9s linear infinite;
}

/* Pulse animations */
.pulse-dot-v1 {
    animation: pulse-dot-v1 1.5s ease-in-out infinite;
}

.pulse-dot {
    animation: pulse-dot-v2 1.4s ease-in-out infinite;
}

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

/* Transition utilities */
.slide-down {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition:
        max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.28s ease;
}

.slide-down.open {
    max-height: 320px;
    opacity: 1;
}

/* ╔════════════════════════════════════════════════════════════════╗ */
/* ║                  HISTORY TRANSACTIONS PAGE                     ║ */
/* │                 (history-transactions.html)                    │ */
/* ╚════════════════════════════════════════════════════════════════╝ */

/* Background */
.app-bg {
    background: linear-gradient(to bottom, var(--bg-dark-teal), var(--bg-dark-olive));
    min-height: 100vh;
}

/* Glass components */
.glass-card-wallet {
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border-light);
    backdrop-filter: blur(12px);
}

.glass-header {
    background: transparent;
    border-bottom: 1px solid var(--glass-border-thin);
    backdrop-filter: blur(20px);
}

.glass-nav {
    background: var(--glass-bg-dark);
    border-top: 1px solid var(--glass-border-thin);
    backdrop-filter: blur(20px);
}

/* Tab styles */
.tab-active {
    background: var(--tab-active-bg);
    color: var(--text-primary);
}

.tab-active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #34d399;
    border-radius: 2px;
}

.tab-inactive {
    color: var(--text-tertiary);
}

/* Search input styles */
.search-input {
    background: var(--glass-bg-medium);
    border: 1px solid var(--glass-border-thick);
    color: var(--text-primary);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--glass-border-thickest);
}

/* Transaction badge styles */
.badge-success {
    background: var(--glow-success);
    color: var(--success);
}

.badge-pending {
    background: var(--glow-warning);
    color: var(--warning);
}

.badge-failed {
    background: var(--glow-error);
    color: var(--error);
}

/* Status indicator dots */
.dot-success {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.dot-pending {
    background: var(--warning);
    box-shadow: 0 0 6px var(--warning);
}

.dot-failed {
    background: var(--error);
    box-shadow: 0 0 6px var(--error);
}

/* Transaction card */
.tx-card {
    transition:
        transform 0.18s ease,
        background 0.18s ease;
}

.tx-card:active {
    transform: scale(0.985);
}

/* View button */
.view-btn {
    background: var(--glass-border-light);
    color: var(--text-secondary);
    transition: background 0.15s;
}

.view-btn:hover {
    background: var(--tab-active-bg);
}

/* Navigation icons */
.nav-icon-active {
    color: var(--success);
}

.nav-icon-inactive {
    color: var(--text-muted);
}

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

.tab-scroll {
    scrollbar-width: none;
}

/* ╔════════════════════════════════════════════════════════════════╗ */
/* ║                    ACCOUNT PAGE                                ║ */
/* │                    (index.html)                                │ */
/* ╚════════════════════════════════════════════════════════════════╝ */

/* Main background with gradient */
.main-bg {
    background: linear-gradient(
        180deg,
        var(--bg-dark-gradient-start) 0%,
        var(--bg-dark-gradient-mid) 45%,
        var(--bg-dark-gradient-end) 100%
    );
    position: relative;
    min-height: 100vh;
}

/* Glow effect on main background */
.main-bg::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, var(--glow-primary) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.main-bg > * {
    position: relative;
    z-index: 1;
}

/* Hide scrollbars */
.main-bg ::-webkit-scrollbar {
    display: none;
}

/* ╔════════════════════════════════════════════════════════════════╗ */
/* ║                      MODALS                                    ║ */
/* │                  (modals.html)                                 │ */
/* ╚════════════════════════════════════════════════════════════════╝ */

.live-card-enter {
    animation: scale-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ╔════════════════════════════════════════════════════════════════╗ */
/* ║              BACKGROUND GLOW EFFECTS (Shared)                  ║ */
/* │  Used for atmospheric visual effects on pages                  │ */
/* ╚════════════════════════════════════════════════════════════════╝ */

/* Glow elements (positioned absolutely for layered effect) */
.glow {
    position: absolute;
    top: -220px;
    left: 10%;
    width: 80px;
    height: 420px;
    transform: rotate(20deg);
    background: radial-gradient(
        ellipse at 40% 40%,
        var(--emerald-dark) 0%,
        var(--emerald-medium) 20%,
        var(--emerald-dim) 40%,
        var(--emerald-base) 50%,
        transparent 75%
    );
    filter: blur(18px);
}

.glow-2 {
    position: absolute;
    top: -220px;
    left: 30%;
    width: 80px;
    height: 480px;
    transform: rotate(20deg);
    background: radial-gradient(
        ellipse at 40% 40%,
        var(--emerald-dark) 0%,
        var(--emerald-medium) 20%,
        var(--emerald-dim) 40%,
        var(--emerald-base) 50%,
        transparent 75%
    );
    filter: blur(18px);
}

.glow-3 {
    position: absolute;
    top: -220px;
    left: 50%;
    width: 80px;
    height: 560px;
    transform: rotate(20deg);
    background: radial-gradient(
        ellipse at 40% 40%,
        var(--emerald-dark) 0%,
        var(--emerald-medium) 20%,
        var(--emerald-dim) 40%,
        var(--emerald-base) 50%,
        transparent 75%
    );
    filter: blur(18px);
}

.glow-4 {
    position: absolute;
    top: -220px;
    left: 80%;
    width: 80px;
    height: 520px;
    transform: rotate(20deg);
    background: radial-gradient(
        ellipse at 40% 40%,
        var(--emerald-dark) 0%,
        var(--emerald-medium) 20%,
        var(--emerald-dim) 40%,
        var(--emerald-base) 50%,
        transparent 75%
    );
    filter: blur(18px);
}

/* ╔════════════════════════════════════════════════════════════════╗ */
/* ║                        GAME PAGE                               ║ */
/* │                       (game.html)                              │ */
/* ╚════════════════════════════════════════════════════════════════╝ */

/* Card states for game page */
.expired-card {
    opacity: 0.52;
    filter: saturate(0.5);
    transition:
        opacity 0.3s,
        filter 0.3s;
}

.expired-card:hover {
    opacity: 0.72;
    filter: saturate(0.7);
}

.later-card {
    opacity: 0.36;
    transition: opacity 0.3s;
}

.later-card:hover {
    opacity: 0.55;
}

/* Game page animations */
@keyframes pulse-glow {
    0%,
    100% {
        box-shadow:
            0 0 0 1.5px rgba(52, 211, 153, 0.45),
            0 0 32px rgba(52, 211, 153, 0.28),
            0 0 80px rgba(52, 211, 153, 0.12),
            0 20px 60px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow:
            0 0 0 2px rgba(52, 211, 153, 0.7),
            0 0 56px rgba(52, 211, 153, 0.45),
            0 0 120px rgba(52, 211, 153, 0.2),
            0 20px 60px rgba(0, 0, 0, 0.5);
    }
}

@keyframes border-breathe {
    0%,
    100% {
        border-color: rgba(52, 211, 153, 0.3);
    }
    50% {
        border-color: rgba(52, 211, 153, 0.7);
    }
}

@keyframes spotlight {
    0%,
    100% {
        opacity: 0.06;
    }
    50% {
        opacity: 0.13;
    }
}

@keyframes countdown-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.55;
    }
}

/* Live glow card effect */
.live-glow {
    animation:
        pulse-glow 2.6s ease-in-out infinite,
        border-breathe 2.6s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

/* Inner spotlight overlay on live glow */
.live-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: radial-gradient(ellipse at 50% 0%, rgba(52, 211, 153, 1) 0%, transparent 70%);
    animation: spotlight 2.6s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.live-glow > * {
    position: relative;
    z-index: 1;
}

/* Dim effect for non-active cards */
.bg-dim {
    opacity: 0.45;
    filter: saturate(0.45) brightness(0.8);
    transition: all 0.35s;
}

.bg-dim:hover {
    opacity: 0.68;
    filter: saturate(0.65) brightness(0.9);
}

/* Game page animation classes */
.countdown-blink {
    animation: countdown-pulse 1s ease-in-out infinite;
}

/* ╔════════════════════════════════════════════════════════════════╗ */
/* ║                      SHARED UTILITIES                          ║ */
/* │  Common layout and background styles used across pages         │ */
/* ╚════════════════════════════════════════════════════════════════╝ */

.main-bg-wallet {
    background: linear-gradient(to bottom, var(--bg-dark-teal), var(--bg-dark-olive));
    min-height: 100vh;
}

/* ╔════════════════════════════════════════════════════════════════╗ */
/* ║                    CHART STYLES (Game Page)                   ║ */
/* ╚════════════════════════════════════════════════════════════════╝ */

.chart-range-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.chart-range-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.active-range {
    background: rgba(52, 211, 153, 0.18) !important;
    color: #34d399 !important;
    border-color: rgba(52, 211, 153, 0.3) !important;
}

/* DM Mono font for chart elements */
.mono-dm {
    font-family: 'DM Mono', monospace;
}

/* ╔════════════════════════════════════════════════════════════════╗ */
/* ║                  FRIENDS & REFERRAL PAGE                      ║ */
/* │                    (friends.html)                              │ */
/* ╚════════════════════════════════════════════════════════════════╝ */

/* Friends page background */
.friends-bg {
    background: linear-gradient(to bottom right, #032f1f, #0a3a28, #000000);
    min-height: 100vh;
    color: white;
}

/* Glass card styling for friends page */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Glass button styling */
.glass-button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px 12px;
    font-size: 12px;
    color: #4ade80;
    transition: all 300ms ease;
    cursor: pointer;
    white-space: nowrap;
}

.glass-button:hover {
    background: rgba(52, 211, 153, 0.2);
}

.glass-button:active {
    transform: scale(0.95);
}

/* Friend item styling */
.friend-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 300ms ease;
}

.friend-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Avatar styling */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(52, 211, 153, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #4ade80;
    flex-shrink: 0;
}

/* Avatar color variants */
.avatar-blue {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.avatar-purple {
    background: rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
}

.avatar-orange {
    background: rgba(249, 115, 22, 0.2);
    color: #fb923c;
}

.avatar-pink {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

/* Bottom navigation styling */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
    z-index: 50;
}

/* Navigation item styling */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 300ms ease;
    flex: 1;
}

.nav-item.active {
    color: #4ade80;
}

.nav-item:not(.active) {
    color: rgba(255, 255, 255, 0.5);
}

.nav-icon {
    font-size: 20px;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
}

/* Toast notification styling */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(52, 211, 153, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 1000;
    animation: toastFadeInOut 2s ease-in-out;
}

/* Toast animation keyframes */
@keyframes toastFadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%);
    }
}
