@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Inter:wght@300;400;600&display=swap');

:root {
    --bg-black: #040404;
    --neural-blue: #00E5FF;
    --quantum-violet: #8A2EFF;
    --cyber-silver: #E6F7FF;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --neon-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
    --violet-shadow: 0 0 15px rgba(138, 46, 255, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-black);
    color: var(--cyber-silver);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Preloader --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #040404;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease, visibility 1s;
}

.loader-content {
    width: 80%;
    max-width: 600px;
    text-align: center;
}

.progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 2rem;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: var(--neural-blue);
    box-shadow: 0 0 15px var(--neural-blue);
    transition: width 0.3s ease;
}

#loader-logs {
    font-family: 'Courier New', Courier, monospace;
    color: var(--neural-blue);
    font-size: 0.8rem;
    height: 100px;
    overflow: hidden;
    opacity: 0.7;
}

#loader-logs p {
    margin-bottom: 0.5rem;
    animation: slideUpLog 0.5s forwards;
}

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

h1, h2, h3, .heading {
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- Background Effects --- */
#neural-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5;
}

.ambient-light {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(138, 46, 255, 0.1) 0%, transparent 70%);
    z-index: -1;
    filter: blur(80px);
    pointer-events: none;
}

/* --- Layout --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.hero-title {
    font-size: 5.5rem;
    font-weight: 900;
    background: linear-gradient(90deg, var(--neural-blue), var(--quantum-violet), var(--neural-blue));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    position: relative;
    animation: shine 3s linear infinite, revealTitle 1.5s cubic-bezier(0.77, 0, 0.175, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.title-container {
    position: relative;
    overflow: hidden;
    padding: 20px 0;
}

.title-container::before,
.title-container::after {
    content: '';
    position: absolute;
    height: 2px;
    width: 0;
    background: var(--neural-blue);
    box-shadow: 0 0 15px var(--neural-blue);
    top: 50%;
    transition: all 1s ease;
}

.title-container::before {
    left: 50%;
    animation: lineRevealLeft 1.2s ease-out forwards;
}

.title-container::after {
    right: 50%;
    animation: lineRevealRight 1.2s ease-out forwards;
}

@keyframes lineRevealLeft {
    0% { width: 0; left: 50%; }
    50% { width: 50%; left: 0; }
    100% { width: 100%; left: 0; opacity: 0; }
}

@keyframes lineRevealRight {
    0% { width: 0; right: 50%; }
    50% { width: 50%; right: 0; }
    100% { width: 100%; right: 0; opacity: 0; }
}

@keyframes revealTitle {
    0% { opacity: 0; transform: translateY(30px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shine {
    to { background-position: 200% center; }
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.7;
    margin-bottom: 2rem;
}

.glitch-reveal {
    animation: glitch 1s infinite alternate;
}

@keyframes glitch {
    0% { transform: skew(0deg); }
    20% { transform: skew(2deg); filter: hue-rotate(90deg); }
    40% { transform: skew(-2deg); }
    60% { transform: skew(1deg); filter: contrast(150%); }
    100% { transform: skew(0deg); }
}

/* --- Dashboard Grid --- */
.dashboard {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: pulseGlow 8s ease-in-out infinite;
}

.card:hover {
    border-color: var(--neural-blue);
    box-shadow: var(--neon-shadow);
    transform: translateY(-5px);
}

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

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

/* --- Grid Specifics --- */
.col-4 { grid-column: span 4; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* --- Terminal --- */
.terminal {
    background: rgba(0, 0, 0, 0.8);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: #00FF41;
    height: 300px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid rgba(0, 255, 65, 0.2);
}

.terminal-line {
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

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

/* --- Buttons --- */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neural-blue), #00B8D4);
    color: #000;
}

.btn-primary:hover {
    box-shadow: var(--neon-shadow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--quantum-violet);
    color: var(--quantum-violet);
}

.btn-outline:hover {
    background: var(--quantum-violet);
    color: #fff;
    box-shadow: var(--violet-shadow);
}

/* --- Extra Animations --- */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(to bottom, transparent, var(--neural-blue), transparent);
    opacity: 0.1;
    pointer-events: none;
    z-index: 100;
    animation: scan 8s linear infinite;
}

@keyframes scan {
    0% { top: -100px; }
    100% { top: 100%; }
}

.card-pulse {
    animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { border-color: var(--glass-border); box-shadow: none; }
    50% { border-color: var(--neural-blue); box-shadow: 0 0 20px rgba(0, 229, 255, 0.2); }
}

.neural-blue { color: var(--neural-blue); text-shadow: 0 0 10px rgba(0, 229, 255, 0.5); }
.quantum-violet { color: var(--quantum-violet); text-shadow: 0 0 10px rgba(138, 46, 255, 0.5); }

.status-active { background: rgba(0, 255, 65, 0.2); color: #00FF41; }
.status-idle { background: rgba(255, 171, 0, 0.2); color: #FFAB00; }

/* --- CRUD List --- */
#node-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.node-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .dashboard { grid-template-columns: 1fr; }
    .col-4, .col-8 { grid-column: span 12; }
    .hero-title { font-size: 3.5rem; }
}

@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
}
