/* Custom styles for Zenith Token Launcher */

/* Z-INDEX HIERARCHY: Content = 0-10, Modals = 1000 */
#market-panel,
#live-feed-panel {
    z-index: 0 !important;
}

#settings-modal,
#statistics-modal,
#launch-modal,
#token-details-modal,
#deploy-modal,
#confirm-modal,
#customize-market-modal,
#milestone-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#settings-modal.hidden,
#statistics-modal.hidden,
#launch-modal.hidden,
#token-details-modal.hidden,
#deploy-modal.hidden,
#confirm-modal.hidden,
#customize-market-modal.hidden,
#milestone-overlay.hidden {
    display: none !important;
}

/* Blur when ANY modal is open */
body:has(#settings-modal:not(.hidden)) main,
body:has(#statistics-modal:not(.hidden)) main,
body:has(#deploy-modal:not(.hidden)) main,
body:has(#launch-modal:not(.hidden)) main,
body:has(#token-details-modal:not(.hidden)) main,
body:has(#confirm-modal:not(.hidden)) main,
body:has(#customize-market-modal:not(.hidden)) main,
body:has(#milestone-overlay:not(.hidden)) main {
    filter: blur(8px);
    transition: filter 0.3s ease;
}

/* Smooth animations */
* {
    transition: background-color 0.2s ease;
}

/* Token card */
.token-card {
    opacity: 0;
    transform: translateY(20px);
}

/* Profit colors */
.profit-positive {
    color: #10b981;
}

.profit-negative {
    color: #ef4444;
}

/* Milestone overlay */
.milestone-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    opacity: 0;
}

/* WebSocket status indicator */
#ws-status.connected {
    background-color: #10b981;
    box-shadow: 0 0 10px #10b981;
}

#ws-status.connecting {
    background-color: #f59e0b;
    animation: pulse 1.5s infinite;
}

#ws-status.disconnected {
    background-color: #ef4444;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Platform badges */
.platform-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.platform-pumpfun {
    background-color: #8b5cf6;
}

.platform-fourmeme {
    background-color: #f59e0b;
}

/* Card hover effects */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Token Details Modal */
.modal-content {
    animation: modalEntry 0.6s ease-out;
}

@keyframes modalEntry {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Character animations */
.character-container {
    animation: float 3s ease-in-out infinite;
}

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

#character-emoji {
    display: inline-block;
    transition: transform 0.3s ease;
}

#character-emoji:hover {
    transform: scale(1.2) rotate(10deg);
}

/* Wallet cards */
.wallet-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.wallet-card:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Progress bar glow effect */
#bc-progress-bar {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* Button pulse effect */
@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

.quick-sell-btn:hover {
    animation: buttonPulse 1.5s infinite;
}

/* Modal backdrop blur */
#token-details-modal {
    backdrop-filter: blur(8px);
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hide number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Auto cashout action buttons (inside input) */
.auto-cashout-actions {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.auto-cashout-confirm,
.auto-cashout-cancel {
    cursor: pointer;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.auto-cashout-confirm:hover {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.auto-cashout-cancel:hover {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.auto-cashout-confirm:active {
    transform: scale(0.95);
}

.auto-cashout-cancel:active {
    transform: scale(0.95);
}

/* Epic Header Styles */
header {
    position: relative;
    z-index: 10 !important;
}

/* Header universe canvas (contained within header) */
#universe-canvas {
    opacity: 0.6;
    will-change: transform;
    transform: translateZ(0);
}

/* Centered Static Watermark Logo */
#watermark-logo-container {
    transition: all 0.5s ease;
    pointer-events: none;
}

#watermark-logo-container #zenith-logo {
    transition: opacity 0.5s ease, filter 0.5s ease;
}

/* Dashboard background */
#dashboard {
    background: #1a1a20;
}

/* Main content - NO z-index to avoid creating stacking context */
main {
    position: relative;
}

#live-feed-panel {
    position: relative;
}

/* Token cards - darker universe theme */
.token-card {
    position: relative;
    background: linear-gradient(135deg, rgba(20, 20, 28, 0.98) 0%, rgba(25, 25, 35, 0.98) 100%) !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(139, 92, 246, 0.1) !important;
}

.token-card:hover {
    border-color: rgba(139, 92, 246, 0.4) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(139, 92, 246, 0.2) !important;
    transform: translateY(-4px);
}

/* Tokens container positioning */
#tokens-container {
    position: relative;
}

#no-tokens {
    position: relative;
}

/* Modal z-index is now handled at the top of this file */

#zenith-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: 0.1em;
    user-select: none;
    cursor: default;
}

#zenith-title span {
    display: inline-block;
    will-change: transform;
}

/* Floating particles */
.floating-particle {
    will-change: transform, opacity;
    transform: translateZ(0);
}

@keyframes particle-float {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate3d(20px, -20px, 0) scale(1.2);
        opacity: 0.8;
    }
}

/* Button glow effects */
header button {
    position: relative;
    overflow: hidden;
}

header button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

header button:hover::before {
    width: 300px;
    height: 300px;
}

/* WebSocket status glow */
#ws-status {
    transition: all 0.3s ease;
}

#ws-status.connected {
    animation: ws-pulse 2s infinite;
}

@keyframes ws-pulse {
    0%, 100% {
        box-shadow: 0 0 5px #10b981, 0 0 10px #10b981;
    }
    50% {
        box-shadow: 0 0 10px #10b981, 0 0 20px #10b981, 0 0 30px #10b981;
    }
}


/* Token Sold Animation */
.token-sold {
    position: relative;
    animation: soldPulse 3s ease-out forwards;
}

.token-sold::before {
    content: 'SOLD';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #10b981, #8b5cf6, #ec4899);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 1.5rem;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.6);
    animation: soldBounce 3s ease-out forwards;
    letter-spacing: 0.1em;
}

.token-sold::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.2),
        rgba(139, 92, 246, 0.2),
        rgba(236, 72, 153, 0.2));
    border-radius: 0.75rem;
    animation: soldGradientFade 3s ease-out forwards;
    pointer-events: none;
}

@keyframes soldPulse {
    0% {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        transform: scale(1);
    }
    15% {
        box-shadow: 0 0 60px rgba(16, 185, 129, 0.8),
                    0 0 40px rgba(139, 92, 246, 0.6),
                    0 0 20px rgba(236, 72, 153, 0.4);
        transform: scale(1.02);
    }
    30% {
        transform: scale(1);
    }
    100% {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        transform: scale(1);
    }
}

@keyframes soldBounce {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) rotate(-5deg);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2) rotate(0deg);
    }
    35% {
        transform: translate(-50%, -50%) scale(0.95) rotate(0deg);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05) rotate(0deg);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) translateY(-30px);
    }
}

@keyframes soldGradientFade {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.5;
        background: linear-gradient(135deg, 
            rgba(16, 185, 129, 0.3),
            rgba(139, 92, 246, 0.3),
            rgba(236, 72, 153, 0.3));
    }
    100% {
        opacity: 0;
        background: linear-gradient(135deg, 
            rgba(16, 185, 129, 0),
            rgba(139, 92, 246, 0),
            rgba(236, 72, 153, 0));
    }
}
