/*
Theme Name: Snow Removal Dashboard
Author: Snow Removal Tech
Description: A mobile-responsive WordPress dashboard theme for tracking snow removal devices in real time with Leaflet JS.
Version: 1.0.0
*/

:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --accent-blue: #38bdf8;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
}

/* Dashboard Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.dashboard-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-blue);
}

/* Dashboard Container & Grid */
.dashboard-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  min-height: calc(100vh - 70px);
}

.sidebar-panel, .map-panel {
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 1rem;
}

/* Device List Sidebar */
.sidebar-panel h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.device-select-box {
  margin-bottom: 1.5rem;
}

.device-select-box label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.device-select-box select {
  width: 100%;
  padding: 0.6rem;
  border-radius: 6px;
  background-color: var(--bg-dark);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.device-list {
  list-style: none;
}

.device-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background-color: var(--bg-dark);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.device-status-badge {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-green);
}

/* Map Wrapper & Controls */
.map-container-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 500px;
}

.gps-toggle-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: bold;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gps-toggle-btn.off {
  background-color: var(--accent-red);
}

.gps-toggle-btn.on {
  background-color: var(--accent-green);
}

.gps-toggle-btn:active {
  transform: scale(0.99);
}

#snow-map {
  width: 100%;
  flex-grow: 1;
  min-height: 450px;
  border-radius: 6px;
  z-index: 1;
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }

  .sidebar-panel {
    order: 2;
  }

  .map-panel {
    order: 1;
  }

  .map-container-wrapper {
    min-height: 400px;
  }
}