/* ==================================================================
   NEW FEATURE STYLES (Phase 1-4 Enhancements)
   ================================================================== */

/* ============= Toolbar (Voice + Settings Buttons) ============= */
.toolbar-fixed {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 1000;
}

.toolbar-btn {
  background: var(--card-bg);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  font-size: 1.2em;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-fast), background var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn:hover {
  transform: scale(1.1);
}

.toolbar-btn:active {
  transform: scale(0.95);
}

.toolbar-btn.active {
  background: #4CAF50;
  color: white;
}

/* ============= City Search Autocomplete ============= */
.city-search-input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  transition: border var(--transition-fast);
}

.city-search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.city-suggestions {
  position: relative;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  background: var(--card-bg);
  border: 2px solid #ddd;
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg);
  margin-top: -5px;
  z-index: 100;
}

.city-suggestion-item {
  padding: 12px 15px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background var(--transition-fast);
}

.city-suggestion-item:hover {
  background: #f5f7fa;
}

.city-suggestion-item:last-child {
  border-bottom: none;
}

.city-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.city-coords {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.recent-searches-header {
  padding: 8px 15px;
  background: #f5f7fa;
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--text-muted);
  border-bottom: 1px solid #ddd;
}

.city-suggestion-item.recent {
  background: #fafbfc;
}

/* ============= Interactive Sun Controls ============= */
.sun-controls {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}

.sun-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.control-label {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 100px;
}

.time-slider {
  flex: 1;
  min-width: 200px;
  height: 8px;
  border-radius: 4px;
  outline: none;
  background: linear-gradient(to right, #FDB99B 0%, #87CEEB 50%, #FDB99B 100%);
}

.time-slider::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.time-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: none;
}

.time-display {
  font-family: 'Courier New', monospace;
  font-size: 1.2em;
  font-weight: bold;
  color: var(--text-primary);
  min-width: 60px;
}

.quick-jump-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 10px 0;
}

.btn-small {
  padding: 8px 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-sm);
  transition: background var(--transition-fast);
}

.btn-small:hover {
  background: #5568d3;
}

.date-picker {
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: var(--radius-sm);
  font-size: var(--font-base);
}

/* ============= News Section ============= */
.news-section {
  margin: var(--spacing-2xl) 0;
  padding: var(--spacing-xl);
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.news-title {
  font-size: var(--font-xl);
  font-weight: bold;
  color: #e65100;
  margin-bottom: var(--spacing-md);
}

.news-content {
  margin-top: 15px;
}

.news-item {
  padding: 15px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.news-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.news-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.news-emoji {
  font-size: 1.4em;
}

.news-source {
  font-weight: 600;
}

.news-date {
  margin-left: auto;
}

.news-title a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--font-md);
}

.news-title a:hover {
  color: #667eea;
  text-decoration: underline;
}

.news-description {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  line-height: 1.5;
}

/* ============= Webcams Section ============= */
.webcams-section {
  margin: var(--spacing-2xl) 0;
  padding: var(--spacing-xl);
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.webcams-title {
  font-size: var(--font-xl);
  font-weight: bold;
  color: #2e7d32;
  margin-bottom: var(--spacing-md);
}

#webcams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.webcam-item {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
}

.webcam-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.webcam-image-container {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.webcam-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.priority-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.7);
  color: white;
}

.priority-badge.city {
  background: #4CAF50;
}

.priority-badge.region {
  background: #2196F3;
}

.priority-badge.country {
  background: #FF9800;
}

.webcam-info {
  padding: 15px;
}

.webcam-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.webcam-location,
.webcam-distance {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin: 3px 0;
}

.webcam-link {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  background: #4CAF50;
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  transition: background var(--transition-fast);
}

.webcam-link:hover {
  background: #45a049;
}

