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

html, body, #root {
  height: 100%;
  width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #1a1a2e;
  color: #eaeaea;
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.main-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-bottom: 1px solid #0f3460;
  z-index: 1000;
}

.burger-menu {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.burger-line {
  display: block;
  width: 100%;
  height: 3px;
  background: #e94560;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.burger-menu:hover .burger-line {
  background: #fff;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 36px;
  height: 36px;
}

.header-title h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.refresh-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(233, 69, 96, 0.2);
  color: #e94560;
  cursor: pointer;
  transition: all 0.3s ease;
}

.refresh-button:hover:not(:disabled) {
  background: rgba(233, 69, 96, 0.3);
  transform: scale(1.05);
}

.refresh-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.refresh-button svg {
  width: 20px;
  height: 20px;
}

.refresh-button.loading svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
}

.tab-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: none;
  border: none;
  color: #888;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tab-button svg {
  width: 18px;
  height: 18px;
}

.tab-button:hover {
  color: #ccc;
  background: rgba(255, 255, 255, 0.05);
}

.tab-button.active {
  color: #e94560;
  border-bottom-color: #e94560;
}

/* Sidebar */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1001;
}

.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  max-width: 85vw;
  height: 100%;
  background: #1a1a2e;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1002;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #0f3460;
}

.sidebar-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.close-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(233, 69, 96, 0.2);
  color: #e94560;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close-button:hover {
  background: rgba(233, 69, 96, 0.3);
}

.close-button svg {
  width: 20px;
  height: 20px;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.sidebar-section {
  margin-bottom: 28px;
}

.sidebar-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #eaeaea;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #888;
  margin-top: 4px;
}

