/*
 * Whizz Dark Futuristic Design
 * Киберпанк встречается с минимализмом
 */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    /* Dark Futuristic Colors */
    --whizz-neon: #BFFF00; /* Неоновый зелёный */
    --whizz-neon-dim: #8FBF00;
    --whizz-neon-glow: rgba(191, 255, 0, 0.5);

    --whizz-bg-dark: #0A0A0A;
    --whizz-bg-card: #111111;
    --whizz-bg-hover: #1A1A1A;
    --whizz-bg-accent: rgba(191, 255, 0, 0.1);

    --whizz-text-primary: #FFFFFF;
    --whizz-text-secondary: #999999;
    --whizz-text-muted: #666666;

    --whizz-border: rgba(255, 255, 255, 0.1);
    --whizz-border-light: rgba(255, 255, 255, 0.05);

    /* Glow Effects */
    --glow-sm: 0 0 10px var(--whizz-neon-glow);
    --glow-md: 0 0 20px var(--whizz-neon-glow);
    --glow-lg: 0 0 40px var(--whizz-neon-glow);

    /* Typography */
    --font-main: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 80px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;

    /* Aliases for compatibility */
    --whizz-lime: #BFFF00;
    --whizz-lime-alpha-10: rgba(191, 255, 0, 0.1);
    --whizz-lime-alpha-20: rgba(191, 255, 0, 0.2);
    --whizz-black: #0A0A0A;
    --whizz-dark-card: #111111;
    --whizz-white: #FFFFFF;
    --whizz-gray-400: #999999;
    --whizz-gray-500: #666666;
    --whizz-error: #EF4444;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Font Sizes */
    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 15px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 28px;
}

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

body {
    font-family: var(--font-main);
    font-size: 15px;
    line-height: 1.6;
    color: var(--whizz-text-primary);
    background: var(--whizz-bg-dark);
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Animated Background Grid */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(191, 255, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(191, 255, 0, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Dark Navigation */
.nav {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--whizz-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
}

/* Futuristic Logo */
.nav-logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--whizz-neon);
    text-decoration: none;
    text-shadow: var(--glow-md);
    display: flex;
    align-items: center;
    font-family: var(--font-mono);
}

.nav-logo img {
    margin-right: var(--space-sm);
    animation: pulse-ebike 2s infinite;
}

@keyframes pulse-ebike {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 3px var(--whizz-neon-glow));
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        filter: drop-shadow(0 0 10px var(--whizz-neon-glow));
        transform: scale(1.05);
    }
}

.nav-menu {
    display: flex;
    gap: var(--space-sm);
    list-style: none;
    align-items: center;
}

.nav-link {
    color: var(--whizz-text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 14px;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--whizz-neon);
    transition: all 0.3s;
    transform: translateX(-50%);
}

.nav-link:hover {
    color: var(--whizz-text-primary);
}

.nav-link:hover::before {
    width: 80%;
}

.nav-link.active {
    color: var(--whizz-neon);
    background: var(--whizz-bg-accent);
}

/* Cyberpunk Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-main);
    font-size: 14px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn-neon {
    background: transparent;
    color: var(--whizz-neon);
    border: 1px solid var(--whizz-neon);
    text-shadow: var(--glow-sm);
    box-shadow: inset 0 0 0 0 var(--whizz-neon);
}

.btn-neon:hover {
    box-shadow: inset 0 0 20px 0 rgba(191, 255, 0, 0.3);
    text-shadow: var(--glow-lg);
    transform: translateY(-2px);
}

.btn-solid {
    background: var(--whizz-neon);
    color: var(--whizz-bg-dark);
    font-weight: 700;
    box-shadow: var(--glow-md);
}

.btn-solid:hover {
    box-shadow: var(--glow-lg);
    transform: translateY(-2px);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--whizz-text-primary);
}

h1 {
    font-size: 64px;
    font-weight: 700;
    letter-spacing: -2px;
    background: linear-gradient(135deg, var(--whizz-text-primary), var(--whizz-neon));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 80px rgba(191, 255, 0, 0.5);
}

h2 {
    font-size: 36px;
    font-weight: 700;
    color: var(--whizz-text-primary);
}

h3 { font-size: 24px; font-weight: 600; }
h4 { font-size: 18px; font-weight: 600; }

/* Dark Cards */
.card {
    background: var(--whizz-bg-card);
    border-radius: 12px;
    padding: var(--space-xl);
    border: 1px solid var(--whizz-border);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--whizz-neon), transparent);
    animation: scan 3s infinite;
}

