/* Ultra-modern black theme with neon accents */
html, body {
    background: #000000 !important;
    position: relative;
    min-height: 100vh;
}

/* Subtle grid pattern overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 230, 118, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 230, 118, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 9999;
    pointer-events: none;
}

/* Animated gradient glow effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at 20% 50%,
        rgba(0, 191, 255, 0.08) 0%,
        transparent 50%
    ),
    radial-gradient(
        circle at 80% 80%,
        rgba(0, 230, 118, 0.08) 0%,
        transparent 50%
    );
    z-index: 9999;
    pointer-events: none;
    animation: pulse-glow-subtle 8s ease-in-out infinite;
}

/* Ensure content is below background lines but still visible */
#root {
    position: relative;
    z-index: 1;
}

/* Override Tailwind colors for ultra-modern black theme */
.bg-gradient-to-br.from-blue-900 {
    background: linear-gradient(to bottom right, #000000 0%, #001a1a 100%) !important;
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.bg-gradient-to-r.from-blue-800 {
    background: linear-gradient(to right, #000000 0%, #001a33 100%) !important;
    border: 1px solid rgba(0, 191, 255, 0.2);
}

.bg-blue-800, .from-blue-800 {
    background-color: #000000 !important;
    border: 1px solid rgba(0, 191, 255, 0.3);
}

.bg-blue-900, .to-blue-900 {
    background-color: #000000 !important;
}

.bg-blue-700 {
    background-color: #001a1a !important;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.1);
}

.border-blue-600 {
    border-color: rgba(0, 191, 255, 0.5) !important;
}

.border-blue-500 {
    border-color: rgba(0, 191, 255, 0.7) !important;
}

.text-blue-100 {
    color: #ffffff !important;
}

.text-blue-200 {
    color: #e0e0e0 !important;
}

.text-blue-300 {
    color: #00bfff !important;
}

.placeholder-blue-300::placeholder {
    color: rgba(0, 191, 255, 0.5) !important;
}

/* Card backgrounds with neon borders */
.bg-gradient-to-br.from-blue-800.to-blue-900 {
    background: #000000 !important;
    border: 1px solid rgba(0, 230, 118, 0.3);
    box-shadow: 0 0 30px rgba(0, 230, 118, 0.1), inset 0 0 30px rgba(0, 191, 255, 0.05);
    position: relative;
}

/* Add subtle neon glow to cards */
.bg-gradient-to-br.from-blue-800.to-blue-900::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at 50% 0%,
        rgba(0, 191, 255, 0.1) 0%,
        transparent 50%
    );
    border-radius: inherit;
    pointer-events: none;
}

/* ====================================
   CUSTOM PREMIUM ANIMATIONS
   ==================================== */

/* Floating animation for logo and special elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Shimmer effect for loading and hover states */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Subtle pulse for background glow */
@keyframes pulse-glow-subtle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Pulse glow effect for buttons and highlights - Neon Blue */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 191, 255, 0.5), 0 0 40px rgba(0, 191, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 191, 255, 0.8), 0 0 80px rgba(0, 191, 255, 0.4);
    }
}

/* Pulse glow green for success states - Neon Green */
@keyframes pulse-glow-green {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 230, 118, 0.5), 0 0 40px rgba(0, 230, 118, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 230, 118, 0.8), 0 0 80px rgba(0, 230, 118, 0.4);
    }
}

/* Pulse glow red for error states */
@keyframes pulse-glow-red {
    0%, 100% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(239, 68, 68, 0.8);
    }
}

/* Pulse glow amber for premium elements */
@keyframes pulse-glow-amber {
    0%, 100% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(251, 191, 36, 0.8);
    }
}

/* Slide in from bottom animation */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide in from top animation */
@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Shake animation for errors */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    50% {
        transform: translateX(10px);
    }
    75% {
        transform: translateX(-10px);
    }
}

/* Bounce animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Spin animation for loading states */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Gradient rotation for premium borders */
@keyframes rotate-gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Skeleton loading shimmer */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Confetti fall animation */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Ripple effect animation */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Success checkmark animation */
@keyframes check-draw {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* Price flash green animation */
@keyframes flash-green {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(34, 197, 94, 0.2);
    }
}

/* Price flash red animation */
@keyframes flash-red {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(239, 68, 68, 0.2);
    }
}

/* Stagger animation delays for lists */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ====================================
   UTILITY ANIMATION CLASSES
   ==================================== */

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

