/* Reset and base styles - pump.fun exact match */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
}

/* Exact pump.fun background color */
.bg-background {
    background-color: #0a0a0a !important;
}

/* Connect wallet button styling to match pump.fun */
.connect-wallet-btn {
    background-color: #86efac !important;
    color: #000000 !important;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.connect-wallet-btn:hover {
    background-color: #65e09b !important;
    transform: translateY(-1px);
}

.connect-wallet-btn:active {
    transform: translateY(0);
}

/* Toggle button styling to match pump.fun */
[data-toggle] {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

[data-toggle].bg-green-300 {
    background-color: #86efac !important;
    color: #000000 !important;
}

[data-toggle]:hover:not(.bg-green-300) {
    background-color: #1f2937;
}

/* Carousel card styling */
.carousel-card {
    background-color: #1C2530 !important;
    border-radius: 12px;
    padding: 12px;
    color: #cbd5e1;
}

/* Skeleton loading animations */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* Scrollbar hide */
.overflow-x-auto {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.overflow-x-auto::-webkit-scrollbar {
    display: none;
}

/* Search input styling */
input[type="text"] {
    background-color: rgba(17, 24, 39, 0.5) !important;
    border: 1px solid #4b5563;
    color: #ffffff;
}

input[type="text"]:focus {
    border-color: #6b7280;
    outline: none;
    box-shadow: 0 0 0 1px #6b7280;
}

input[type="text"]::placeholder {
    color: #9ca3af;
}

/* Button base styling */
button {
    transition: all 0.2s ease;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Link styling */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Grid responsive adjustments */
@media (max-width: 768px) {
    .coin-grid-responsive {
        grid-template-columns: 1fr;
    }
    
    .mobile-px-1 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    
    .mobile-pt-4 {
        padding-top: 1rem;
    }
    
    .mobile-mb-2 {
        margin-bottom: 0.5rem;
    }
    
    .mobile-mt-12 {
        margin-top: 3rem;
    }
    
    .mobile-mb-12 {
        margin-bottom: 3rem;
    }
}

/* Specific pump.fun color overrides */
.bg-slate-700-50 {
    background-color: rgba(51, 65, 85, 0.5) !important;
}

.bg-green-300-20 {
    background-color: rgba(134, 239, 172, 0.2) !important;
}

.text-gray-400 {
    color: #9ca3af !important;
}

.text-gray-500 {
    color: #6b7280 !important;
}

.text-slate-400 {
    color: #94a3b8 !important;
}

.text-slate-50 {
    color: #f8fafc !important;
}

/* Z-index fixes */
.z-11 {
    z-index: 11;
}

.z-1 {
    z-index: 1;
}

/* Custom spacing */
.gap-8px {
    gap: 8px;
}

.gap-6px {
    gap: 6px;
}

.h-14px {
    height: 14px;
}

.h-12px {
    height: 12px;
}

.mt-10px {
    margin-top: 10px;
}

.mt-6px {
    margin-top: 6px;
}

/* Responsive text sizing */
.text-16px {
    font-size: 16px;
}

/* Transform utilities */
@media (min-width: 768px) {
    .md-translate-x-center {
        transform: translateX(-50%);
    }

    .md-transform {
        transform: translate(0, 0);
    }
}

/* Animation duration override */
.animate-pulse {
    animation-duration: 2s;
}

/* Additional pump.fun specific styles */
.coin-item {
    flex-shrink: 0;
    margin-right: 12px;
}

#carousel-container {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#carousel-container::-webkit-scrollbar {
    display: none;
}

/* Loading states */
.bg-gray-800-50 {
    background-color: rgba(31, 41, 55, 0.5) !important;
}

/* Footer link styles */
.underline {
    text-decoration: underline;
}

/* Sticky positioning */
.sticky {
    position: sticky;
}

.left-0 {
    left: 0px;
}

.top-0 {
    top: 0px;
}

/* Wallet Connection Popup Styles */
.wallet-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
    pointer-events: all;
}

.wallet-popup-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.wallet-popup {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    transform: scale(1);
    transition: transform 0.3s ease;
    pointer-events: all;
}

.wallet-popup-overlay.hidden .wallet-popup {
    transform: scale(0.95);
}

.wallet-popup-content h2 {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.wallet-popup-content p {
    color: #cbd5e1;
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.popup-connect-btn {
    background-color: #86efac;
    color: #000000;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.popup-connect-btn:hover {
    background-color: #65e09b;
    transform: translateY(-1px);
}

.popup-connect-btn:active {
    transform: translateY(0);
}

/* No blur effect - content is blocked but not blurred */
body.wallet-popup-active .flex.min-h-screen {
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Ensure wallet selection popups appear above our modal */
[class*="wallet"], [id*="wallet"], [class*="phantom"], [id*="phantom"] {
    z-index: 10000 !important;
}

/* Common wallet popup selectors */
.wallet-adapter-modal, 
.wallet-selector-modal,
.phantom-wallet-modal,
[role="dialog"]:has([class*="wallet"]),
[role="dialog"]:has([class*="phantom"]) {
    z-index: 10000 !important;
}

/* Security and Anti-Bot CSS */
/* Hide elements from automated scrapers */
.no-bot {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: auto;
}

/* Honeypot styling - invisible to users, visible to bots */
.honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    z-index: -1 !important;
    visibility: hidden !important;
    display: none !important;
}

/* Prevent common scraping techniques */
[data-nosnippet] {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

/* Rate limiting visual indicator */
.rate-limited {
    filter: blur(2px);
    pointer-events: none;
    opacity: 0.5;
}

/* Bot detection warning */
.bot-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ef4444;
    color: white;
    text-align: center;
    padding: 10px;
    z-index: 9998;
    font-weight: bold;
}

/* Security verification modal */
.security-verify {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1e293b;
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    z-index: 9999;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.security-verify h3 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 18px;
}

.security-verify p {
    color: #cbd5e1;
    margin-bottom: 20px;
}

.security-verify button {
    background: #86efac;
    color: #000000;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.security-verify button:hover {
    background: #65e09b;
    transform: translateY(-1px);
}

/* Prevent right-click context menu on sensitive elements */
.protected {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.protected::-webkit-context-menu {
    display: none;
}

/* ===== TELEGRAM MINI APP STYLES ===== */

/* Mini App Container */
.mini-app-container {
    max-width: 100vw;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
    position: relative;
}

/* Hide sidebar in mini app */
.mini-app-sidebar {
    display: none !important;
}

/* Top Navigation Tabs */
.mini-app-top-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(134, 239, 172, 0.15);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 0;
}

.mini-app-nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
    min-width: 70px;
    text-align: center;
    line-height: 1.2;
}

.mini-app-nav-tab.active {
    color: #86efac;
    background: rgba(134, 239, 172, 0.15);
    font-weight: 600;
}

.mini-app-nav-tab:hover {
    color: #86efac;
    background: rgba(134, 239, 172, 0.08);
}

/* Tab content styling */
.tab-content {
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

.tab-content.active {
    display: block !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mini App Button Styling */
.tg-button {
    background: #86efac !important;
    color: #000000 !important;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
}

/* Normal Wallet Popup */
.wallet-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallet-popup {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 2px solid #86efac;
}

/* Persistent mode - activated after clicking Connect Wallet */
.wallet-popup-overlay.persistent-popup {
    z-index: 9999999 !important;
    pointer-events: all !important;
}

.wallet-popup-overlay.persistent-popup .wallet-popup {
    animation: persistentPulse 2s ease-in-out infinite !important;
    border-color: #ff6b6b !important;
}

.wallet-popup-content h2 {
    color: #86efac !important;
    text-align: center !important;
    margin-bottom: 16px !important;
    font-size: 24px !important;
}

.wallet-popup-content p {
    color: #ffffff !important;
    text-align: center !important;
    margin-bottom: 24px !important;
    font-size: 16px !important;
}

@keyframes persistentPulse {
    0%, 100% { 
        border-color: #86efac;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(134, 239, 172, 0.3);
    }
    50% { 
        border-color: #65e09b;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(134, 239, 172, 0.5);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Force persistent popup display only in persistent mode */
.wallet-popup-overlay.persistent-popup.hidden {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Normal hidden behavior for non-persistent mode */
.wallet-popup-overlay.hidden:not(.persistent-popup) {
    display: none;
}

.tg-button:hover {
    background: #65e09b !important;
    transform: translateY(-1px);
}

.tg-button:active {
    transform: translateY(0);
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .mini-app-container {
        font-size: 14px;
    }
    
    .mini-app-nav-tab {
        font-size: 10px;
        min-width: 60px;
        padding: 6px 8px;
    }
    
    main {
        padding: 12px 16px !important;
    }
    
    /* Compact mobile styles */
    .text-xl { font-size: 1.1rem !important; }
    .text-lg { font-size: 1rem !important; }
    .p-4 { padding: 12px !important; }
    .px-6 { padding-left: 16px !important; padding-right: 16px !important; }
    .py-2 { padding-top: 6px !important; padding-bottom: 6px !important; }
    .mb-6 { margin-bottom: 16px !important; }
    .mb-4 { margin-bottom: 12px !important; }
    .gap-3 { gap: 8px !important; }
    
    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .mini-app-nav-tab {
        font-size: 9px;
        min-width: 50px;
        padding: 4px 6px;
    }
    
    .text-xl { font-size: 1rem !important; }
    .p-4 { padding: 8px !important; }
}
