/* src/styles.css */
:root {
  --primary-color: #2563eb;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --bg-color: #f8fafc;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-hover: #334155;
  --card-bg: #fff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
}

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

body {
  background: var(--bg-color);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
}

.app {
  display: flex;
  height: 100vh;
}

.main-content {
  overflow-y: auto;
  background: var(--bg-color);
  flex: 1;
  transition: margin-left .3s;
}

.mobile-overlay {
  display: none;
  position: fixed;
  z-index: 9998;
  background: #00000080;
  inset: 0;
}

.mobile-overlay.active {
  display: block;
}

.status-indicator {
  display: inline-block;
  animation: pulse 2s infinite;
  border-radius: 50%;
  width: 8px;
  height: 8px;
  margin-right: .5rem;
}

.status-indicator.connected {
  background-color: var(--success-color);
  box-shadow: 0 0 0 2px #10b98133;
}

.status-indicator.disconnected {
  background-color: var(--secondary-color);
  animation: none;
}

.status-badge {
  display: inline-flex;
  text-transform: uppercase;
  letter-spacing: .025em;
  border-radius: .375rem;
  align-items:  center;
  padding: .25rem .5rem;
  font-size: .75rem;
  font-weight: 500;
}

.progress-bar {
  overflow: hidden;
  background-color: #e5e7eb;
  border-radius: .25rem;
  width: 100%;
  height: .5rem;
}

.progress-fill {
  border-radius: .25rem;
  height: 100%;
  transition: width .3s;
}

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

  50% {
    opacity: .5;
  }
}

.flex-1 {
  flex: 1;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-sm {
  font-size: .875rem;
}

.text-xs {
  font-size: .75rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.rounded {
  border-radius: .25rem;
}

.rounded-md {
  border-radius: .375rem;
}

.rounded-lg {
  border-radius: .5rem;
}

.shadow-sm {
  box-shadow: 0 1px 2px #0000000d;
}

.shadow {
  box-shadow: 0 1px 3px #0000001a, 0 1px 2px #0000000f;
}

.device-status-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  border-radius: .75rem;
  margin-bottom: 1rem;
  padding: 1.5rem;
  transition: all .3s;
  box-shadow: 0 4px 6px -1px #0000001a, 0 2px 4px -1px #0000000f;
}

.device-status-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px #0000001a, 0 4px 6px -2px #0000000d;
}

.device-status-card:before {
  content: "";
  position: absolute;
  background: linear-gradient(90deg, var(--primary-color), var(--success-color));
  opacity: 0;
  height: 4px;
  transition: opacity .3s;
  top: 0;
  left: 0;
  right: 0;
}