.stat-active .stat-value { color: #4ecca3; }
.stat-portable .stat-value { color: #ffc93c; }

/* Toggle */
.toggle-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-option input { display: none; }

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: #333;
  border-radius: 12px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #666;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.toggle-option input:checked + .toggle-slider { background: #e94560; }
.toggle-option input:checked + .toggle-slider::after { left: 23px; background: #fff; }

.toggle-label {
  font-size: 0.9rem;
  color: #eaeaea;
}

.info-text {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.5;
}

/* Legende */
.legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #ccc;
}

.legend-marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  flex-shrink: 0;
}

.marker-fixed { background: #e94560; }
.marker-portable { background: #ffc93c; }

.stat-fixed .stat-value { color: #e94560; }

/* Speedcamera List */
.speedcamera-list {
  height: 100%;
  overflow-y: auto;
  padding: 16px;
  background: #1a1a2e;
}

.list-section { margin-bottom: 24px; }

.list-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #888;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #0f3460;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot.active {
  background: #4ecca3;
  box-shadow: 0 0 8px rgba(78, 204, 163, 0.5);
}

.status-dot.inactive { background: #6c757d; }

.list-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  gap: 14px;
}

.list-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #0f3460;
}

.list-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(233, 69, 96, 0.15);
  color: #e94560;
}

.list-item-icon svg {
  width: 24px;
  height: 24px;
}

.list-item:has(.type-badge.portable) .list-item-icon {
  background: rgba(255, 201, 60, 0.15);
  color: #ffc93c;
}

.list-item-main {
  flex: 1;
  min-width: 0;
}

.list-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.type-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.type-badge.portable {
  background: rgba(255, 201, 60, 0.2);
  color: #ffc93c;
}

.type-badge.fixed {
  background: rgba(233, 69, 96, 0.2);
  color: #e94560;
}

.duration {
  font-size: 0.75rem;
  font-weight: 500;
}

.duration.active { color: #4ecca3; }
.duration.inactive { color: #888; }

.street-name {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: #888;
}

.meta-item svg {
  width: 14px;
  height: 14px;
}

.list-item-arrow {
  color: #555;
  margin-left: 12px;
}

.list-item-arrow svg {
  width: 20px;
  height: 20px;
}

.list-item:hover .list-item-arrow { color: #e94560; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #555;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
}

/* Map */
.map-container {
  height: 100%;
  width: 100%;
  position: relative;
}

.speedcamera-map {
  height: 100%;
  width: 100%;
}

.reset-zoom-button {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.reset-zoom-button:hover {
  background: #e94560;
  transform: translateX(-50%) scale(1.05);
}

.reset-zoom-button svg {
  width: 18px;
  height: 18px;
}

.custom-marker {
  background: none;
  border: none;
}

/* Popup */
.leaflet-popup-content-wrapper {
  background: #1a1a2e !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  color: #eaeaea !important;
}

.leaflet-popup-tip { background: #1a1a2e !important; }

.popup-content {
  padding: 12px;
  min-width: 200px;
}

.popup-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 10px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #0f3460;
}

.popup-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.badge-active { background: rgba(78, 204, 163, 0.2); color: #4ecca3; }
.badge-inactive { background: rgba(108, 117, 125, 0.2); color: #6c757d; }
.badge-portable { background: rgba(255, 201, 60, 0.2); color: #ffc93c; }
.badge-fixed { background: rgba(233, 69, 96, 0.2); color: #e94560; }

.popup-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-label { font-size: 0.8rem; color: #888; }
.popup-value { font-size: 0.85rem; font-weight: 500; color: #eaeaea; }

/* Leaflet Controls */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-control-zoom a {
  background: #1a1a2e !important;
  color: #eaeaea !important;
  border: none !important;
}

.leaflet-control-zoom a:hover {
  background: #16213e !important;
  color: #e94560 !important;
}

.leaflet-control-attribution {
  background: rgba(26, 26, 46, 0.8) !important;
  color: #888 !important;
}

.leaflet-control-attribution a { color: #e94560 !important; }

/* Loading */
.loading-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  z-index: 1000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(233, 69, 96, 0.2);
  border-top-color: #e94560;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  margin-top: 16px;
  color: #888;
  font-size: 0.9rem;
}

/* Error */
.error-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  padding: 24px;
  text-align: center;
}

.error-icon {
  width: 64px;
  height: 64px;
  color: #e94560;
  margin-bottom: 16px;
}

.error-icon svg { width: 100%; height: 100%; }

.error-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #eaeaea;
  margin: 0 0 8px 0;
}

.error-message {
  font-size: 0.9rem;
  color: #888;
  margin: 0 0 24px 0;
  max-width: 300px;
}

.error-button {
  padding: 12px 24px;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.error-button:hover {
  background: #d63d56;
  transform: translateY(-2px);
}

/* Speedometer */
.speedometer-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  padding: 20px;
  overflow-y: auto;
}

.speedometer-error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #e94560;
  text-align: center;
  padding: 20px;
}

.speedometer-error svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
}

.speedometer-error p {
  font-size: 1rem;
  color: #888;
  max-width: 280px;
}

/* Straßeninfo Bar */
.street-info-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  margin-bottom: 24px;
}

.street-icon {
  width: 24px;
  height: 24px;
  color: #e94560;
  flex-shrink: 0;
}

.street-name-display {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hauptanzeige */
.speedometer-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  min-height: 300px;
}

/* Aktuelle Geschwindigkeit */
.current-speed {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 50px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  border: 3px solid #0f3460;
  transition: all 0.3s ease;
}

.current-speed.over-limit {
  background: rgba(233, 69, 96, 0.15);
  border-color: #e94560;
  animation: pulse-warning 1s ease-in-out infinite;
}

@keyframes pulse-warning {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.4); }
  50% { box-shadow: 0 0 30px 10px rgba(233, 69, 96, 0.2); }
}

.speed-value {
  font-size: 5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.current-speed.over-limit .speed-value {
  color: #e94560;
}

.speed-unit {
  font-size: 1.2rem;
  color: #888;
  margin-top: 8px;
  font-weight: 500;
}

/* Speed Limit Schild */
.speed-limit-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.speed-sign {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #fff;
  border: 8px solid #e94560;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.speed-sign-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.speed-sign-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a2e;
}

.speed-sign-unknown {
  border-color: #555;
}

.speed-sign-unknown .speed-sign-value {
  color: #555;
}

.speed-limit-label {
  font-size: 0.9rem;
  color: #888;
  font-weight: 500;
}

/* Status Anzeige */
.speedometer-status {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  font-size: 0.85rem;
  color: #888;
}

.status-indicator svg {
  width: 18px;
  height: 18px;
}

.status-indicator.active {
  color: #4ecca3;
}

.status-indicator.active svg {
  color: #4ecca3;
}

.gps-accuracy {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  font-size: 0.85rem;
  color: #888;
}

/* Geschwindigkeitswarnung */
.speed-warning {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 24px;
  background: rgba(233, 69, 96, 0.2);
  border: 1px solid #e94560;
  border-radius: 12px;
  color: #e94560;
  font-weight: 600;
  animation: flash-warning 0.5s ease-in-out infinite alternate;
}

@keyframes flash-warning {
  from { opacity: 0.8; }
  to { opacity: 1; }
}

.speed-warning svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 480px) {
  .header { padding: 10px 12px; }
  .header-title h1 { font-size: 1.1rem; }
  .speedcamera-list { padding: 12px; }
  .list-item { padding: 12px; }
  .street-name { font-size: 0.95rem; }
  
  .speedometer-container { padding: 16px; }
  .speed-value { font-size: 4rem; }
  .current-speed { padding: 24px 40px; }
  .speed-sign { width: 80px; height: 80px; border-width: 6px; }
  .speed-sign-value { font-size: 2rem; }
  .speedometer-main { gap: 30px; }
}

/* Undercover Mode */
.undercover-app {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

.speedometer-container.undercover-mode {
  height: 100vh;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