.animate-pulse-glow-green {
    animation: pulse-glow-green 2s ease-in-out infinite;
}

.animate-pulse-glow-red {
    animation: pulse-glow-red 2s ease-in-out infinite;
}

.animate-pulse-glow-amber {
    animation: pulse-glow-amber 2s ease-in-out infinite;
}

.animate-slide-in-up {
    animation: slideInUp 0.5s ease-out forwards;
}

.animate-slide-in-down {
    animation: slideInDown 0.5s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out forwards;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-flash-green {
    animation: flash-green 0.5s ease-out;
}

.animate-flash-red {
    animation: flash-red 0.5s ease-out;
}

/* ====================================
   ENHANCED HOVER EFFECTS
   ==================================== */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.hover-lift-subtle {
    transition: transform 0.3s ease;
}

.hover-lift-subtle:hover {
    transform: translateY(-2px);
}

.hover-glow {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(0, 191, 255, 0.6), 0 0 60px rgba(0, 191, 255, 0.3);
    border-color: rgba(0, 191, 255, 0.8);
}

.hover-glow-green:hover {
    box-shadow: 0 0 30px rgba(0, 230, 118, 0.6), 0 0 60px rgba(0, 230, 118, 0.3);
    border-color: rgba(0, 230, 118, 0.8);
}

.hover-glow-red:hover {
    box-shadow: 0 0 30px rgba(255, 0, 100, 0.6), 0 0 60px rgba(255, 0, 100, 0.3);
}

.hover-glow-amber:hover {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.3);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.active-press:active {
    transform: scale(0.95);
}

/* ====================================
   SKELETON LOADING STATES
   ==================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 0.75rem;
}

.skeleton-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
}

/* ====================================
   PERFORMANCE OPTIMIZATIONS
   ==================================== */

.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-auto {
    will-change: auto;
}

/* Use hardware acceleration for smooth animations */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ====================================
   ROTATING GRADIENT BORDER EFFECT
   ==================================== */

.rotating-border {
    position: relative;
    background: linear-gradient(90deg, #00bfff, #00e676, #00bfff, #00e676);
    background-size: 300% 300%;
    animation: rotate-gradient 3s ease infinite;
    box-shadow: 0 0 30px rgba(0, 191, 255, 0.4);
}

.rotating-border-premium {
    position: relative;
    background: linear-gradient(90deg, #ffd700, #00e676, #00bfff, #ffd700);
    background-size: 300% 300%;
    animation: rotate-gradient 3s ease infinite;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
}

/* ====================================
   TOAST NOTIFICATION SYSTEM
   ==================================== */

/* Toast slide in from right */
@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Toast slide out to right */
@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* Progress bar animation */
@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: 400px;
}

.toast {
    pointer-events: all;
    background: #000000;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 191, 255, 0.2);
    animation: toastSlideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid rgba(0, 191, 255, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 320px;
    max-width: 400px;
}

.toast.closing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

.toast-success {
    border: 1px solid rgba(0, 230, 118, 0.6);
    box-shadow: 0 0 30px rgba(0, 230, 118, 0.3);
}

.toast-error {
    border: 1px solid rgba(255, 0, 100, 0.6);
    box-shadow: 0 0 30px rgba(255, 0, 100, 0.3);
}

.toast-info {
    border: 1px solid rgba(0, 191, 255, 0.6);
    box-shadow: 0 0 30px rgba(0, 191, 255, 0.3);
}

.toast-warning {
    border: 1px solid rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.toast-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: #e5e7eb;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.toast-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: rgba(255, 255, 255, 0.9);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    animation: progressBar linear;
    transform-origin: left;
}

.toast-success .toast-progress {
    background: #00e676;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
}

.toast-error .toast-progress {
    background: #ff0064;
    box-shadow: 0 0 10px rgba(255, 0, 100, 0.5);
}

.toast-info .toast-progress {
    background: #00bfff;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.toast-warning .toast-progress {
    background: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

@media (max-width: 640px) {
    .toast-container {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* ====================================
   ENHANCED FORM VALIDATION STYLES
   ==================================== */

.input-wrapper {
    position: relative;
}

.input-success {
    border-color: #00e676 !important;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.3) !important;
}

.input-error {
    border-color: #ff0064 !important;
    box-shadow: 0 0 20px rgba(255, 0, 100, 0.3) !important;
    animation: shake 0.5s ease-in-out;
}

.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    pointer-events: none;
}

.input-icon-success {
    color: #00e676;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
}

.input-icon-error {
    color: #ff0064;
    text-shadow: 0 0 10px rgba(255, 0, 100, 0.5);
}

.input-helper {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}

.input-helper-error {
    color: #ff0064;
}

.input-helper-success {
    color: #00e676;
}

.input-helper-info {
    color: #9ca3af;
}

/* ====================================
   KEYBOARD SHORTCUT INDICATORS
   ==================================== */

.kbd {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.tooltip {
    position: relative;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.tooltip:hover .tooltip-content {
    opacity: 1;
}

/* ====================================
   ACCESSIBILITY ENHANCEMENTS
   ==================================== */

/* Visible focus rings for keyboard navigation - Neon Blue Glow */
*:focus-visible {
    outline: 2px solid #00bfff;
    outline-offset: 2px;
    border-radius: 0.25rem;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #00bfff;
    outline-offset: 2px;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: #000000;
    border: 1px solid #00e676;
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    z-index: 100000;
    border-radius: 0 0 0.5rem 0;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.4);
}

.skip-to-content:focus {
    top: 0;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ====================================
   DATA PERSISTENCE INDICATORS
   ==================================== */

.save-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #9ca3af;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
}

.save-indicator-saving {
    color: #00bfff;
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.save-indicator-saved {
    color: #00e676;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
}

.save-indicator-error {
    color: #ff0064;
    text-shadow: 0 0 10px rgba(255, 0, 100, 0.5);
}

.save-indicator-offline {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.save-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ====================================
   ENHANCED EMPTY STATES
   ==================================== */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    font-size: 1rem;
    color: #9ca3af;
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #000000;
    border: 2px solid #00bfff;
    color: #00bfff;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
}

.empty-state-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(0, 191, 255, 0.6), 0 10px 30px rgba(0, 191, 255, 0.4);
    background: rgba(0, 191, 255, 0.1);
    border-color: #00e676;
    color: #ffffff;
}

/* ====================================
   ENHANCED LOADING SPINNER
   ==================================== */

.loading-spinner {
    display: inline-block;
    width: 3rem;
    height: 3rem;
    border: 4px solid rgba(0, 191, 255, 0.2);
    border-top-color: #00bfff;
    border-right-color: #00e676;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
}

.loading-spinner-sm {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 2px;
}

.loading-spinner-lg {
    width: 4rem;
    height: 4rem;
    border-width: 5px;
}

/* ====================================
   MOBILE RESPONSIVE IMPROVEMENTS
   ==================================== */

@media (max-width: 768px) {
    /* Touch-friendly button sizes */
    button,
    .btn,
    a.btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
    }

    /* Better spacing on mobile */
    .p-8 {
        padding: 1rem !important;
    }

    .p-6 {
        padding: 0.75rem !important;
    }

    /* Smaller text on mobile but readable */
    .text-4xl {
        font-size: 2rem !important;
    }

    .text-3xl {
        font-size: 1.75rem !important;
    }

    .text-2xl {
        font-size: 1.5rem !important;
    }

    /* Better input sizing */
    input,
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 44px;
    }

    /* Stack cards better */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* ====================================
   ENHANCED TRANSITIONS
   ==================================== */

/* Fast interactions */
.transition-fast {
    transition: all 0.15s ease;
}

/* Normal interactions */
.transition-normal {
    transition: all 0.3s ease;
}

/* Slow/emphasis */
.transition-slow {
    transition: all 0.5s ease;
}

/* Smooth easing */
.transition-smooth {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bounce easing */
.transition-bounce {
    transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Modal transitions */
.modal-enter {
    animation: scaleIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.modal-exit {
    animation: scaleIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) reverse;
}

/* Page transitions */
.page-enter {
    animation: fadeIn 0.3s ease-out;
}

.page-exit {
    animation: fadeIn 0.3s ease-out reverse;
}

/* ====================================
   NUMBER FORMATTING AND DATA DISPLAY
   ==================================== */

.positive-change {
    color: #00e676;
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
}

.negative-change {
    color: #ff0064;
    text-shadow: 0 0 8px rgba(255, 0, 100, 0.4);
}

.neutral-change {
    color: #ffffff;
}

.currency {
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
}

/* ====================================
   ENHANCED TYPOGRAPHY
   ==================================== */

.font-heading {
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.font-body {
    font-weight: 400;
    line-height: 1.6;
}

.font-label {
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    font-size: 0.875rem;
}

/* ====================================
   IMPROVED CONTRAST FOR ACCESSIBILITY
   ==================================== */

.text-high-contrast {
    color: #f9fafb;
}

.text-medium-contrast {
    color: #e5e7eb;
}

.text-low-contrast {
    color: #9ca3af;
}

/* ====================================
   CARD ENHANCEMENTS
   ==================================== */

.card-interactive {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.card-interactive:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-interactive:active {
    transform: translateY(-2px);
}

/* ====================================
   BADGE AND TAG STYLES
   ==================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: rgba(0, 230, 118, 0.15);
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.4);
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.2);
}

.badge-error {
    background: rgba(255, 0, 100, 0.15);
    color: #ff0064;
    border: 1px solid rgba(255, 0, 100, 0.4);
    box-shadow: 0 0 15px rgba(255, 0, 100, 0.2);
}

.badge-warning {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.badge-info {
    background: rgba(0, 191, 255, 0.15);
    color: #00bfff;
    border: 1px solid rgba(0, 191, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.2);
}

/* ====================================
   ENHANCED SCROLLBAR
   ==================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 191, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 191, 255, 0.3);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 230, 118, 0.5);
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.5);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 191, 255, 0.3) rgba(0, 0, 0, 0.8);
}

/* ====================================
   TRADE ANALYSIS MODAL ANIMATIONS
   ==================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

.animate-scaleIn {
    animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Trade Analysis Grade Badge Animation */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px currentColor;
    }
    50% {
        box-shadow: 0 0 40px currentColor;
    }
}

.grade-badge {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* ====================================
   MARKET STATUS BANNER ANIMATIONS
   ==================================== */

/* Slow pulse for market open banner */
@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.01);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 3s ease-in-out infinite;
}

/* Custom scrollbar for news feed */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 230, 118, 0.5) rgba(0, 0, 0, 0.8);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 230, 118, 0.2);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 230, 118, 0.4);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.3);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 191, 255, 0.6);
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.4);
}



