/**
 * SPACE ETHEREUM - COSMIC CONSCIOUSNESS INTERFACE STYLES
 * Advanced futuristic design system for Ethereum mathematical interface
 * Features: Glass morphism, cosmic gradients, animated elements, responsive design
 */

/* ===== CSS RESET & BASE STYLES ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Cosmic Color Palette */
    --cosmic-deep: #0a0a0f;
    --cosmic-primary: #1e1b4b;
    --cosmic-secondary: #312e81;
    --cosmic-accent: #3b82f6;
    --cosmic-glow: #06b6d4;
    --cosmic-purple: #8b5cf6;
    --cosmic-pink: #ec4899;
    --cosmic-cyan: #22d3ee;
    --cosmic-gold: #fbbf24;
    
    /* Glass Morphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    
    /* Animation Variables */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Fira Code', 'Consolas', monospace;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--cosmic-deep) 0%, var(--cosmic-primary) 50%, var(--cosmic-deep) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: white;
    position: relative;
}

/* ===== COSMIC BACKGROUND EFFECTS ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px, 30px 30px;
    pointer-events: none;
    z-index: -1;
    animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* ===== GLASS MORPHISM COMPONENTS ===== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
}

.cosmic-card {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.cosmic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent);
    transition: left var(--transition-slow);
}

.cosmic-card:hover::before {
    left: 100%;
}

.cosmic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.3);
}

/* ===== GRADIENT TEXT EFFECTS ===== */
.gradient-text {
    background: linear-gradient(135deg, var(--cosmic-cyan), var(--cosmic-purple), var(--cosmic-pink));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.neon-text {
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 15px currentColor;
    animation: neon-flicker 2s ease-in-out infinite alternate;
}

@keyframes neon-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 15px currentColor;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* ===== NAVIGATION TABS ===== */
.nav-tab {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--cosmic-glow), var(--cosmic-purple));
    transition: left var(--transition-normal);
    z-index: -1;
}

.nav-tab:hover::before {
    left: 0;
}

.nav-tab:hover {
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.nav-tab.active {
    background: linear-gradient(135deg, var(--cosmic-glow), var(--cosmic-purple));
    color: white;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
    border-color: var(--cosmic-glow);
}

/* ===== DATA VISUALIZATION ===== */
.metric-card {
    background: rgba(30, 27, 75, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 20px;
    transition: all var(--transition-normal);
    position: relative;
}

.metric-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 8px 0;
    font-family: var(--font-mono);
}

.metric-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== STATUS INDICATORS ===== */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ===== ANIMATED ELEMENTS ===== */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid var(--cosmic-glow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* ===== BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--cosmic-glow), var(--cosmic-purple));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left var(--transition-slow);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    
    .nav-tab {
        padding: 8px 16px;
        font-size: 0.875rem;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .cosmic-card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .nav-tab {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .metric-value {
        font-size: 1.25rem;
    }
}

/* ===== SPECIAL EFFECTS ===== */
.floating-particles {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--cosmic-glow);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 0.8;
    }
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--cosmic-glow), var(--cosmic-purple));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--cosmic-purple), var(--cosmic-pink));
}

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

/* ===== FOCUS STATES ===== */
button:focus,
.nav-tab:focus {
    outline: 2px solid var(--cosmic-glow);
    outline-offset: 2px;
}

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-indicator {
    transition: opacity var(--transition-fast);
}

.loading-indicator:not(.opacity-100) {
    opacity: 0;
}

/* ===== ERROR STATES ===== */
.error-state {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

/* ===== SUCCESS STATES ===== */
.success-state {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

/* ===== LAYOUT UTILITIES ===== */
.grid {
    display: grid;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

@media (min-width: 768px) {
    .md\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ===== FLEXBOX UTILITIES ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 2rem; }

/* ===== SPACING UTILITIES ===== */
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }

/* ===== TEXT UTILITIES ===== */
.text-center { text-align: center; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* ===== COLOR UTILITIES ===== */
.text-white { color: white; }
.text-gray-400 { color: rgba(255, 255, 255, 0.5); }
.text-gray-500 { color: rgba(255, 255, 255, 0.4); }
.text-cyan-300 { color: #67e8f9; }
.text-cyan-400 { color: #22d3ee; }
.text-purple-300 { color: #c084fc; }
.text-purple-400 { color: #a855f7; }
.text-pink-400 { color: #f472b6; }
.text-green-400 { color: #4ade80; }
.text-yellow-400 { color: #facc15; }
.text-red-400 { color: #f87171; }

/* ===== TRANSITION UTILITIES ===== */
.transition-all { transition: all var(--transition-normal); }
.transition-fast { transition: all var(--transition-fast); }

/* ===== TRANSFORM UTILITIES ===== */
.transform { transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0)) rotate(var(--tw-rotate, 0)) skewX(var(--tw-skew-x, 0)) skewY(var(--tw-skew-y, 0)) scaleX(var(--tw-scale-x, 1)) scaleY(var(--tw-scale-y, 1)); }
.scale-105 { --tw-scale-x: 1.05; --tw-scale-y: 1.05; }
.translate-y-2 { --tw-translate-y: 0.5rem; }

/* ===== BACKDROP BLUR UTILITIES ===== */
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.backdrop-blur { backdrop-filter: blur(8px); }
.backdrop-blur-lg { backdrop-filter: blur(16px); }

/* ===== ROUNDED UTILITIES ===== */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* ===== BORDER UTILITIES ===== */
.border { border-width: 1px; }
.border-slate-700 { border-color: rgba(51, 65, 85, 0.5); }
.border-slate-600 { border-color: rgba(71, 85, 105, 0.5); }
.border-slate-500 { border-color: rgba(100, 116, 139, 0.5); }

/* ===== SHADOW UTILITIES ===== */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

/* ===== WIDTH/HEIGHT UTILITIES ===== */
.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-7xl { max-width: 80rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-xl { max-width: 36rem; }
.max-w-lg { max-width: 32rem; }
.max-w-md { max-width: 28rem; }
.max-w-sm { max-width: 24rem; }

/* ===== CONTAINER UTILITIES ===== */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container { max-width: 640px; }
}

@media (min-width: 768px) {
    .container { max-width: 768px; }
}

@media (min-width: 1024px) {
    .container { max-width: 1024px; }
}

@media (min-width: 1280px) {
    .container { max-width: 1280px; }
}