@keyframes scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

.card:hover {
    border-color: rgba(191, 255, 0, 0.3);
    box-shadow: 0 0 30px rgba(191, 255, 0, 0.1);
    transform: translateY(-4px);
}

/* Dark Table */
.table {
    width: 100%;
    background: var(--whizz-bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--whizz-border);
}

.table thead {
    background: rgba(191, 255, 0, 0.05);
}

.table th {
    text-align: left;
    padding: var(--space-md) var(--space-lg);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--whizz-neon);
    font-family: var(--font-mono);
}

.table td {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--whizz-border);
    color: var(--whizz-text-secondary);
    font-family: var(--font-mono);
    font-size: 14px;
}

.table tr:hover td {
    background: var(--whizz-bg-hover);
    color: var(--whizz-text-primary);
}

/* Futuristic Metrics */
.metric-card {
    background: var(--whizz-bg-card);
    border: 1px solid var(--whizz-border);
    border-radius: 12px;
    padding: var(--space-lg);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.metric-card.glow {
    border-color: rgba(191, 255, 0, 0.3);
    box-shadow: inset 0 0 20px rgba(191, 255, 0, 0.05);
}

.metric-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--whizz-text-muted);
    margin-bottom: var(--space-sm);
    font-family: var(--font-mono);
}

.metric-value {
    font-size: 42px;
    font-weight: 700;
    color: var(--whizz-text-primary);
    line-height: 1;
    font-family: var(--font-mono);
    letter-spacing: -2px;
}

.metric-value.neon {
    color: var(--whizz-neon);
    text-shadow: var(--glow-md);
}

/* Cyberpunk Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    gap: 8px;
    font-family: var(--font-mono);
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px currentColor; }
    50% { opacity: 0.5; box-shadow: 0 0 20px currentColor; }
}

.status-online {
    background: rgba(191, 255, 0, 0.1);
    color: var(--whizz-neon);
    border: 1px solid rgba(191, 255, 0, 0.3);
}

.status-offline {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Futuristic Battery */
.battery-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.battery-track {
    width: 80px;
    height: 6px;
    background: var(--whizz-border);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.battery-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--whizz-neon), var(--whizz-neon-dim));
    transition: width 0.3s;
    box-shadow: var(--glow-sm);
}

.battery-fill.low {
    background: linear-gradient(90deg, #EF4444, #DC2626);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.battery-fill.medium {
    background: linear-gradient(90deg, #F59E0B, #D97706);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* Grid */
.grid {
    display: grid;
    gap: var(--space-lg);
}

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

/* Tech Lines Animation */
.tech-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--whizz-neon), transparent);
    margin: var(--space-xl) 0;
    position: relative;
    overflow: hidden;
}

.tech-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: var(--whizz-neon);
    box-shadow: 0 0 20px var(--whizz-neon);
    animation: slide 3s infinite;
}

@keyframes slide {
    0% { left: -50%; }
    100% { left: 100%; }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--whizz-text-muted); }
.text-neon { color: var(--whizz-neon); text-shadow: var(--glow-sm); }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 40px; }
    h2 { font-size: 28px; }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        display: none;
    }
}

/* ========================================
   FORM STYLES
   ======================================== */

/* Form Groups */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--whizz-text-secondary);
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: var(--text-base);
    font-family: var(--font-main);
    color: var(--whizz-text-primary);
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid var(--whizz-border);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--whizz-lime);
    box-shadow: 0 0 0 3px var(--whizz-lime-alpha-20);
}

