/* Custom styles for VOLTRIX */

/* ─── Base mobile optimizations ─── */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
}

/* Prevent iOS zoom on input focus (16px minimum) */
input, select, textarea {
    font-size: 16px !important;
}
@media (min-width: 768px) {
    input, select, textarea {
        font-size: inherit !important;
    }
}

/* Touch-friendly minimum tap targets for standalone buttons */
button:not(.carousel-dot):not([class*="text-["]) {
    min-height: 44px;
}
/* Navigation links should be easily tappable */
.bottom-nav-item {
    min-height: 48px;
    min-width: 48px;
}

/* iOS safe areas */
.pt-safe { padding-top: env(safe-area-inset-top, 0); }
.pb-safe { padding-bottom: env(safe-area-inset-bottom, 0); }
.pl-safe { padding-left: env(safe-area-inset-left, 0); }
.pr-safe { padding-right: env(safe-area-inset-right, 0); }

/* Hide scrollbar but keep functionality */
body::-webkit-scrollbar {
    width: 6px;
}
body::-webkit-scrollbar-track {
    background: #0f1419;
}
body::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 3px;
}

/* Smooth scrollable containers */
.overflow-y-auto, .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Prevent text selection on UI elements (not inputs) */
nav, header, .bottom-nav-item, button {
    -webkit-user-select: none;
    user-select: none;
}

/* Header and main content both use env(safe-area-inset-top) via inline styles */

/* Carousel transitions */
.carousel-slide {
    transition: opacity 0.7s ease-in-out;
}

/* Input autofill styling for dark theme */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #1f2937 inset !important;
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff !important;
}

/* Progress ring animation */
#progress-ring {
    transition: stroke-dashoffset 0.5s ease;
}

/* Safe area padding for iOS */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Crypto ticker scroll animation */
@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.animate-scroll {
    animation: ticker-scroll 30s linear infinite;
    width: max-content;
}
.animate-scroll:hover {
    animation-play-state: paused;
}

/* Chat bubble desktop positioning override */
@media (min-width: 768px) {
    #chat-bubble {
        bottom: 1.5rem !important;
    }
}

/* Chat widget animations */
@keyframes chat-panel-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-panel-enter {
    animation: chat-panel-in 0.25s ease-out;
}
@keyframes chat-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-msg-enter {
    animation: chat-msg-in 0.2s ease-out;
}

/* Trade feed row enter animation */
@keyframes trade-row-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.trade-row-enter {
    animation: trade-row-in 0.3s ease-out;
}

/* Bottom nav tap animation */
.bottom-nav-item {
    transition: color 0.2s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item:active {
    transform: scale(0.85);
}

/* Sparkline mini chart */
.sparkline {
    display: inline-block;
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════
   AI / CRYPTO THEME — Animations & Effects
   ═══════════════════════════════════════════════════════════ */

/* ─── Floating drift animation ─── */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}
@keyframes float-slow {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    33% { transform: translateY(-15px) translateX(10px); }
    66% { transform: translateY(5px) translateX(-10px); }
}
.animate-float {
    animation: float 6s ease-in-out infinite;
}
.animate-float-slow {
    animation: float-slow 8s ease-in-out infinite;
}
.animate-float-delay-1 {
    animation: float 7s ease-in-out 1s infinite;
}
.animate-float-delay-2 {
    animation: float-slow 9s ease-in-out 2s infinite;
}

/* ─── Fade-in-up entrance ─── */
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fade-in-up 0.6s ease-out both;
}
.animation-delay-100 { animation-delay: 0.1s; }
.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-400 { animation-delay: 0.4s; }
.animation-delay-500 { animation-delay: 0.5s; }
.animation-delay-600 { animation-delay: 0.6s; }

/* ─── Pulse glow ─── */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.3); }
    50% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(59, 130, 246, 0.2); }
}
@keyframes pulse-glow-green {
    0%, 100% { box-shadow: 0 0 5px rgba(34, 197, 94, 0.3); }
    50% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.6), 0 0 40px rgba(34, 197, 94, 0.2); }
}
.animate-pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}
.animate-pulse-glow-green {
    animation: pulse-glow-green 3s ease-in-out infinite;
}

/* ─── Shimmer sweep ─── */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
.animate-shimmer {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}
.shimmer-text {
    background: linear-gradient(90deg, #60a5fa 0%, #a78bfa 25%, #60a5fa 50%, #a78bfa 75%, #60a5fa 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s linear infinite;
}

/* ─── Gradient border rotation ─── */
@keyframes gradient-rotate {
    0% { --angle: 0deg; }
    100% { --angle: 360deg; }
}
@property --angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}
.gradient-border {
    position: relative;
    background: #1a1f2e;
    border-radius: 0.75rem;
}
.gradient-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: conic-gradient(from var(--angle), #3b82f6, #8b5cf6, #06b6d4, #3b82f6);
    animation: gradient-rotate 4s linear infinite;
    z-index: -1;
}

/* ─── Glassmorphism card ─── */
.glass-card {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ─── Neon text glow ─── */
.neon-blue {
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5), 0 0 30px rgba(59, 130, 246, 0.2);
}
.neon-green {
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5), 0 0 30px rgba(34, 197, 94, 0.2);
}
.neon-purple {
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5), 0 0 30px rgba(139, 92, 246, 0.2);
}

/* ─── AI dot grid background ─── */
.ai-grid-bg {
    background-image:
        radial-gradient(circle, rgba(59, 130, 246, 0.15) 1px, transparent 1px);
    background-size: 30px 30px;
}

