* {
  box-sizing: border-box;
}
body, html {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: #E3F2FD;
  overflow-x: hidden;
}

/* === Navbar === */
.navbar {
  background-color: #002B5B;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 999;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  height: 32px;
}
.brand-title {
  color: white;
  font-weight: bold;
  font-size: 18px;
  white-space: nowrap;
}
.nav-left-inner {
  display: flex;
  align-items: center;
  gap: 6px; /* control spacing between logo + title */
}
.nav-center {
  flex: 1;
  padding: 0 20px;
}
#searchBox {
  width: 100%;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #6C757D;
  background-color: #fff;
  font-size: 14px;
  color: #002B5B;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-link {
  color: white;
  font-weight: bold;
}
.nav-link:hover {
  color: #00BFA6;
}
.profile-pic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #00BFA6;
}

/* === Burger === */
.burger {
  display: none;
  font-size: 24px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

/* === Mobile Menu === */
.nav-mobile-menu {
  display: none;
  flex-direction: column;
  background-color: #002B5B;
  padding: 10px 0;
}
.nav-mobile-menu.show-menu {
  display: flex;
}
.nav-mobile-menu .nav-link {
  padding: 10px 20px;
  border-top: 1px solid #004080;
  width: 100%;
}

/* === Map === */
#map {
  position: absolute;
  top: 60px;
  bottom: 0;
  left: 0;
  right: 0;
}

/* === Bottom Bar === */
#bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  padding: 12px 16px;
  display: none;
  z-index: 999;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}
#get-dir-btn {
  background: #007BFF;
  color: white;
  padding: 8px 14px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
}
#get-dir-btn:hover {
  background-color: #0056b3;
}

/* === Dropdown === */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropbtn {
  background: none;
  border: none;
  color: white;
  font-weight: bold;
  cursor: pointer;
  font-size: 14px;
  
  display: flex;        
  align-items: center;       
  gap: 8px; 
}
.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: white;
  min-width: 140px;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  border-radius: 6px;
  overflow: hidden;
}
.dropdown-content a {
  color: #002B5B;
  padding: 10px 14px;
  text-decoration: none;
  display: block;
  font-weight: normal;
}
.dropdown-content a:hover {
  background-color: #E3F2FD;
}
.dropdown:hover .dropdown-content {
  display: block;
}

/* === Profile === */
/* === Profile Page Styling === */
.profile-page {
  padding: 60px 15px;
  background-color: #F0F2F5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: start;
}

.profile-container {
  max-width: 500px;
  width: 100%;
  margin: 40px auto;
  background: #FFFFFF;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-container h2 {
  text-align: center;
  color: #002B5B;
  margin-bottom: 20px;
}

.profile-container label {
  font-weight: bold;
  margin-top: 12px;
  display: block;
  color: #002B5B;
}

.profile-container input[type="text"],
.profile-container input[type="email"],
.profile-container input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #6C757D;
  border-radius: 5px;
  margin-top: 6px;
  margin-bottom: 10px;
}

.profile-container input[type="checkbox"] {
  margin-right: 8px;
}

.profile-container button {
  background-color: #007BFF;
  color: white;
  border: none;
  padding: 10px 16px;
  margin-top: 20px;
  width: 100%;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.profile-container button:hover {
  background-color: #0056b3;
}

.profile-container img {
  display: block;
  margin: 0 auto 20px;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  border: 2px solid #00BFA6;
  object-fit: cover;
}

/* Success and Error Message Styling */
.profile-container .success {
  background-color: #d4edda;
  color: #155724;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
  border: 1px solid #c3e6cb;
  text-align: center;
}

.profile-container .error {
  background-color: #f8d7da;
  color: #721c24;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
  border: 1px solid #f5c6cb;
  text-align: center;
}


/* === Login/Register Page Container === */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #E3F2FD; /* Light Blue background */
  padding: 20px;
}

.login-container {
  background-color: #FFFFFF; /* White card */
  border-radius: 8px;
  padding: 30px 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
  margin-bottom: 20px;
  color: #002B5B; /* Dark Blue */
  font-size: 24px;
  text-align: center;
}

/* === Form Fields === */
.login-container label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  color: #002B5B;
}

.login-container input[type="email"],
.login-container input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 5px;
  border: 1px solid #6C757D; /* Gray border */
  margin-bottom: 16px;
  font-size: 14px;
  color: #002B5B;
}

.login-container input[type="email"]::placeholder,
.login-container input[type="password"]::placeholder {
  color: #6C757D;
}

/* === Checkbox === */
.checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #002B5B;
}

