/* MeshMap Styles */

:root {
  --primary: #0066cc;
  --secondary: #666;
  --success: #28a745;
  --warning: #ff9800;
  --danger: #dc3545;
  --light: #f5f5f5;
  --border: #ddd;
}

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

html, body, .container-fluid, .row, .col-md-3, .col-md-9 {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #fff;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 15px;
  box-shadow: 2px 0 4px rgba(0,0,0,0.05);
  z-index: 10;
}

.sidebar-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--primary);
}

.sidebar-header h2 {
  color: var(--primary);
  margin-bottom: 5px;
  font-size: 24px;
  font-weight: 700;
}

.sidebar-header p {
  font-size: 12px;
  margin: 0;
}

/* Panel */
.panel {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 15px;
}

.panel-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Stats */
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-row strong {
  color: var(--primary);
  font-weight: 700;
}

/* Form Controls */
.form-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 5px;
  color: #555;
}

.form-select-sm {
  height: 30px;
  font-size: 13px;
  margin-bottom: 8px;
}

.btn-sm {
  font-size: 12px;
  padding: 6px 12px;
}

/* Nodes List */
.nodes-list {
  overflow-y: auto;
  padding: 8px;
  margin: -4px;
}

.node-item {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.node-item:hover {
  background: var(--light);
  border-color: var(--primary);
  transform: translateX(4px);
}

.node-item.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.node-item-name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

.node-item-info {
  font-size: 11px;
  color: #666;
  line-height: 1.4;
}

.node-item-info div {
  margin-bottom: 2px;
}

.node-item-info strong {
  color: var(--primary);
  font-weight: 600;
}

.node-item.active .node-item-info {
  color: rgba(255,255,255,0.9);
}

.node-item.active .node-item-info strong {
  color: white;
}

.text-muted {
  color: #999 !important;
}

/* Map */
.map-container {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

.leaflet-container {
  font-family: inherit;
}

/* Leaflet Markers */
.marker-icon-node {
  background: var(--primary);
  border: 3px solid white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.marker-icon-gateway {
  background: var(--warning);
  border: 3px solid white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.marker-icon-unknown {
  background: #999;
  border: 2px solid white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Popups */
.leaflet-popup-content {
  font-size: 12px;
  width: auto !important;
}

.popup-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.popup-info {
  margin: 2px 0;
  color: #666;
}

/* Responsive */
@media (max-width: 768px) {
  .col-md-3 {
    width: 100% !important;
    height: auto;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .col-md-9 {
    width: 100% !important;
    height: 60vh;
  }

  .row {
    flex-direction: column;
  }

  .sidebar {
    padding: 10px;
  }

  .panel {
    padding: 10px;
    margin-bottom: 10px;
  }
}

@media (max-width: 576px) {
  .sidebar-header h2 {
    font-size: 20px;
  }

  .panel-title {
    font-size: 12px;
  }

  .stat-row {
    font-size: 12px;
  }

  .btn-sm {
    font-size: 11px;
    padding: 4px 8px;
  }
}

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

/* Scrollbar Styling */
.nodes-list::-webkit-scrollbar {
  width: 6px;
}

.nodes-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.nodes-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.nodes-list::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.stats-list::-webkit-scrollbar {
  width: 6px;
}

.stats-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.stats-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.stats-list::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Gateway Stats */
.stats-list {
  overflow-y: auto;
  padding: 8px;
  margin: -4px;
}

.gateway-item {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 8px;
  background: white;
  transition: all 0.2s;
}

.gateway-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(0, 102, 204, 0.1);
}

.gateway-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
}

.gateway-name {
  font-weight: 600;
  color: var(--primary);
  font-size: 13px;
}

.gateway-status {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--success);
  color: white;
}

.gateway-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 11px;
}

.gateway-stat {
  padding: 4px;
  background: var(--light);
  border-radius: 3px;
}

.gateway-stat-label {
  color: #999;
  font-weight: 500;
  margin-bottom: 1px;
}

.gateway-stat-value {
  color: #333;
  font-weight: 600;
}

.gateway-item-footer {
  font-size: 10px;
  color: #999;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #f0f0f0;
}
}