/* ─── Orb backgrounds ─── */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}
.orb-blue {
    background: rgba(59, 130, 246, 0.12);
}
.orb-purple {
    background: rgba(139, 92, 246, 0.1);
}
.orb-cyan {
    background: rgba(6, 182, 212, 0.08);
}

/* ─── Radar sweep for live trading ─── */
@keyframes radar-sweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.radar-sweep {
    animation: radar-sweep 2s linear infinite;
}

/* ─── Progress bar shimmer ─── */
.progress-shimmer {
    position: relative;
    overflow: hidden;
}
.progress-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    animation: shimmer 2s linear infinite;
    background-size: 200% 100%;
}

/* ─── Scale bounce for success states ─── */
@keyframes scale-bounce {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.animate-scale-bounce {
    animation: scale-bounce 0.5s ease-out both;
}

/* ─── Card hover lift ─── */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ─── Button glow hover ─── */
.btn-glow {
    transition: all 0.3s ease;
}
.btn-glow:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4), 0 0 60px rgba(59, 130, 246, 0.15);
}
.btn-glow-green:hover {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4), 0 0 60px rgba(34, 197, 94, 0.15);
}

/* ─── Animated neural network lines (SVG-based, used in auth pages) ─── */
@keyframes dash-flow {
    to { stroke-dashoffset: -20; }
}
.neural-line {
    stroke-dasharray: 8, 12;
    animation: dash-flow 2s linear infinite;
}

/* ─── Pending status pulse ─── */
@keyframes status-pending {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.status-pending {
    animation: status-pending 2s ease-in-out infinite;
}

/* ─── Scanning line effect ─── */
@keyframes scan-line {
    0% { top: -2px; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}
.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.6), rgba(6, 182, 212, 0.6), transparent);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4), 0 0 30px rgba(6, 182, 212, 0.2);
    animation: scan-line 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* ─── Hex grid background ─── */
.hex-grid-bg {
    background-image:
        linear-gradient(30deg, rgba(59, 130, 246, 0.05) 12%, transparent 12.5%, transparent 87%, rgba(59, 130, 246, 0.05) 87.5%, rgba(59, 130, 246, 0.05)),
        linear-gradient(150deg, rgba(59, 130, 246, 0.05) 12%, transparent 12.5%, transparent 87%, rgba(59, 130, 246, 0.05) 87.5%, rgba(59, 130, 246, 0.05)),
        linear-gradient(30deg, rgba(59, 130, 246, 0.05) 12%, transparent 12.5%, transparent 87%, rgba(59, 130, 246, 0.05) 87.5%, rgba(59, 130, 246, 0.05)),
        linear-gradient(150deg, rgba(59, 130, 246, 0.05) 12%, transparent 12.5%, transparent 87%, rgba(59, 130, 246, 0.05) 87.5%, rgba(59, 130, 246, 0.05)),
        linear-gradient(60deg, rgba(6, 182, 212, 0.04) 25%, transparent 25.5%, transparent 75%, rgba(6, 182, 212, 0.04) 75%, rgba(6, 182, 212, 0.04)),
        linear-gradient(60deg, rgba(6, 182, 212, 0.04) 25%, transparent 25.5%, transparent 75%, rgba(6, 182, 212, 0.04) 75%, rgba(6, 182, 212, 0.04));
    background-size: 40px 70px;
    background-position: 0 0, 0 0, 20px 35px, 20px 35px, 0 0, 20px 35px;
}

/* ─── Data stream vertical lines ─── */
@keyframes data-stream {
    0% { transform: translateY(-100%); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(100vh); opacity: 0; }
}
.data-stream-line {
    position: absolute;
    width: 1px;
    height: 60px;
    pointer-events: none;
}

/* ─── Trade row glow borders ─── */
.trade-row-win {
    border-left: 2px solid rgba(34, 197, 94, 0.5);
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.03), transparent 30%);
}
.trade-row-loss {
    border-left: 2px solid rgba(239, 68, 68, 0.5);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.03), transparent 30%);
}

/* ─── Pulse dot for live indicator ─── */
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.5); opacity: 0; }
}
.pulse-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: pulse-ring 1.5s ease-out infinite;
}

/* ─── Glowing card border on hover ─── */
.glow-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(59, 130, 246, 0.1);
}
.glow-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.08), inset 0 0 20px rgba(59, 130, 246, 0.02);
}

/* ─── Circuit line decorations ─── */
.circuit-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.15), transparent);
    height: 1px;
    pointer-events: none;
}
.circuit-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}
.circuit-line-v {
    position: absolute;
    background: linear-gradient(180deg, transparent, rgba(6, 182, 212, 0.12), transparent);
    width: 1px;
    pointer-events: none;
}

/* ─── Terminal-style header bar ─── */
.terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}
.terminal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ─── Mobile-specific adjustments ─── */
@media (max-width: 374px) {
    /* Extra small phones (iPhone SE, etc.) */
    .container { padding-left: 12px; padding-right: 12px; }
    .text-4xl { font-size: 1.75rem; }
    .text-3xl { font-size: 1.5rem; }
    .text-2xl { font-size: 1.25rem; }
}

@media (max-width: 639px) {
    /* All mobile */
    .glass-card { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
    /* Ensure orbs don't cause overflow */
    .orb { max-width: 100vw; }
}

/* ─── Reduce motion for accessibility ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
