/*
 * Docker Aria2 Best Practice
 * Advanced Cyber-Glass Styles
 */

/* Imports */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Inter:wght@300;400;600;700;800&display=swap');

/* Variables */
:root {
    --brand-primary: #14b8a6;
    --brand-secondary: #0d9488;
    --brand-glow: rgba(20, 184, 166, 0.5);
    --bg-dark: #020617;
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-shine: rgba(255, 255, 255, 0.03);
}

/* Base Reset & Typography */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: #e2e8f0;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    /* Hide default cursor on desktop to use custom one */
    cursor: none;
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    body {
        cursor: auto;
    }
    .cursor-dot, .cursor-outline {
        display: none;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
    border: 2px solid var(--bg-dark);
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* =========================================
   Advanced Background
   ========================================= */
.fixed-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -50;
    pointer-events: none;
    overflow: hidden;
}

.bg-gradient-layer {
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 50% 50%, rgba(2, 6, 23, 0.95) 0%, transparent 100%),
        conic-gradient(from 0deg at 50% 50%,
            rgba(76, 29, 149, 0.1) 0deg,
            rgba(13, 148, 136, 0.1) 120deg,
            rgba(59, 130, 246, 0.1) 240deg,
            rgba(76, 29, 149, 0.1) 360deg
        );
    animation: bg-spin 60s linear infinite;
    filter: blur(80px);
    opacity: 0.8;
}

.bg-grid-layer {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
}

/* Floating Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    z-index: -1;
    animation: orb-float 20s infinite ease-in-out;
}
.orb-1 { top: 10%; left: 10%; width: 300px; height: 300px; background: #7c3aed; animation-delay: 0s; }
.orb-2 { bottom: 20%; right: 10%; width: 400px; height: 400px; background: #14b8a6; animation-delay: -5s; }
.orb-3 { top: 40%; left: 60%; width: 200px; height: 200px; background: #3b82f6; animation-delay: -10s; }

/* =========================================
   Custom Cursor
   ========================================= */
.cursor-dot {
    width: 5px;
    height: 5px;
    background-color: var(--brand-primary);
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-outline {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(20, 184, 166, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9998;
    pointer-events: none;
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Hover state for interactive elements */
body.hovering .cursor-outline {
    width: 50px;
    height: 50px;
    background-color: rgba(20, 184, 166, 0.1);
    border-color: var(--brand-primary);
}

/* =========================================
   Glass Components
   ========================================= */
.glass-nav {
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.2),
        0 2px 4px -1px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px var(--glass-shine);
    transform-style: preserve-3d;
    transform: perspective(1000px);
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, transparent 0%, rgba(255, 255, 255, 0.03) 30%, transparent 60%);
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
}

/* =========================================
   Text Effects
   ========================================= */
.glow-text {
    text-shadow: 0 0 30px var(--brand-glow);
    background-size: 200% auto;
    animation: textFlow 3s linear infinite;
}

.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(to right, #2dd4bf, #3b82f6, #a855f7);
}

/* =========================================
   Terminal Code Block
   ========================================= */
.terminal-window {
    background: #0d1117;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    border: 1px solid #30363d;
    overflow: hidden;
}

.terminal-header {
    background: #161b22;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #30363d;
}

.terminal-controls {
    display: flex;
    gap: 0.5rem;
}

.control-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}
.dot-red { background-color: #ff5f56; }
.dot-yellow { background-color: #ffbd2e; }
.dot-green { background-color: #27c93f; }

.terminal-title {
    color: #8b949e;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
}

.terminal-content {
    position: relative;
}

/* =========================================
   Animations
   ========================================= */
@keyframes bg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

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

/* Button Shine */
.btn-shine {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.btn-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}
.btn-shine:hover::after {
    left: 100%;
}
.btn-shine:hover {
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.4);
    transform: translateY(-2px);
}

/* Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
