/* ===== GENERAL STYLES ===== */
:root {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-primary: #00b4d8;
    --accent-secondary: #0077b6;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --border-radius: 8px;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition);
  }
  
  a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
  }
  
/* ===== HEADER & NAVIGATION ===== */
header {
  background-color: var(--bg-secondary);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent-primary);
}

.logo i {
  margin-right: 0.5rem;
  font-size: 1.8rem;
}

nav {
  display: flex;
  align-items: center;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

nav a:hover, nav a.active {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
  text-decoration: none;
}

nav a.active {
  border-bottom: 2px solid var(--accent-primary);
}

nav a i {
  font-size: 1.1rem;
}
  
  /* ===== MAIN CONTENT ===== */
  main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
  }
  
  section {
    margin-bottom: 2rem;
  }
  
  .hero {
    text-align: center;
    margin-bottom: 2.5rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
  }
  
  .hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
  }
  
  /* ===== CARDS ===== */
  .card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
  }
  
  .card-header {
    background-color: var(--bg-tertiary);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .card-header h2 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .card-header h2 i {
    color: var(--accent-primary);
  }
  
  .card-body {
    padding: 1.5rem;
  }
  
  /* ===== BUTTONS ===== */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
  }
  
  .btn i {
    font-size: 1.1rem;
  }
  
  .btn.primary {
    background-color: var(--accent-primary);
    color: white;
  }
  
  .btn.primary:hover {
    background-color: var(--accent-secondary);
  }
  
  .btn.secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
  }
  
  .btn.secondary:hover {
    background-color: #3a3a3a;
  }
  
  .btn.danger {
    background-color: var(--danger);
    color: white;
  }
  
  .btn.danger:hover {
    background-color: #d32f2f;
  }
  
  .button-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
  }
  
  /* ===== FORMS ===== */
  .form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  label {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  input, select {
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius);
    background-color: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
    transition: var(--transition);
  }
  
  input:focus, select:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.25);
  }
  
  input[type="file"] {
    display: none;
  }
  
  .file-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .file-label:hover {
    background-color: #3a3a3a;
  }
  
  .file-name {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
  }
  
  /* ===== TOGGLE SWITCHES ===== */
  .toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
  }
  
  .toggle input {
    display: none;
  }
  
  .toggle-label {
    position: relative;
    padding-left: 50px;
    line-height: 24px;
  }
  
  .toggle-label:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 24px;
    background-color: var(--bg-tertiary);
    border-radius: 12px;
    transition: var(--transition);
  }
  
  .toggle-label:after {
    content: '';
    position: absolute;
    left: 4px;
    top: 4px;
    width: 16px;
    height: 16px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    transition: var(--transition);
  }
  
  .toggle input:checked + .toggle-label:before {
    background-color: var(--accent-primary);
  }
  
  .toggle input:checked + .toggle-label:after {
    left: 20px;
    background-color: white;
  }
  
  /* ===== MAP STYLES ===== */
  .map-container {
    margin-bottom: 2rem;
    z-index: 1; 
  }
  
  #map {
    height: 600px;
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
  }
  
  .map-controls .control-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .map-controls .control-group:last-child {
    margin-bottom: 0;
  }
  
  .map-controls .control-item {
    flex: 1;
    min-width: 200px;
  }
  
  .journey-fetch {
    flex: 2;
  }
  
  .input-with-button {
    display: flex;
    gap: 0.5rem;
  }
  
  .input-with-button input {
    flex: 1;
  }
  
  .leaflet-top, .leaflet-bottom {
    z-index: 800; /* Lower than header but higher than other content */
  }
  
  /* ===== LOG DISPLAY ===== */
  .text-display {
    background-color: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--border-radius);
    max-height: 400px;
    overflow-y: auto;
    font-family: monospace;
    white-space: pre-wrap;
    font-size: 0.9rem;
  }
  
  .text-display p {
    margin-bottom: 0.5rem;
    line-height: 1.4;
  }
  
  /* ===== UPLOAD INSTRUCTIONS ===== */
  .upload-instructions ol {
    padding-left: 1.5rem;
  }
  
  .upload-instructions li {
    margin-bottom: 0.75rem;
  }
  
  /* ===== FOOTER ===== */
  footer {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    text-align: center;
    margin-top: auto;
    color: var(--text-secondary);
    font-size: 0.9rem;
  }
  
/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  header {
      flex-direction: column;
      padding: 1rem;
  }
  
  .logo {
      margin-bottom: 0.5rem;
  }
  
  nav {
      width: 100%;
  }
  
  nav ul {
      justify-content: space-around;
      width: 100%;
      gap: 0.5rem;
  }
  
  nav a {
      padding: 0.5rem;
      font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  nav ul {
      padding: 0 0.5rem;
  }
  
  nav a {
      font-size: 0.85rem;
      padding: 0.4rem;
  }
  
  nav a i {
      font-size: 1.2rem;
  }
}

/* ===== LIGHT THEME OVERRIDES ===== */
[data-theme="light"] {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e0e0e0;
  --text-primary: #000000;
  --text-secondary: #333333;
}

/* ===== DISABLED BUTTONS STYLES ===== */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* ===== THEME TOGGLE BUTTON STYLES ===== */
nav li .theme-toggle {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  transition: var(--transition);
}

nav li .theme-toggle:hover {
  cursor: pointer;
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

/* Update the theme toggle styles */
.theme-toggle {
  color: var(--text-secondary);
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.theme-toggle:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}