/* ====================================
   ULTRA-MODERN NEON ENHANCEMENTS
   ==================================== */

/* Neon text glow for headings */
h1, h2, h3 {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
}

/* Button styles with neon glow */
button {
    transition: all 0.3s ease;
}

button:hover {
    box-shadow: 0 0 25px rgba(0, 230, 118, 0.4);
}

/* Card glow on hover */
.card-interactive {
    border: 1px solid rgba(0, 191, 255, 0.2);
}

.card-interactive:hover {
    border-color: rgba(0, 230, 118, 0.6);
    box-shadow: 0 0 40px rgba(0, 230, 118, 0.2), 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Enhanced links */
a {
    color: #00bfff;
    transition: all 0.3s ease;
}

a:hover {
    color: #00e676;
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
}

/* Neon divider lines */
hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00bfff, #00e676, #00bfff, transparent);
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
}

/* Table styling */
table {
    border-collapse: collapse;
}

th {
    background: rgba(0, 191, 255, 0.1);
    border: 1px solid rgba(0, 191, 255, 0.3);
    color: #00bfff;
    text-shadow: 0 0 5px rgba(0, 191, 255, 0.3);
}

td {
    border: 1px solid rgba(0, 191, 255, 0.2);
    color: #ffffff;
}

tr:hover {
    background: rgba(0, 230, 118, 0.05);
}

