:root {
    --bg-color: #05080a;
    --sidebar-bg: rgba(10, 15, 20, 0.8);
    --card-bg: rgba(20, 25, 35, 0.6);
    --accent-blue: #00f2ff;
    --accent-green: #00ff88;
    --accent-orange: #ff9d00;
    --accent-red: #ff3c3c;
    --accent-purple: #bd00ff;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glow-blue: rgba(0, 242, 255, 0.3);
    --glow-green: rgba(0, 255, 136, 0.3);
    --glow-orange: rgba(255, 157, 0, 0.3);
    --font-main: 'Outfit', sans-serif;
    --font-heading: 'Orbit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Background Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 10%, rgba(0, 242, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(189, 0, 255, 0.08) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l25.98 15v30L30 60 4.02 45V15z' fill-opacity='0.02' fill='%23ffffff' fill-rule='evenodd'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: var(--font-heading);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.4);
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.logo-text span {
    color: var(--accent-blue);
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 12px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.nav-links li i {
    width: 20px;
    height: 20px;
}

.nav-links li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-links li.active {
    background: linear-gradient(90deg, rgba(0, 242, 255, 0.1), transparent);
    color: var(--accent-blue);
    border-left: 3px solid var(--accent-blue);
}

.sidebar-footer {
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--accent-green);
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
}

.pulse {
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(0, 255, 136, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0);
    }
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.top-bar {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--glass-border);
}

