@import 'auth.css';
@import 'dashboard.css?v=8';

/* Dashboard Entry Animation */
#dashboard:not(.hidden) {
    z-index: 500;
    position: relative;
}

@keyframes dashboardFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

:root {
    --primary-color: #00e676;
    /* Vibrant Green */
    --bg-color: #121212;
    /* Dark Mode Background */
    --text-color: #ffffff;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --section-padding: clamp(15px, 5vw, 25px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    min-height: 100vh;
    text-align: center;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* Prevent text selection while tapping */
    -webkit-tap-highlight-color: transparent;
    /* Remove default blue highlight on mobile */
    /* Optimize touch events */
    -webkit-touch-callout: none;
    /* Disable context menu on iOS */
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
}

p {
    font-size: 1.2rem;
    color: #aaaaaa;
}

img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
    /* Default for UI images, can be overridden if clickable */
}

a,
button,
.clickable,
.menu-item {
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

/* Global Button Feedback */
button,
.car-option,
.drift-control-btn,
.game-card {
    transition: transform 0.1s ease;
    will-change: transform;
    backface-visibility: hidden;
}

button:active,
.car-option:active,
.drift-control-btn:active,
.game-card:active {
    filter: brightness(0.85);
    /* Subtle press effect without shrinking hit area */
}

body.sub-screen-active #menu-btn {
    display: none !important;
}

.no-scroll {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    will-change: opacity, visibility;
    transform: translateZ(0); 
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

/* Game Confirmation Modal */
#lex-game-entry-modal {
    z-index: 11000 !important;
}

.game-confirm-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
    background: var(--card-bg);
}

.game-confirm-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

@keyframes pulsate {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 102, 0, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 102, 0, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 102, 0, 0);
    }
}

#game-confirm-title {
    color: var(--primary-color);
    margin-bottom: 10px;
}

#game-confirm-msg {
    margin-bottom: 30px;
    font-size: 1.1em;
    opacity: 0.9;
}

#game-confirm-fee {
    font-weight: 700;
    color: #ffcc00;
    font-size: 1.3em;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-content {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    /* Don't exceed screen height */
    overflow-y: auto;
    /* Allow scrolling if content is long */
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    text-align: right;
    transform: translateZ(0);
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
    overscroll-behavior: contain;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.modal-header h3 {
    margin: 0;
    color: #ffca28;
}

.close-modal {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
}

.order-details {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.order-summary {
    margin-top: 20px;
    padding: 15px;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    color: #00e676;
}

.order-status {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
}

.order-status.success {
    color: #4caf50;
}

.order-status.error {
    color: #f44336;
}

/* Sticker Style Modals (Rewards, VIP Help, etc.) */
/* Sticker Style Modals (Rewards, VIP Help, etc.) */
.modal-content.sticker {
    padding-top: 0;
    text-align: center;
    position: relative;
    overflow: visible !important;
}

/* Internal Scroll Area for Modals - White & Flush to edge */
.modal-scroll-area {
    max-height: 80vh;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #ffffff transparent;
}

.modal-scroll-area::-webkit-scrollbar {
    width: 4px; /* Back to original thin size */
}

.modal-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.modal-scroll-area::-webkit-scrollbar-thumb {
    background: #ffffff !important;
    border-radius: 0;
}

/* COMPACT BUT PROFESSIONAL - NO SCROLL - FOR CHARGE SCREEN */
#charge-help-modal .modal-content {
    max-height: 90vh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important; /* FLUSH IMAGE REQUIREMENT */
    gap: 0 !important;
    background: #1e1e1e !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#charge-help-modal .modal-top-img {
    width: 100% !important;
    height: auto !important;
    max-height: 150px !important;
    margin: 0 !important;
    object-fit: cover !important;
    display: block !important;
}

#charge-help-modal h2 {
    font-size: 1.4rem !important;
    margin: 10px 0 !important;
    line-height: 1.2 !important;
    color: #fff !important;
}

#charge-help-modal .vip-help-steps p {
    font-size: 0.95rem !important;
    margin-bottom: 8px !important;
    line-height: 1.4 !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