/* Enhanced code blocks */
code, pre {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: #00e676;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.2);
}

/* Select dropdown styling */
select {
    background: #000000;
    border: 1px solid rgba(0, 191, 255, 0.4);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.2);
}

select:hover, select:focus {
    border-color: rgba(0, 230, 118, 0.6);
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.3);
}

/* Input field enhancements */
input, textarea {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 191, 255, 0.3);
    color: #ffffff;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    border-color: rgba(0, 230, 118, 0.6);
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.3);
    background: rgba(0, 0, 0, 0.95);
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Checkbox and radio button styling */
input[type="checkbox"], input[type="radio"] {
    accent-color: #00e676;
    box-shadow: 0 0 5px rgba(0, 230, 118, 0.3);
}

/* Modern glassmorphism effect */
.glass {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 191, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 191, 255, 0.1);
}

/* Cyberpunk grid overlay */
.cyber-grid {
    background-image: 
        linear-gradient(rgba(0, 230, 118, 0.05) 2px, transparent 2px),
        linear-gradient(90deg, rgba(0, 230, 118, 0.05) 2px, transparent 2px);
    background-size: 40px 40px;
}

/* Neon border animation */
@keyframes neon-pulse {
    0%, 100% {
        border-color: rgba(0, 191, 255, 0.5);
        box-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
    }
    50% {
        border-color: rgba(0, 230, 118, 0.8);
        box-shadow: 0 0 40px rgba(0, 230, 118, 0.5);
    }
}

