/* Add this to styles.css or your main stylesheet */
.wallet-modal-dark-text,
.wallet-modal-dark-text * {
  color: #222 !important;
  background-color: #fff !important;
  border-color: #bbb !important;
}/* Global Styles */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 85px; /* Fix for fixed navbar covering anchor targets */
}
:root {
    --bg-primary: #0b0b1a;
    --bg-secondary: #151525;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af; /* gray-400 */
    --grid-color1: rgba(35, 70, 28, 0.736);
    --grid-color2: rgba(57, 255, 20, 0.03);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-y: scroll !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-connect, .btn-disconnect {
    padding: 0.5em 1em;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.btn-connect {
    background: linear-gradient(to right, #22c55e, #3b82f6);
    color: white;
}

.web3modal-modal-lightbox,
.web3modal-modal-container {
    z-index: 999999 !important;
    position: fixed !important;
}

/* Fix for the wallet modal */
/* Wallet Modal Styles */
#wallet-modal {
    position: fixed;  /* Ensure it's fixed on screen */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* Make the backdrop visually transparent to reveal underlying page */
    background-color: transparent !important;
    z-index: 999999;  /* Ensure it's on top of everything */
    display: none;  /* Hidden by default */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    /* Allow overlay to receive clicks so clicking outside the panel can close the modal */
    pointer-events: auto;
}

/* Ensure the inner modal panel still receives pointer events */
/* Ensure the inner modal panel receives pointer events (interactive) */
#wallet-modal > div {
    pointer-events: auto;
}

/* Show the modal when it's activated */
#wallet-modal.show {
    display: flex !important;  /* Override hidden class */
    visibility: visible;
    opacity: 1;
}

/* Modal Light Mode Overrides */
.light-mode #wallet-modal > div,
#wallet-modal.is-light-mode > div {
    background-color: #ffffff !important; /* Override bg-gray-900 */
    border-color: #e5e7eb !important;     /* Override border-neon-green/30 */
    color: #111827 !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

.light-mode #wallet-modal h2,
#wallet-modal.is-light-mode h2 {
    color: #111827 !important;
}

.light-mode #wallet-modal #closeModalBtn,
#wallet-modal.is-light-mode #closeModalBtn {
    background-color: #f3f4f6 !important;
    color: #4b5563 !important;
    border: 1px solid #e5e7eb !important;
}

.light-mode #wallet-modal #closeModalBtn:hover,
#wallet-modal.is-light-mode #closeModalBtn:hover {
    background-color: #e5e7eb !important;
    color: #111827 !important;
}

/* Navbar Button Light Mode - Updated to Class Selector */
.light-mode .navbar-connect-btn {
    background-color: #39FF14; /* Keep neon green */
    color: #000000;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.light-mode .navbar-connect-btn:hover {
     background-color: #32d613;
}