#charge-help-modal .payment-info {
    padding: 12px !important;
    margin: 10px 0 !important;
    font-size: 1rem !important;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
}

#charge-help-modal .modal-buttons {
    margin-top: 15px !important;
}

#charge-help-modal .modal-buttons button {
    padding: 12px !important;
    font-size: 1.1rem !important;
    font-weight: 900 !important;
}

/* General Compact Help for others */
.compact-help {
    display: flex !important;
    flex-direction: column !important;
    max-height: 98vh !important;
    padding-bottom: 5px;
}

/* Aggressive compaction for small screens */
@media (max-height: 800px) {
    .compact-help .modal-top-img {
        max-height: 90px;
        width: auto;
    }
    .compact-help h2 {
        font-size: 1.1rem !important;
        margin: 5px 0 !important;
    }
    .compact-help .vip-help-steps p {
        font-size: 0.8rem !important;
        margin-bottom: 2px !important;
        line-height: 1.25;
    }
    .compact-help .payment-info {
        padding: 5px !important;
        margin: 3px 0 !important;
        font-size: 0.8rem;
    }
    .compact-help .modal-buttons {
        margin-top: 5px !important;
    }
    .compact-help .modal-buttons button {
        padding: 8px !important;
        font-size: 0.95rem !important;
    }
}

@media (max-height: 650px) {
    .compact-help .modal-top-img {
        max-height: 60px;
    }
    .compact-help h2 {
        font-size: 0.95rem !important;
    }
    .compact-help .vip-help-steps p {
        font-size: 0.72rem !important;
    }
}

.modal-header-image {
    width: calc(100% + 60px);
    margin: 0 -30px 20px -30px;
    border-bottom: none;
    /* Removed solid border for gradient effect */
    position: relative;
    /* Smooth fade to transparent at the bottom */
    mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
}

.modal-top-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* VIP Specific Fade - Seamless Transition */
.vip-fade {
    border-bottom: none !important;
    box-shadow: none !important;
    position: relative;
    /* Smooth fade to transparent at the bottom */
    mask-image: linear-gradient(to bottom, black 65%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 65%, transparent 100%);
    margin-bottom: 5px !important;
}

/* Responsive Fix for Short Screens (Hiding overflow or shrinking images) */
@media (max-height: 700px) {
    .modal-content {
        padding: 20px;
        max-height: 95vh;
    }

    .modal-header-image {
        margin: 0 -20px 10px -20px;
        width: calc(100% + 40px);
        max-height: 15vh;
        /* Scale down image on short screens */
    }

    .modal-top-img {
        max-height: 15vh;
        object-fit: contain;
    }

    .sticker h2 {
        font-size: 1.2rem;
        margin: 0.5rem 0 !important;
    }

    .vip-help-steps p {
        font-size: 0.85rem !important;
        margin-bottom: 5px !important;
    }
}

/* --- Network Status Banner --- */
.network-banner {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background: #e53935;
    color: white;
    text-align: center;
    padding: 12px 20px;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s;
    font-size: 0.95rem;
    backdrop-filter: blur(5px);
}
.network-banner.hidden {
    transform: translateY(-150%);
}
.network-banner.warning {
    background: #ff9800;
    color: #111;
}
.network-icon {
    width: 20px;
    height: 20px;
}
/* Social Media Glow Effects */
.social-link-yt:active { box-shadow: 0 0 20px rgba(255,0,0,0.8) !important; transform: scale(0.98); }
.social-link-ig:active { box-shadow: 0 0 20px rgba(225,48,108,0.8) !important; transform: scale(0.98); }
.social-link-fb:active { box-shadow: 0 0 20px rgba(66,103,178,0.8) !important; transform: scale(0.98); }
.social-link-web:active { box-shadow: 0 0 20px rgba(255,204,0,0.8) !important; transform: scale(0.98); }

/* Fix for invisible modal children blocking clicks */
.hidden, .hidden * {
    pointer-events: none !important;
}

/* Additional safety for ANY zero opacity modal */
.custom-modal:not(.active) *, .modal:not(.active) * {
    pointer-events: none !important;
}