.breadcrumb {
    font-size: 1.1rem;
    font-weight: 600;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.search-box {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 200px;
}

.notifications {
    position: relative;
    cursor: pointer;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-red);
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Content Wrapper */
.content-wrapper {
    padding: 32px;
    overflow-y: auto;
    flex-grow: 1;
}

.view {
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards & Glassmorphism */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s ease;
}

.glass:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Glow Classes */
.glow-blue:hover {
    box-shadow: 0 0 30px var(--glow-blue);
}

.glow-green:hover {
    box-shadow: 0 0 30px var(--glow-green);
}

.glow-orange:hover {
    box-shadow: 0 0 30px var(--glow-orange);
}

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.glow-blue .stat-icon i {
    color: var(--accent-blue);
}

.glow-green .stat-icon i {
    color: var(--accent-green);
}

.glow-orange .stat-icon i {
    color: var(--accent-orange);
}

.glow-purple .stat-icon i {
    color: var(--accent-purple);
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-info .value {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.progress-bar {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 8px;
}

.progress-bar .fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent-blue);
}

/* Main Visualization Section */
.main-visualization {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.gauge-grid {
    display: flex;
    justify-content: space-around;
    padding: 20px 0;
}

.gauge-item {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gauge-svg {
    transform: rotate(-90deg);
}

.gauge-svg circle {
    fill: none;
    stroke-width: 8;
}

.gauge-svg .bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.gauge-svg .meter {
    stroke: var(--accent-blue);
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.gauge-svg .meter.orange {
    stroke: var(--accent-orange);
}

.gauge-label {
    position: absolute;
    text-align: center;
}

.gauge-label .val {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.gauge-label p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.visual-waves {
    height: 100px;
    margin-top: 20px;
}

#waveform-canvas {
    width: 100%;
    height: 100%;
}

/* Recent Logs */
.log-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-item .time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.log-item.warn {
    border-left: 3px solid var(--accent-orange);
}

.log-item.error {
    border-left: 3px solid var(--accent-red);
}

/* Heatmap Styles */
.heatmap-container {
    position: relative;
    height: 300px;
    background: #0a0f14;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: repeat(12, 1fr);
    gap: 1px;
}

.hm-cell {
    background: rgba(0, 242, 255, 0.05);
    transition: background 0.5s ease;
}

.hm-cell.hot {
    background: rgba(255, 60, 60, 0.4);
    box-shadow: 0 0 10px rgba(255, 60, 60, 0.2);
}

.hm-cell.warm {
    background: rgba(255, 157, 0, 0.3);
}

.cad-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,%3Csvg width="100%25" height="100%25" xmlns="http://www.w3.org/2000/svg"%3E%3Cdefs%3E%3Cpattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"%3E%3Cpath d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"%2F%3E%3C%2Fpattern%3E%3C%2Fdefs%3E%3Crect width="100%25" height="100%25" fill="url(%23grid)" %2F%3E%3Cpath d="M50 50 L250 50 M50 150 L250 150 M150 50 L150 250" stroke="rgba(0,242,255,0.2)" stroke-width="4" fill="none"%2F%3E%3C%2Fsvg%3E');
    pointer-events: none;
    z-index: 2;
}

.optimal-points {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

.point {
    position: absolute;
    padding: 4px 8px;
    background: var(--accent-blue);
    color: black;
    font-weight: 800;
    font-size: 0.7rem;
    border-radius: 4px;
    box-shadow: 0 0 15px var(--accent-blue);
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Process Steps */
.process-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.p-step {
    display: flex;
    gap: 16px;
    align-items: center;
}

.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
}

.icon-circle.active {
    background: var(--accent-blue);
    color: black;
    box-shadow: 0 0 15px var(--glow-blue);
}

.p-text strong {
    display: block;
    font-size: 0.95rem;
}

.p-text span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Solenoid Vibration Monitor */
.vibration-monitor {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.solenoid-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.status-tag {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
}

.pulse-blue {
    color: var(--accent-blue);
    background: rgba(0, 242, 255, 0.1);
    animation: glow-pulse 1.5s infinite;
}

@keyframes glow-pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

.wave-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.mini-wave {
    height: 60px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.mini-wave::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 100%;
    background: repeating-linear-gradient(90deg, transparent, transparent 10px, var(--wave-color) 11px, var(--wave-color) 12px);
    animation: wave-move 2s linear infinite;
}

.normal .mini-wave {
    --wave-color: var(--accent-green);
}

.alert .mini-wave {
    --wave-color: var(--accent-red);
}

@keyframes wave-move {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.hw-spec {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.spec-card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.spec-card i {
    color: var(--accent-blue);
    margin-bottom: 12px;
}

.spec-card h4 {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.spec-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.btn-small {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}

.btn-small.active {
    background: var(--accent-blue);
    color: black;
}

/* Patent Views */
.patent-header {
    margin-bottom: 32px;
}

.patent-id {
    color: var(--accent-blue);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.patent-desc {
    color: var(--text-secondary);
    max-width: 800px;
    margin-top: 12px;
}

.patent-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.switchgear-model {
    height: 300px;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.1) 0%, transparent 70%);
    border-radius: 12px;
    position: relative;
    border: 1px dashed var(--glass-border);
}

.sensor-node {
    position: absolute;
    width: 32px;
    height: 32px;
    background: var(--accent-blue);
    color: black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.7rem;
    box-shadow: 0 0 15px var(--accent-blue);
}

.pulse-slow {
    animation: sensorPulse 3s infinite;
}

@keyframes sensorPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 242, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 20px 10px rgba(0, 242, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 242, 255, 0);
    }
}

.feature-list {
    list-style: none;
    margin-top: 24px;
}

.feature-list li {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.feature-list li i {
    color: var(--accent-green);
}

.feature-list li strong {
    display: block;
    margin-bottom: 4px;
}

.feature-list li span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.logic-flow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
}

.step {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.9rem;
}

.step.highlighted {
    background: var(--accent-blue);
    color: black;
    font-weight: 600;
}

/* Table Styles */
.logs-table {
    width: 100%;
    border-collapse: collapse;
}

.logs-table th {
    text-align: left;
    padding: 16px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
}

.logs-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tag.info {
    background: rgba(0, 242, 255, 0.15);
    color: var(--accent-blue);
}

.tag.warn {
    background: rgba(255, 157, 0, 0.15);
    color: var(--accent-orange);
}

.tag.error {
    background: rgba(255, 60, 60, 0.15);
    color: var(--accent-red);
}

.status-ok {
    color: var(--accent-green);
}

.status-warn {
    color: var(--accent-orange);
}

.status-error {
    color: var(--accent-red);
}

/* Buttons */
.btn-primary {
    background: var(--accent-blue);
    color: black;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-more {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}

/* Settings */
.setting-item {
    margin-bottom: 24px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.setting-item input[type="range"] {
    width: 100%;
    accent-color: var(--accent-blue);
}

.setting-item.toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}