/* ============= Weather Charts ============= */
.charts-section {
  margin: var(--spacing-2xl) 0;
  padding: var(--spacing-xl);
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.charts-title {
  font-size: var(--font-xl);
  font-weight: bold;
  color: #1565c0;
  margin-bottom: var(--spacing-md);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.chart-container {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.chart-container h4 {
  margin: 0 0 15px 0;
  color: var(--text-primary);
  font-size: var(--font-md);
}

.chart-container canvas {
  max-height: 250px;
}

/* ============= Timezone Section ============= */
.timezone-section {
  margin: var(--spacing-2xl) 0;
  padding: var(--spacing-xl);
  background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.timezone-title {
  font-size: var(--font-xl);
  font-weight: bold;
  color: #6a1b9a;
  margin-bottom: var(--spacing-md);
}

.timezone-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.timezone-selector {
  flex: 1;
  min-width: 200px;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: var(--radius-md);
  font-size: var(--font-base);
}

.timezone-clocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.timezone-card {
  padding: 20px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: transform var(--transition-fast);
}

.timezone-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.timezone-card.daytime {
  background: linear-gradient(135deg, #fff9e6 0%, #ffe0b2 100%);
}

.timezone-card.nighttime {
  background: linear-gradient(135deg, #283593 0%, #1a237e 100%);
  color: white;
}

.timezone-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.timezone-emoji {
  font-size: 1.5em;
}

.timezone-city {
  font-weight: 600;
  font-size: var(--font-md);
}

.timezone-remove {
  background: none;
  border: none;
  color: #f44336;
  cursor: pointer;
  font-size: 1.2em;
  padding: 0 5px;
}

.timezone-time {
  font-size: 2em;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  margin: 10px 0;
}

.timezone-date {
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.timezone-indicator {
  margin-top: 10px;
  font-size: var(--font-sm);
  font-weight: 600;
}

.best-meeting-time {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-top: 20px;
}

.meeting-time-header {
  font-weight: 600;
  font-size: var(--font-md);
  margin-bottom: 10px;
  color: var(--text-primary);
}

.meeting-time-main {
  font-size: 1.5em;
  font-weight: bold;
  color: #6a1b9a;
  margin: 10px 0;
}

.meeting-time-cities {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.meeting-time-city {
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

/* ============= Settings Panel ============= */
.settings-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.settings-header h3 {
  margin: 0;
  font-size: var(--font-xl);
}

.btn-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5em;
  cursor: pointer;
  padding: 5px 10px;
}

.settings-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.settings-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h4 {
  margin: 0 0 15px 0;
  color: var(--text-primary);
  font-size: var(--font-md);
}

.settings-section label {
  display: block;
  margin: 10px 0;
  cursor: pointer;
}

.settings-section input[type="checkbox"] {
  margin-right: 8px;
}

.settings-section input[type="number"] {
  margin-left: 8px;
  width: 80px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
}

.settings-footer {
  padding: 15px 20px;
  background: #f5f7fa;
  border-top: 1px solid #ddd;
  text-align: right;
}

.btn-primary {
  padding: 10px 20px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-base);
  font-weight: 600;
  transition: background var(--transition-fast);
}

.btn-primary:hover {
  background: #45a049;
}

.btn-secondary {
  padding: 8px 16px;
  background: #ddd;
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 10px;
  transition: background var(--transition-fast);
}

.btn-secondary:hover {
  background: #ccc;
}

/* ============= Utility Classes ============= */
.timestamp {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin: 10px 0;
  text-align: center;
}

.btn-refresh {
  display: block;
  margin: 15px auto 0;
  padding: 8px 16px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-refresh:hover {
  background: #5568d3;
}

/* ============= Notification Prompt ============= */
.notification-prompt {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 350px;
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 1500;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-prompt-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification-prompt-icon {
  font-size: 2em;
  text-align: center;
}

.notification-prompt-text {
  text-align: center;
}

.notification-prompt-text strong {
  display: block;
  margin-bottom: 5px;
  font-size: var(--font-md);
}

.notification-prompt-text p {
  margin: 0;
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

.notification-prompt-buttons {
  display: flex;
  gap: 10px;
}

/* ============= Responsive Updates ============= */
@media (max-width: 600px) {
  .toolbar-fixed {
    top: 10px;
    right: 10px;
    gap: 5px;
  }

  .toolbar-btn {
    width: 40px;
    height: 40px;
    font-size: 1em;
  }

  .sun-controls {
    padding: 15px;
  }

  .control-label {
    width: 100%;
    margin-bottom: 5px;
  }

  .quick-jump-buttons {
    width: 100%;
  }

  .btn-small {
    flex: 1;
    min-width: 70px;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  #webcams-grid {
    grid-template-columns: 1fr;
  }

  .timezone-clocks-grid {
    grid-template-columns: 1fr;
  }

  .settings-panel {
    width: 95%;
    max-height: 90vh;
  }

  .notification-prompt {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }
}

/* ============= Dark Mode Updates for New Features ============= */
[data-theme="dark"] .news-section {
  background: linear-gradient(135deg, #2d2416 0%, #1f1812 100%);
}

[data-theme="dark"] .webcams-section {
  background: linear-gradient(135deg, #1a3a1f 0%, #0f2115 100%);
}

[data-theme="dark"] .charts-section {
  background: linear-gradient(135deg, #1a2d3e 0%, #0f1b29 100%);
}

[data-theme="dark"] .timezone-section {
  background: linear-gradient(135deg, #2d1b3d 0%, #1f1326 100%);
}

[data-theme="dark"] .sun-controls {
  background: rgba(15, 52, 96, 0.9);
}

[data-theme="dark"] .settings-panel {
  background: #1a1a2e;
}

[data-theme="dark"] .settings-footer {
  background: #0f1419;
}

[data-theme="dark"] .city-search-input {
  background: #1a1a2e;
  color: #e8e8e8;
  border-color: #444;
}

[data-theme="dark"] .city-suggestions {
  background: #1a1a2e;
  border-color: #444;
}

[data-theme="dark"] .city-suggestion-item:hover {
  background: #262640;
}

/* Map Markers Mobile Fix */
.weather-marker,
.user-location-marker {
  background: transparent !important;
  border: none !important;
}

.leaflet-div-icon {
  background: transparent !important;
  border: none !important;
}

/* ============= Earth View Visualization ============= */
.view-toggle-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.view-toggle-btn {
  padding: 8px 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.view-toggle-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.earth-view-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#earth-view-svg {
  max-width: 350px;
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  cursor: grab;
  user-select: none;
}

#earth-view-svg:active {
  cursor: grabbing;
}

/* Compass Controls */
.compass-controls {
  width: 100%;
  max-width: 350px;
  margin: 15px auto 0 auto;
  padding: 15px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}

.compass-control-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

#compass-bearing-display {
  font-family: 'Courier New', monospace;
  font-size: 1.1em;
  color: #4CAF50;
}

.compass-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right,
      #FF4444 0%,
      /* N - Red */
      #4CAF50 25%,
      /* E - Green */
      #2196F3 50%,
      /* S - Blue */
      #FF9800 75%,
      /* W - Orange */
      #FF4444 100%
      /* N - Red */
    );
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  margin-bottom: 12px;
}

.compass-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 3px solid #667eea;
}

.compass-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 3px solid #667eea;
}

.compass-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.compass-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1em;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.compass-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.compass-btn:active {
  transform: scale(0.95);
}

.compass-hint {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}

.compass-permission-btn {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.compass-permission-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

/* Dark Mode Support for Earth View */
[data-theme="dark"] .compass-controls {
  background: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .compass-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .compass-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .view-toggle-btn {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .view-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile Responsive Adjustments */
@media (max-width: 400px) {
  #earth-view-svg {
    max-width: 300px;
  }

  .compass-controls {
    max-width: 300px;
    padding: 12px;
  }

  .compass-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9em;
  }

  .view-toggle-btn {
    padding: 6px 12px;
    font-size: 0.85em;
  }
}