.form-control::placeholder {
    color: var(--whizz-text-muted);
}

/* Checkboxes */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Additional button styles */
.btn-primary {
    background: var(--whizz-lime);
    color: var(--whizz-black);
    border: none;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--whizz-neon-dim);
    box-shadow: 0 0 20px rgba(191, 255, 0, 0.5);
}

.btn-lg {
    padding: 14px 32px;
    font-size: var(--text-lg);
}

/* Utility classes */
.flex {
    display: flex;
}

.gap-2 {
    gap: var(--space-2);
}

.text-small {
    font-size: var(--text-sm);
}

.mt-4 {
    margin-top: var(--space-4);
}

/* ========================================
   SKELETON LOADING STATES
   Session 4 - Task 4
   ======================================== */

/* Base Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--whizz-bg-card) 0%,
        rgba(191, 255, 0, 0.05) 50%,
        var(--whizz-bg-card) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-pulse 2.5s ease-in-out infinite;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(191, 255, 0, 0.1),
        transparent
    );
    animation: skeleton-shimmer 3.5s infinite;
}

@keyframes skeleton-pulse {
    0%, 100% {
        background-position: 0% 0%;
        opacity: 1;
    }
    50% {
        background-position: 100% 0%;
        opacity: 0.6;
    }
}

@keyframes skeleton-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Skeleton Variants */
.skeleton-text {
    height: 12px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-text.w-75 {
    width: 75%;
}

.skeleton-text.w-50 {
    width: 50%;
}

.skeleton-text.w-25 {
    width: 25%;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 16px;
    width: 60%;
}

.skeleton-metric {
    height: 48px;
    margin-bottom: 8px;
}

.skeleton-card {
    background: var(--whizz-bg-card);
    border: 1px solid var(--whizz-border);
    border-radius: 12px;
    padding: var(--space-lg);
}

.skeleton-table-row {
    height: 48px;
    margin-bottom: 4px;
    border-radius: 4px;
}

.skeleton-chart {
    height: 200px;
    border-radius: 8px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Skeleton Container - скрывает контент при загрузке */
.skeleton-container {
    position: relative;
}

.skeleton-container.loading .skeleton {
    display: block;
}

.skeleton-container.loading .skeleton-content {
    display: none;
}

.skeleton-container:not(.loading) .skeleton {
    display: none;
}

.skeleton-container:not(.loading) .skeleton-content {
    display: block;
}

/* Button Loading States */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

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

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--whizz-border);
    border-top-color: var(--whizz-neon);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

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

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-overlay .spinner {
    filter: drop-shadow(0 0 10px var(--whizz-neon-glow));
}

/* Skeleton Grid для метрик */
.skeleton-metrics-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

@media (max-width: 1200px) {
    .skeleton-metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .skeleton-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Skeleton для таблиц */
.skeleton-table {
    width: 100%;
}

.skeleton-table-header {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.skeleton-table-body .skeleton-table-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
}

/* Fade In Animation для контента после загрузки */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Skeleton для графиков */
.skeleton-chart-container {
    background: var(--whizz-bg-card);
    border: 1px solid var(--whizz-border);
    border-radius: 12px;
    padding: var(--space-lg);
}

.skeleton-chart-title {
    height: 16px;
    width: 40%;
    margin-bottom: var(--space-md);
}

/* Pulsing Dot для индикации загрузки */
.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--whizz-neon);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

/* Loading Text */
.loading-text {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--whizz-neon);
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-text::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 12px;
    background: var(--whizz-neon);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Skeleton для Device Cards */
.skeleton-device-card {
    background: var(--whizz-bg-card);
    border: 1px solid var(--whizz-border);
    border-radius: 12px;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.skeleton-device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skeleton-device-title {
    height: 20px;
    width: 60%;
}

.skeleton-device-status {
    width: 60px;
    height: 24px;
    border-radius: 12px;
}

.skeleton-device-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.skeleton-device-metric {
    height: 40px;
}
