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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1d3a 50%, #0a0e27 100%);
    color: #e0e0e0;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    position: relative;
}

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

/* Header */
.header {
    position: relative;
    z-index: 10;
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
    padding: 1.5rem 2rem;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #00d4ff 0%, #b845ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    letter-spacing: 2px;
}

.tagline {
    font-size: 0.9rem;
    color: #00d4ff;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 20px;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff88;
}

.status-dot.pulsing {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* Mobile tabs */
.mobile-tabs {
    display: none;
    position: sticky;
    top: 0;
    z-index: 9;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.5rem;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.mobile-tab {
    flex: 1;
    padding: 0.75rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: #00d4ff;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.mobile-tab.active {
    background: rgba(0, 212, 255, 0.3);
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

/* Main container */
.main-container {
    position: relative;
    z-index: 1;
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 320px 1fr 380px;
    gap: 2rem;
}

/* Sidebars */
.sidebar {
    background: rgba(26, 29, 58, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.sidebar-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: #00d4ff;
}

/* Device cards */
.device-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.device-card {
    background: rgba(0, 212, 255, 0.05);
    border: 2px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.device-card:hover {
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
    transform: translateY(-2px);
}

.device-card.selected {
    border-color: #b845ff;
    box-shadow: 0 0 30px rgba(184, 69, 255, 0.3);
}

.device-card.active {
    border-left: 4px solid #00ff88;
}

.device-card.standby {
    border-left: 4px solid #ffaa00;
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.device-name {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: #00d4ff;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 1px solid #00ff88;
}

.status-badge.standby {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    border: 1px solid #ffaa00;
}

.device-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #888;
}

.protocol-badge {
    padding: 0.25rem 0.5rem;
    background: rgba(184, 69, 255, 0.2);
    border: 1px solid #b845ff;
    border-radius: 6px;
    font-size: 0.7rem;
    color: #b845ff;
}

.device-metrics {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.metric-value {
    color: #00d4ff;
    font-weight: 600;
}

/* Center panel */
.center-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-card {
    background: rgba(26, 29, 58, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
}

.panel-card h3 {
    font-family: 'Orbitron', sans-serif;
    color: #00d4ff;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Configuration */
.config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-item label {
    color: #00d4ff;
    font-size: 0.9rem;
    font-weight: 500;
}

.input-field {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(0, 212, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    border: none;
}

/* Code block */
.code-block {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #00ff88;
}

/* Network visualization */
.network-visual {
    position: relative;
    height: 300px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
}

.network-node {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.2);
    border: 2px solid #00d4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.network-node.active {
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.network-node:hover {
    transform: scale(1.1);
}

.node-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #00d4ff;
    animation: node-pulse 2s infinite;
}

@keyframes node-pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.node-label {
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    color: #00d4ff;
    text-align: center;
}

/* AI Chat */
.ai-chat {
    height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    padding: 1rem;
    border-radius: 12px;
    max-width: 85%;
}

.chat-message.user {
    align-self: flex-end;
    background: rgba(184, 69, 255, 0.2);
    border: 1px solid #b845ff;
}

.chat-message.assistant {
    align-self: flex-start;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.message-content {
    color: #e0e0e0;
    line-height: 1.6;
    font-size: 0.9rem;
}

.ai-input-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.ai-input {
    flex: 1;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
}

.ai-input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* Metrics */
.metrics-section {
    margin-bottom: 1.5rem;
}

.metrics-section h3 {
    font-family: 'Orbitron', sans-serif;
    color: #00d4ff;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.metric-card {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric-card span {
    font-size: 0.85rem;
    color: #888;
}

.metric-bar {
    height: 8px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #b845ff);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Logs */
.logs-section h3 {
    font-family: 'Orbitron', sans-serif;
    color: #00d4ff;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.logs-container {
    height: 250px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
}

.log-entry {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    padding: 0.5rem;
    border-radius: 4px;
}

.log-entry.info {
    background: rgba(0, 212, 255, 0.05);
    border-left: 3px solid #00d4ff;
}

.log-entry.warning {
    background: rgba(255, 170, 0, 0.05);
    border-left: 3px solid #ffaa00;
}

.log-time {
    color: #888;
}

.log-message {
    color: #e0e0e0;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #00d4ff, #b845ff);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

.btn-small {
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid #00d4ff;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: #00d4ff;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-small:hover {
    background: rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.btn-icon {
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid #00d4ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00d4ff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: rgba(0, 212, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
    transform: rotate(90deg);
}

/* Footer */
.footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(10px);
}

.footer a {
    color: #00d4ff;
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.7);
}

/* Responsive */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 280px 1fr 340px;
        gap: 1.5rem;
    }
}

@media (max-width: 968px) {
    .mobile-tabs {
        display: flex;
    }
    
    .main-container {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
    
    .sidebar,
    .center-panel {
        display: none;
    }
    
    .sidebar.mobile-active,
    .center-panel.mobile-active {
        display: block;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 0.75rem;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .status-indicator {
        font-size: 0.8rem;
    }
}