/* Futuristic CSS Enhancements */

/* Ensure native controls follow site theme */
html { color-scheme: light; }
html.dark { color-scheme: dark; }

/* Native <select> styling tweaks (non-invasive) */
select {
    color: inherit;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    color-scheme: inherit; /* dropdown adopts same scheme */
}

/* Dark theme colors for the native dropdown */
html.dark select,
.dark select {
    background-color: #0b1220; /* dark slate */
    color: #e2e8f0;           /* slate-200 */
    border-color: #334155;     /* slate-600 */
}

/* Option backgrounds in dark mode (supported in most engines) */
html.dark option,
.dark option {
    background-color: #0b1220;
    color: #e2e8f0;
}

/* Improve readability for hovered/selected options in dark mode */
html.dark option:hover,
.dark option:hover {
    background-color: #111827; /* gray-900 */
}

html.dark option:checked,
.dark option:checked {
    background-color: #0f172a; /* slate-900 */
    color: #e2e8f0;
}

/* Custom gradients to replace Tailwind gradients */
.bg-gradient-cyan-purple {
    background: linear-gradient(to right, #06b6d4, #9333ea);
}

.bg-gradient-cyan-blue {
    background: linear-gradient(to right, #06b6d4, #2563eb);
}

.bg-gradient-primary-purple {
    background: linear-gradient(to right, #06b6d4, #9333ea);
}

.bg-gradient-primary-purple-10 {
    background: linear-gradient(to right, rgba(6, 182, 212, 0.1), rgba(147, 51, 234, 0.1));
}

.bg-gradient-primary-purple-20 {
    background: linear-gradient(to right, rgba(6, 182, 212, 0.2), rgba(147, 51, 234, 0.2));
}

.bg-gradient-primary-blue {
    background: linear-gradient(to right, #06b6d4, #2563eb);
}

.bg-gradient-blue-indigo-10 {
    background: linear-gradient(to right, rgba(37, 99, 235, 0.1), rgba(79, 70, 229, 0.1));
}

.bg-gradient-cyan-blue-20 {
    background: linear-gradient(to right, rgba(34, 211, 238, 0.2), rgba(37, 99, 235, 0.2));
}

.bg-gradient-purple-pink-20 {
    background: linear-gradient(to right, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
}

.bg-gradient-text-dark {
    background: linear-gradient(to right, #111827, #0891b2, #7e22ce);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-text-light {
    background: linear-gradient(to right, #ffffff, #22d3ee, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-dark-blend-20 {
    background: linear-gradient(to right, rgba(8, 47, 73, 0.2), rgba(88, 28, 135, 0.2), rgba(30, 58, 138, 0.2));
}

.from-cyan-500 {
    --tw-gradient-from: #06b6d4 var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.from-cyan-900\/30 {
    --tw-gradient-from: rgb(6 78 59 / 0.3) var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(6 78 59 / 0) var(--tw-gradient-to-position);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.from-cyan-500\/20 {
    --tw-gradient-from: rgb(6 182 212 / 0.2) var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.bg-gradient-cyan-blue-dots {
    background: linear-gradient(to right, #22d3ee, #3b82f6);
}

.bg-gradient-primary-purple-10 {
    background: linear-gradient(to right, rgba(6, 182, 212, 0.1), rgba(147, 51, 234, 0.1));
}

.bg-gradient-blue-indigo-10 {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
}

.bg-gradient-transparent-cyan-blue-light {
    background: linear-gradient(to bottom right, transparent, rgba(34, 211, 238, 0.05), rgba(59, 130, 246, 0.05));
}

.dark .bg-gradient-transparent-cyan-blue-dark {
    background: linear-gradient(to bottom right, transparent, rgba(34, 211, 238, 0.1), rgba(59, 130, 246, 0.1));
}

.hover-gradient-darker:hover {
    background: linear-gradient(to right, #0891b2, #1e40af);
}

/* Glowing borders and hover effects */
.hover-glow:hover {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

/* Cyber grid animation */
@keyframes grid-move {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

.cyber-grid-animated {
    animation: grid-move 20s linear infinite;
}

/* Text glow effects */
.text-glow {
    text-shadow: 0 0 10px currentColor;
}

.text-neon {
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 20px currentColor,
        0 0 40px currentColor;
}

/* Button pulse animation */
@keyframes button-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.7);
        transform: scale(1);
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(6, 182, 212, 0);
        transform: scale(1.02);
    }
}

.btn-pulse {
    animation: button-pulse 2s infinite;
}

/* Holographic effect */
.holographic {
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    background-size: 200% 200%;
    animation: holographic-shine 3s ease-in-out infinite;
}

@keyframes holographic-shine {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
}

/* Scanner line effect */
@keyframes scanner {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.scanner-line {
    position: relative;
    overflow: hidden;
}

.scanner-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #06b6d4, transparent);
    animation: scanner 2s linear infinite;
    z-index: 1;
}

/* Particle floating animation */
@keyframes particle-float {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.7;
    }
    33% { 
        transform: translateY(-20px) translateX(10px) rotate(120deg);
        opacity: 1;
    }
    66% { 
        transform: translateY(-10px) translateX(-10px) rotate(240deg);
        opacity: 0.8;
    }
}

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

/* Matrix rain effect */
@keyframes matrix-rain {
    0% { 
        transform: translateY(-100vh);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { 
        transform: translateY(100vh);
        opacity: 0;
    }
}

.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.matrix-rain::before {
    content: '01001001010010100101001010010101';
    position: absolute;
    color: #06b6d4;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    animation: matrix-rain 5s linear infinite;
    opacity: 0.1;
}

/* Neon border animation */
@keyframes neon-border {
    0%, 100% {
        border-color: #06b6d4;
        box-shadow: 
            0 0 5px #06b6d4,
            inset 0 0 5px #06b6d4;
    }
    25% {
        border-color: #8b5cf6;
        box-shadow: 
            0 0 5px #8b5cf6,
            inset 0 0 5px #8b5cf6;
    }
    50% {
        border-color: #ec4899;
        box-shadow: 
            0 0 5px #ec4899,
            inset 0 0 5px #ec4899;
    }
    75% {
        border-color: #10b981;
        box-shadow: 
            0 0 5px #10b981,
            inset 0 0 5px #10b981;
    }
}

.neon-border {
    animation: neon-border 4s ease-in-out infinite;
}

/* Glitch effect */
@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

.glitch:hover {
    animation: glitch 0.3s ease-in-out;
}

/* Data stream effect */
@keyframes data-stream {
    0% { 
        transform: translateX(-100%);
        opacity: 0;
    }
    50% { opacity: 1; }
    100% { 
        transform: translateX(100%);
        opacity: 0;
    }
}

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

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

/* Loading bars animation */
@keyframes loading-bars {
    0%, 100% { height: 20%; }
    50% { height: 100%; }
}

.loading-bar {
    animation: loading-bars 1s ease-in-out infinite;
}

.loading-bar:nth-child(2) { animation-delay: 0.1s; }
.loading-bar:nth-child(3) { animation-delay: 0.2s; }
.loading-bar:nth-child(4) { animation-delay: 0.3s; }
.loading-bar:nth-child(5) { animation-delay: 0.4s; }

/* Circuit board pattern */
.circuit-pattern {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(6, 182, 212, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 80% 50%, rgba(147, 51, 234, 0.1) 2px, transparent 2px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.05) 1px, transparent 1px),
        linear-gradient(rgba(147, 51, 234, 0.05) 1px, transparent 1px);
    background-size: 
        50px 50px,
        50px 50px,
        20px 20px,
        20px 20px;
    background-position: 
        0 0,
        25px 25px,
        0 0,
        10px 10px;
}

/* Energy pulse effect */
@keyframes energy-pulse {
    0%, 100% { 
        background-size: 100% 100%;
        opacity: 0.8;
    }
    50% { 
        background-size: 120% 120%;
        opacity: 1;
    }
}

.energy-pulse {
    background: radial-gradient(circle, rgba(6, 182, 212, 0.3), transparent 70%);
    animation: energy-pulse 2s ease-in-out infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .text-neon {
        text-shadow: 
            0 0 3px currentColor,
            0 0 6px currentColor,
            0 0 12px currentColor;
    }
    
    .hover-glow:hover {
        box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
    }
}

/* Dark mode specific enhancements */
.dark .glass-effect {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(6, 182, 212, 0.2);
}

.dark .hover-glow:hover {
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.4);
}

/* Print styles */
@media print {
    .particle,
    .scanner-line::before,
    .matrix-rain,
    .holographic,
    .energy-pulse {
        display: none !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .particle-float,
    .cyber-grid-animated,
    .holographic,
    .scanner-line::before,
    .matrix-rain::before,
    .neon-border,
    .data-stream::after,
    .energy-pulse {
        animation: none !important;
    }
}
