/* TessSpeaks - Advanced Styles & Animations */

/* Custom Properties */
:root {
    --void-start: #020617;
    --void-end: #0f172a;
    --primary: #ff4d00;
    --secondary: #06b6d4;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-disabled: #475569;
    --glass: rgba(30, 41, 59, 0.5);
    --border: rgba(100, 116, 139, 0.3);
}

/* Advanced Glassmorphism */
.glass-advanced {
    background: linear-gradient(135deg, 
        rgba(30, 41, 59, 0.7) 0%, 
        rgba(15, 23, 42, 0.5) 50%, 
        rgba(30, 41, 59, 0.3) 100%);
    backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Enhanced Gauge Animation */
@keyframes gaugeLoad {
    0% {
        stroke-dashoffset: 283;
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(30deg);
    }
    100% {
        stroke-dashoffset: 90;
        filter: hue-rotate(0deg);
    }
}

.gauge-advanced {
    animation: gaugeLoad 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Pulse Ring Effect */
@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

.pulse-ring {
    animation: pulseRing 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

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

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

/* Matrix Rain Effect */
@keyframes matrixRain {
    0% { transform: translateY(-100vh); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

.matrix-rain {
    animation: matrixRain 10s linear infinite;
    opacity: 0.1;
}

/* Advanced Glow Effects */
.glow-primary-advanced {
    box-shadow: 
        0 0 20px rgba(255, 77, 0, 0.4),
        0 0 40px rgba(255, 77, 0, 0.2),
        0 0 80px rgba(255, 77, 0, 0.1);
}

.glow-secondary-advanced {
    box-shadow: 
        0 0 20px rgba(6, 182, 212, 0.4),
        0 0 40px rgba(6, 182, 212, 0.2),
        0 0 80px rgba(6, 182, 212, 0.1);
}

/* Hover States */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hover-lift:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(6, 182, 212, 0.2);
}

/* Text Gradient Animation */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-text {
    background: linear-gradient(-45deg, #ffffff, #06b6d4, #ff4d00, #ffffff);
    background-size: 400% 400%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

/* Data Stream Effect */
@keyframes dataStream {
    0% { transform: translateX(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

.data-stream {
    position: relative;
    overflow: hidden;
}

.data-stream::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(6, 182, 212, 0.2), 
        transparent);
    animation: dataStream 3s linear infinite;
}

/* System Status Indicators */
.status-online {
    position: relative;
}

.status-online::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 25%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Parallax Effect */
.parallax-element {
    transform: translateZ(0);
    will-change: transform;
}

/* Terminal Typewriter Effect */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkCursor {
    from, to { border-color: transparent; }
    50% { border-color: #06b6d4; }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid #06b6d4;
    white-space: nowrap;
    margin: 0 auto;
    animation: 
        typewriter 3s steps(40, end),
        blinkCursor 0.75s step-end infinite;
}

/* Advanced Card Hover Effects */
.card-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg) translateZ(20px);
}

/* Scan Line Effect */
@keyframes scanLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        #06b6d4, 
        transparent);
    animation: scanLine 4s linear infinite;
    pointer-events: none;
    z-index: 1000;
}

/* Energy Wave Effect */
@keyframes energyWave {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.energy-wave {
    position: relative;
}

.energy-wave::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 2px solid #06b6d4;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: energyWave 2s ease-out infinite;
}

/* Digital Noise Effect */
@keyframes digitalNoise {
    0%, 100% { opacity: 0.02; }
    50% { opacity: 0.05; }
}

.digital-noise {
    position: relative;
}

.digital-noise::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, #06b6d4 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, #ff4d00 1px, transparent 1px);
    background-size: 20px 20px;
    animation: digitalNoise 0.1s linear infinite;
    pointer-events: none;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .hover-lift:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .card-3d:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .glass-advanced {
        backdrop-filter: blur(16px) saturate(120%);
    }
}

/* High Performance Mode */
@media (prefers-reduced-motion: reduce) {
    .gauge-advanced,
    .float-animation,
    .gradient-text,
    .data-stream::before,
    .typewriter,
    .scan-line,
    .energy-wave::before,
    .digital-noise::before {
        animation: none;
    }
    
    .hover-lift:hover {
        transform: translateY(-2px);
    }
}

/* Dark Theme Specific */
@media (prefers-color-scheme: dark) {
    :root {
        --glass: rgba(15, 23, 42, 0.7);
        --border: rgba(148, 163, 184, 0.2);
    }
}

/* Print Styles */
@media print {
    .scan-line,
    .digital-noise::before,
    .matrix-rain {
        display: none;
    }
    
    .glass-advanced {
        background: white;
        color: black;
        border: 1px solid #ccc;
    }
}

/* Focus States for Accessibility */
button:focus,
a:focus {
    outline: 2px solid #06b6d4;
    outline-offset: 2px;
}

/* Custom Scrollbar for Webkit */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--void-end);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--secondary), var(--primary));
    border-radius: 6px;
    border: 2px solid var(--void-end);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #0891b2, #ea580c);
}

/* Selection Styling */
::selection {
    background: var(--secondary);
    color: var(--void-start);
}

::-moz-selection {
    background: var(--secondary);
    color: var(--void-start);
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, 
        var(--glass) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        var(--glass) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* System Health Indicators */
.health-good {
    color: #10b981;
}

.health-warning {
    color: #f59e0b;
}

.health-critical {
    color: #ef4444;
}

.health-optimal {
    color: var(--secondary);
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}