.device-status-card.online:before {
  opacity: 1;
  background: linear-gradient(90deg, var(--success-color), #34d399);
}

.device-status-card.offline:before {
  opacity: 1;
  background: linear-gradient(90deg, var(--secondary-color), #94a3b8);
}

.status-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items:  flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.device-title {
  color: var(--text-primary);
  display: flex;
  align-items:  center;
  gap: .5rem;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.status-badges {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: .5rem;
}

.status-badge.online {
  color: var(--success-color);
  background: #10b9811a;
  border: 1px solid #10b98133;
}

.status-badge.offline {
  color: var(--secondary-color);
  background: #64748b1a;
  border: 1px solid #64748b33;
}

.status-badge.warning {
  color: var(--warning-color);
  background: #f59e0b1a;
  border: 1px solid #f59e0b33;
}

.status-badge.critical {
  color: var(--danger-color);
  background: #ef44441a;
  border: 1px solid #ef444433;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.metric-item {
  border: 1px solid var(--border-color);
  background: #f8fafc80;
  border-radius: .5rem;
  padding: 1rem;
  transition: all .3s;
}

.metric-item:hover {
  border-color: var(--primary-color);
  background: #f8fafccc;
  transform: translateY(-1px);
}

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

.metric-title {
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .875rem;
  font-weight: 500;
}

.metric-value {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 600;
}

.metric-icon {
  opacity: .7;
  width: 1.25rem;
  height: 1.25rem;
}

.metric-description {
  color: var(--text-secondary);
  margin-top: .25rem;
  font-size: .75rem;
}

.progress-bar.cpu {
  background: linear-gradient(90deg, #dbeafe, #bfdbfe);
}

.progress-bar.memory {
  background: linear-gradient(90deg, #fef3c7, #fde68a);
}

.progress-bar.disk {
  background: linear-gradient(90deg, #f3e8ff, #e9d5ff);
}

.progress-bar.network {
  background: linear-gradient(90deg, #ecfdf5, #d1fae5);
}

.progress-fill.cpu {
  background: linear-gradient(90deg, var(--primary-color), #3b82f6);
}

.progress-fill.memory {
  background: linear-gradient(90deg, var(--warning-color), #f97316);
}

.progress-fill.disk {
  background: linear-gradient(90deg, #8b5cf6, #a855f7);
}

.progress-fill.network {
  background: linear-gradient(90deg, var(--success-color), #059669);
}

.progress-fill.critical {
  background: linear-gradient(90deg, var(--danger-color), #dc2626);
  animation: pulse-progress 2s infinite;
}

@keyframes pulse-progress {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: .8;
  }
}

.cpu-cores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: .5rem;
  margin-top: 1rem;
}

.cpu-core {
  aspect-ratio: 1;
  background: var(--border-color);
  display: flex;
  color: var(--text-secondary);
  position: relative;
  overflow: hidden;
  border-radius: .25rem;
  justify-content: center;
  align-items:  center;
  transition: all .3s;
  font-size: .75rem;
  font-weight: 500;
}

.cpu-core:before {
  content: "";
  position: absolute;
  background: var(--primary-color);
  height: var(--usage, 0%);
  transition: height .3s;
  bottom: 0;
  left: 0;
  right: 0;
}

.cpu-core.high-usage {
  color: #fff;
}

.cpu-core.high-usage:before {
  background: var(--danger-color);
}

.cpu-core span {
  position: relative;
  z-index: 1;
}

.disk-list {
  space-y: .75rem;
}

.disk-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: .5rem;
  margin-bottom: .75rem;
  padding: .75rem;
  transition: all .2s;
}

.disk-item:hover {
  border-color: var(--primary-color);
  background: #2563eb05;
}

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

.disk-path {
  color: var(--text-primary);
  font-family: SF Mono, Monaco, Cascadia Code, Roboto Mono, Consolas, Courier New, monospace;
  font-size: .875rem;
  font-weight: 500;
}

.disk-usage {
  color: var(--text-secondary);
  font-size: .75rem;
}

.disk-stats {
  display: flex;
  color: var(--text-secondary);
  justify-content: space-between;
  margin-top: .25rem;
  font-size: .75rem;
}

.temperature-display {
  display: flex;
  align-items:  center;
  gap: .5rem;
}

.temperature-value {
  position: relative;
  font-size: 1.25rem;
  font-weight: 600;
}

.temperature-value.normal {
  color: var(--success-color);
}

.temperature-value.warm {
  color: var(--warning-color);
}

.temperature-value.hot {
  color: var(--danger-color);
  animation: pulse-temp 1.5s infinite;
}

@keyframes pulse-temp {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.temperature-icon {
  opacity: .8;
  width: 1rem;
  height: 1rem;
}

.expandable-section {
  overflow: hidden;
  transition: all .3s;
}

.expandable-section.collapsed {
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
}

.expandable-section.expanded {
  opacity: 1;
  max-height: 1000px;
}

.expand-toggle {
  cursor: pointer;
  display: flex;
  color: var(--primary-color);
  background: none;
  border: none;
  border-radius: .25rem;
  align-items:  center;
  gap: .5rem;
  padding: .5rem;
  transition: all .2s;
  font-size: .875rem;
  font-weight: 500;
}

.expand-toggle:hover {
  background: #2563eb1a;
}

.expand-icon {
  width: 1rem;
  height: 1rem;
  transition: transform .3s;
}

.expand-icon.expanded {
  transform: rotate(180deg);
}

.network-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: .75rem;
}

.network-stat {
  text-align: center;
  background: #f8fafc80;
  border-radius: .375rem;
  padding: .75rem;
}

.network-stat-label {
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .25rem;
  font-size: .75rem;
}

.network-stat-value {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
}

.network-stat.upload .network-stat-value {
  color: var(--warning-color);
}

.network-stat.download .network-stat-value {
  color: var(--success-color);
}

.last-updated {
  display: flex;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  justify-content: center;
  align-items:  center;
  gap: .5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  font-size: .75rem;
}

.last-updated-icon {
  opacity: .6;
  width: .875rem;
  height: .875rem;
}

.alert {
  display: flex;
  border-radius: .5rem;
  align-items:  center;
  gap: .5rem;
  margin-bottom: 1rem;
  padding: .75rem 1rem;
  font-size: .875rem;
}

.alert.warning {
  color: #92400e;
  background: #f59e0b1a;
  border: 1px solid #f59e0b33;
}

.alert.error {
  color: #991b1b;
  background: #ef44441a;
  border: 1px solid #ef444433;
}

.alert.info {
  color: #1e40af;
  background: #2563eb1a;
  border: 1px solid #2563eb33;
}

.alert-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}

@media (width <= 768px) {
  .app {
    position: relative;
  }

  .main-content {
    width: 100%;
  }

  .main-content.menu-open {
    overflow: hidden;
  }

  .device-status-card {
    margin-bottom: .75rem;
    padding: 1rem;
  }

  .status-header {
    flex-direction: column;
    align-items:  flex-start;
    gap: .75rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .metric-item {
    padding: .75rem;
  }

  .cpu-cores {
    grid-template-columns: repeat(auto-fit, minmax(35px, 1fr));
    gap: .25rem;
  }

  .network-stats {
    grid-template-columns: 1fr;
    gap: .5rem;
  }

  .device-title {
    font-size: 1.125rem;
  }

  .metric-value {
    font-size: 1rem;
  }

  .temperature-value {
    font-size: 1.125rem;
  }
}

@media (width >= 769px) and (width <= 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cpu-cores {
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
  }
}

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

  .device-status-card {
    padding: 2rem;
  }
}