/* Modal Animations */
.modal-enter {
    animation: fade-in 0.2s ease-out forwards;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hidden class to keep modal hidden on load */
.hidden {
    display: none !important;
}


/* Button for disconnect */
.btn-disconnect {
    background: #ef4444;
    color: white;
}

/* Wallet information */
.wallet-info {
    font-family: monospace;
    font-size: 0.9rem;
    color: #eee;
    margin-right: 1em;
}

/* Wallet button container - only constrain when showing address, not when showing "Connect Wallet" */
#wallet-btn-container button[title] {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* WalletConnect Modals */
.walletconnect-modal {
    z-index: 999999 !important;
}

.walletconnect-qrcode-modal {
    z-index: 999999 !important;
    position: fixed !important;
    top: 0;
    left: 0;
}

/* Modal Animations */
.modal-enter {
    animation: fade-in 0.2s ease-out forwards;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile Menu Transition */
#mobile-menu {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

#mobile-menu.open {
    max-height: 500px;
    opacity: 1;
}

/* Ensure desktop menu is visible on md+ screens */
@media (min-width: 768px) {
    .md\:flex {
        display: flex !important;
    }
    .md\:items-center {
        align-items: center !important;
    }
    .md\:space-x-4 > * + * {
        margin-left: 1rem !important;
    }
}

/* Desktop and Mobile Navbar */
.desktop-navbar {
    display: none; /* Hide by default */
}

@media (min-width: 1024px) {
    .desktop-navbar {
        display: block; /* Show on desktop */
    }
}

.mobile-navbar {
    display: block; /* Show by default on mobile */
}

@media (min-width: 1024px) {
    .mobile-navbar {
        display: none; /* Hide on desktop */
    }
}

/* Light Mode Overrides */
.light-mode {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --grid-color1: rgba(35, 70, 28, 0.05);
    --grid-color2: rgba(57, 255, 20, 0.05);
}

.light-mode .bg-brand-dark\/90 {
    background-color: rgba(240, 242, 245, 0.95) !important;
    border-color: #e5e7eb !important;
}

.light-mode .bg-brand-surface {
    background-color: var(--bg-secondary) !important;
    border-color: #e5e7eb !important;
}

.light-mode .bg-black {
    background-color: #ffffff !important;
    color: #111827 !important;
}

.light-mode .bg-black\/30 {
    background-color: rgba(255, 255, 255, 0.7) !important;
}

.light-mode .bg-black\/40 {
    background-color: rgba(243, 244, 246, 0.8) !important;
}

.light-mode .bg-gray-900\/80 {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-color: #e5e7eb !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.light-mode .bg-gray-900\/50 {
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
}

.light-mode .bg-gray-900\/60 {
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
}

.light-mode .bg-gray-800 {
    background-color: #f3f4f6 !important;
    border-color: #e5e7eb !important;
}

.light-mode .bg-gray-800\/50 {
    background-color: #f9fafb !important;
    border-color: #e5e7eb !important;
}

.light-mode .bg-gray-700 {
    background-color: #e5e7eb !important;
    color: #374151 !important;
}

/* Text overrides for light mode */
.light-mode .text-white:not(.bg-neon-purple):not(.bg-neon-green):not(.group:hover .text-white) {
    color: var(--text-primary) !important;
}

.light-mode .text-gray-300 {
    color: var(--text-secondary) !important;
}

.light-mode .text-gray-400 {
    color: #6b7280 !important;
}

.light-mode .text-gray-500 {
    color: #9ca3af !important;
}

.light-mode .text-gray-600 {
    color: #9ca3af !important;
}

/* Border overrides */
.light-mode .border-gray-700 {
    border-color: #e5e7eb !important;
}

.light-mode .border-gray-800 {
    border-color: #e5e7eb !important;
}

.light-mode .border-gray-900 {
    border-color: #f3f4f6 !important;
}

.light-mode .border-white\/20 {
    border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Input overrides for light mode */
.light-mode input {
    color: #111827 !important;
}

.light-mode input::placeholder {
    color: #9ca3af !important;
}

/* Specific Component Fixes */
.light-mode #mobile-menu {
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
}

.light-mode #presale-widget {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

/* Cyber Grid Background */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image: 
        linear-gradient(var(--grid-color1) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color2) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg) translateY(-100px) translateZ(-200px);
    z-index: -1;
    pointer-events: none;
    transition: background-image 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #39FF14;
}

/* Animations */
.shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    transform: skewX(-12deg) translateX(-150%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% { transform: skewX(-12deg) translateX(150%); }
}

/* Small rate-loading spinner used in the buy widget */
.rate-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.12);
    border-top-color: #39FF14;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse animation for raised and hardcap values */
@keyframes pulse-values {
    0%, 100% {
        opacity: 1;
        color: #d1d5db;
    }
    50% {
        opacity: 0.6;
        color: #9ca3af;
    }
}

#raised-value, #hardcap-value {
    animation: pulse-values 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Debug badge shown when receive value is updated via setReceiveValue */
.receive-debug-badge {
    display: inline-block;
    font-size: 11px;
    padding: 4px 6px;
    border-radius: 6px;
    margin-left: 8px;
    background: rgba(57,255,20,0.08);
    color: #39FF14;
    border: 1px solid rgba(57,255,20,0.12);
    transition: transform 0.18s ease, opacity 0.18s ease;
    opacity: 0.9;
}
.receive-debug-badge.flash {
    transform: scale(1.06);
    opacity: 1;
}