/* === Button === */
.login-container button {
  width: 100%;
  background-color: #007BFF; /* Primary Blue */
  color: white;
  border: none;
  padding: 12px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.login-container button:hover {
  background-color: #0056b3;
}

/* === Links === */
.login-container p {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: #002B5B;
}

.login-container p a {
  color: #007BFF;
  text-decoration: none;
  font-weight: bold;
}

.login-container p a:hover {
  color: #0056b3;
}

/* === Error and Success Messages === */
.error {
  background-color: #FF9800;
  color: white;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 5px;
  font-weight: bold;
}

.success {
  background-color: #00BFA6;
  color: black;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 5px;
  font-weight: bold;
}

/* === Register Page === */
.register-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #E3F2FD; /* Light Blue background */
  padding: 20px;
}

.register-container {
  background-color: #FFFFFF; /* White card */
  padding: 30px 40px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  max-width: 450px;
  width: 100%;
}

.register-container h2 {
  color: #002B5B; /* Dark Blue heading */
  text-align: center;
  margin-bottom: 24px;
}

.register-container label {
  font-weight: bold;
  color: #002B5B;
  display: block;
  margin-top: 14px;
  margin-bottom: 4px;
}

.register-container input[type="text"],
.register-container input[type="email"],
.register-container input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #6C757D; /* Gray border */
  border-radius: 5px;
  font-size: 14px;
  color: #002B5B;
  background-color: #fff;
}

.register-container input::placeholder {
  color: #6C757D;
}

.register-container button {
  width: 100%;
  background-color: #007BFF; /* Primary Blue */
  color: white;
  border: none;
  padding: 12px;
  font-size: 16px;
  border-radius: 6px;
  font-weight: bold;
  margin-top: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.register-container button:hover {
  background-color: #0056b3;
}

.register-container p {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: #002B5B;
}

.register-container p a {
  color: #007BFF;
  text-decoration: none;
}

.register-container p a:hover {
  text-decoration: underline;
}

/* === alert page === */
/* === alert page (scoped to .alerts-page) === */
.alerts-page .alert-page-container {
  padding: 20px;
  max-width: 800px;
  margin: 80px auto 40px;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.alerts-page .alert-page-container h2 {
  color: #002B5B;
  margin-bottom: 20px;
}

.alerts-page .alert-card {
  border-left: 5px solid #007BFF;
  padding: 15px 20px;
  margin-bottom: 20px;
  border-radius: 5px;
  background-color: #F9FAFC;
}

.alerts-page .alert-card h3 {
  margin: 0 0 10px;
  color: #002B5B;
}

.alerts-page .alert-card p {
  margin-bottom: 10px;
  color: #333;
}

.alerts-page .alert-card.traffic {
  border-color: #FF9800;
}

.alerts-page .alert-card.road {
  border-color: #dc3545;
}

.alerts-page .alert-card.announcement {
  border-color: #007BFF;
}

.alerts-page .alert-card small {
  color: #6C757D;
  font-size: 13px;
}

/* === Profile Page: Scoped Modal Styling === */
.profile-page .modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none; /* hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.profile-page .modal-overlay.active {
  display: flex; /* shown when active */
}

.profile-page .modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 10px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease-in-out;
}

.profile-page .modal-content h3 {
  margin-bottom: 20px;
  color: #002B5B;
  text-align: center;
}

.profile-page .modal-content label {
  display: block;
  margin-top: 12px;
  font-weight: bold;
  color: #002B5B;
}

.profile-page .modal-content input[type="password"] {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid #6C757D;
  border-radius: 5px;
}

.profile-page .modal-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.profile-page .modal-buttons button {
  padding: 10px 16px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  width: 48%;
  transition: background-color 0.3s ease;
}

.profile-page .modal-buttons button[type="submit"] {
  background-color: #007BFF;
  color: #fff;
}

.profile-page .modal-buttons button[type="submit"]:hover {
  background-color: #0056b3;
}

.profile-page .modal-buttons button[type="button"] {
  background-color: #6c757d;
  color: #fff;
}

.profile-page .modal-buttons button[type="button"]:hover {
  background-color: #5a6268;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* === Responsive === */
/* === Responsive for navbar === */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-left {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 6px;
    justify-content: space-between;
  }
  
  .nav-left-inner {
    display: flex;
    align-items: center;
    gap: 6px; /* control spacing between logo + title */
  }

  .nav-center {
    width: 100%;
    margin: 10px 0;
    padding: 0 10px;
  }

  .desktop-menu {
    display: none;
  }

  .burger {
    display: block;
  }

  .nav-mobile-menu .nav-link {
    color: white;
  }
}

@media (max-width: 768px) {
  .register-container {
    padding: 25px 25px;
    max-width: 100%;
    min-height: unset;
  }

  .register-container h2 {
    font-size: 22px;
  }
}