.neon-pulse {
    animation: neon-pulse 2s ease-in-out infinite;
}

/* Scanline effect */
@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100vh);
    }
}

.scanline::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 191, 255, 0.5), transparent);
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 9998;
}

/* ====================================
   MOBILE OPTIMIZATION ENHANCEMENTS
   ==================================== */

/* iOS Safe Area Support */
@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Prevent text size adjustment on orientation change */
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Touch action optimization */
* {
    -webkit-tap-highlight-color: rgba(0, 191, 255, 0.2);
    -webkit-touch-callout: none;
}

/* Enable smooth scrolling with momentum on iOS */
html,
body {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Disable pull-to-refresh on Chrome Android (we'll implement custom) */
body {
    overscroll-behavior-y: contain;
}

/* Touch-optimized interactive elements */
button,
a,
input,
select,
textarea,
.clickable {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

/* Allow text selection in inputs and textareas */
input,
textarea,
.selectable {
    -webkit-user-select: text;
    user-select: text;
}

/* ====================================
   ENHANCED MOBILE RESPONSIVE STYLES
   ==================================== */

@media (max-width: 480px) {
    /* Extra small phones - aggressive space optimization */
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    /* Reduce padding on cards */
    .card,
    .modal,
    .panel {
        padding: 0.75rem !important;
    }

    /* Stack buttons vertically */
    .button-group {
        flex-direction: column;
        width: 100%;
    }

    .button-group button {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Full-width modals on small screens */
    .modal {
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        height: 100vh;
        max-height: 100vh;
    }
}

@media (max-width: 768px) {
    /* Mobile devices */

    /* Larger touch targets for better UX */
    button,
    .btn,
    a.btn,
    .tab-button {
        min-height: 48px;
        min-width: 48px;
        padding: 0.875rem 1.5rem;
        font-size: 16px;
    }

    /* Stack navigation vertically */
    nav ul {
        flex-direction: column;
        width: 100%;
    }

    nav li {
        width: 100%;
        text-align: center;
    }

    /* Optimize table display */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Better form layouts */
    form {
        width: 100%;
    }

    .form-row {
        flex-direction: column;
    }

    .form-group {
        width: 100% !important;
        margin-bottom: 1rem;
    }

    /* Optimize chart containers */
    .chart-container {
        height: 300px !important;
        max-height: 50vh;
    }

    canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Hide non-essential columns in tables */
    .mobile-hidden {
        display: none !important;
    }

    /* Sticky header optimization */
    .sticky-header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: #000000;
        border-bottom: 1px solid rgba(0, 191, 255, 0.3);
    }

    /* Bottom navigation bar for mobile */
    .mobile-nav-bottom {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #000000;
        border-top: 1px solid rgba(0, 191, 255, 0.3);
        display: flex;
        justify-content: space-around;
        padding: 0.75rem;
        z-index: 100;
        box-shadow: 0 -4px 20px rgba(0, 191, 255, 0.2);
    }

    .mobile-nav-bottom button {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        background: transparent;
        border: none;
        color: rgba(255, 255, 255, 0.6);
        padding: 0.5rem;
        min-height: auto;
    }

    .mobile-nav-bottom button.active {
        color: #00e676;
        text-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
    }

    /* Hamburger menu */
    .hamburger {
        display: block;
        width: 30px;
        height: 24px;
        position: relative;
        cursor: pointer;
    }

    .hamburger span {
        display: block;
        position: absolute;
        height: 3px;
        width: 100%;
        background: #00bfff;
        border-radius: 3px;
        opacity: 1;
        left: 0;
        transition: all 0.3s ease;
        box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
    }

    .hamburger span:nth-child(1) {
        top: 0px;
    }

    .hamburger span:nth-child(2) {
        top: 10px;
    }

    .hamburger span:nth-child(3) {
        top: 20px;
    }

    .hamburger.active span:nth-child(1) {
        top: 10px;
        transform: rotate(135deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
        left: -60px;
    }

    .hamburger.active span:nth-child(3) {
        top: 10px;
        transform: rotate(-135deg);
    }

    /* Mobile menu drawer */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: #000000;
        border-right: 1px solid rgba(0, 191, 255, 0.3);
        transition: left 0.3s ease;
        z-index: 9999;
        overflow-y: auto;
        padding: 2rem 1rem;
        box-shadow: 4px 0 20px rgba(0, 191, 255, 0.3);
    }

    .mobile-menu.open {
        left: 0;
    }

    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 9998;
    }

    .mobile-menu-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    /* Optimize stock cards for mobile */
    .stock-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .stock-card .price {
        font-size: 1.5rem;
        margin-top: 0.5rem;
    }

    /* Better portfolio display */
    .portfolio-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .portfolio-value {
        font-size: 1.25rem;
    }
}

/* Landscape orientation optimization */
@media (max-width: 896px) and (orientation: landscape) {
    /* Reduce vertical padding in landscape */
    .modal,
    .card {
        padding: 0.5rem 1rem !important;
    }

    /* Optimize header height */
    header {
        min-height: 50px !important;
    }

    /* Side-by-side layout for forms in landscape */
    .form-row {
        flex-direction: row !important;
    }

    .form-group {
        width: 48% !important;
    }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Optimize for tablet displays */
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .tablet-full-width {
        width: 100% !important;
    }

    /* Better sidebar on tablets */
    .sidebar {
        width: 280px;
    }

    /* Optimize chart size for tablets */
    .chart-container {
        height: 400px !important;
    }
}

/* ====================================
   TOUCH GESTURE SUPPORT
   ==================================== */

/* Swipeable cards */
.swipeable {
    touch-action: pan-y;
    user-select: none;
}

/* Pull to refresh indicator */
.pull-to-refresh {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    transition: top 0.3s ease;
    z-index: 9999;
}

.pull-to-refresh.active {
    top: 20px;
}

.pull-to-refresh .spinner {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(0, 191, 255, 0.2);
    border-top-color: #00bfff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Long press feedback */
@keyframes long-press-feedback {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.long-press-active {
    animation: long-press-feedback 0.3s ease;
}

/* ====================================
   PERFORMANCE OPTIMIZATIONS
   ==================================== */

/* GPU acceleration for smooth animations */
.animated,
.transition-all,
.modal,
.drawer {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark mode optimizations (already dark, but for completeness) */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode */
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    * {
        border-width: 2px !important;
    }

    button,
    .btn {
        border: 2px solid currentColor !important;
    }
}

/* ====================================
   MOBILE MODAL OPTIMIZATIONS
   ==================================== */

@media (max-width: 768px) {
    /* Full-screen modals on mobile */
    .modal-overlay {
        padding: 0;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    /* Modal header with close button */
    .modal-header {
        position: sticky;
        top: 0;
        background: #000000;
        z-index: 10;
        padding: 1rem;
        border-bottom: 1px solid rgba(0, 191, 255, 0.3);
    }

    /* Scrollable modal body */
    .modal-body {
        overflow-y: auto;
        max-height: calc(100vh - 120px);
        padding: 1rem;
    }

    /* Fixed modal footer */
    .modal-footer {
        position: sticky;
        bottom: 0;
        background: #000000;
        padding: 1rem;
        border-top: 1px solid rgba(0, 191, 255, 0.3);
    }
}

/* ====================================
   LOADING STATES FOR MOBILE
   ==================================== */

.mobile-skeleton {
    background: linear-gradient(
        90deg,
        rgba(0, 191, 255, 0.05) 25%,
        rgba(0, 230, 118, 0.1) 50%,
        rgba(0, 191, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

/* ====================================
   ACCESSIBILITY ON MOBILE
   ==================================== */

/* Larger touch targets meet WCAG AAA */
@media (max-width: 768px) {
    a,
    button,
    input[type="checkbox"],
    input[type="radio"],
    select {
        min-width: 44px;
        min-height: 44px;
    }

    /* Ensure text is readable */
    body {
        font-size: 16px; /* Prevents iOS zoom */
        line-height: 1.6;
    }

    /* Improve focus indicators on mobile */
    *:focus-visible {
        outline: 3px solid #00bfff;
        outline-offset: 3px;
        box-shadow: 0 0 15px rgba(0, 191, 255, 0.6);
    }
}
