
/* Ensure map fills screen correctly on smaller devices */



@media (max-width: 768px) {
  #map {
    height: 70vh;
  }

  h1 {
    font-size: 1.8em;
    padding: 15px;
  }

  .floating-controls {
    bottom: 20px;
    right: 10px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .control-btn {
    padding: 12px;
    font-size: 14px;
  }

  #toggleCameraBtn {
    top: auto;
    bottom: 120px;
    right: 10px;
    font-size: 14px;
    padding: 8px 14px;
  }

  .floating-cards {
    top: auto;
    bottom: 100px;
    left: 10px;
    flex-direction: column;
    gap: 8px;
  }

  .floating-cards .card {
    font-size: 13px;
    padding: 15px 10px;
    min-width: 110px;
  }

  .user-detail-btn {
    top: 10px;
    right: 10px;
    padding: 15px;
    font-size: 18px;
  }

  #alertBox {
    font-size: 14px;
    padding: 12px 24px;
    bottom: 20px;
  }

  .alert-box {
    padding: 15px 25px;
    font-size: 18px;
  }

  #driverCam, #faceCanvas {
    width: 150px;
    height: 110px;
    left: 10px;
    bottom: 10px;
  }
}

body {
  margin: 0;
  font-family: 'Arial Rounded MT Bold', Arial, sans-serif;
  background: linear-gradient(45deg, #0b1a20, #11232b);
  color: white;
  overflow: hidden;
}

h1 {
  text-align: center;
  padding: 25px;
  margin: 0;
  background: rgba(0, 0, 0, 0.4);
  font-size: 2.5em;
  text-shadow: 0 0 15px rgba(0, 188, 212, 0.5);
  animation: titleGlow 2s ease-in-out infinite alternate;
}

#map {
  width: 100%;
  height: 85vh;
  transition: all 0.3s ease;
  position: relative;
}

/* Alert Box */
#alertBox {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  padding: 20px 40px;
  background: linear-gradient(45deg, #ff4444, #cc0000);
  color: white;
  border-radius: 15px;
  font-weight: bold;
  box-shadow: 0 10px 30px rgba(255, 68, 68, 0.3);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  align-items: center;
  gap: 15px;
}

#alertBox.active {
  bottom: 30px;
  opacity: 1;
}

#alertBox::before {
  content: '⚠️';
  font-size: 1.5em;
  animation: pulse 1.5s infinite;
}

/* Overlay */
.map-overlay {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 15px;
  border-radius: 10px;
  z-index: 1000;
}

/* Loading screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loader {
  width: 50px;
  height: 50px;
  border: 5px solid #00bcd4;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

/* Floating Controls */

/*.floating-controls {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  gap: 15px;
  z-index: 1000;
}

.control-btn {
  background: rgba(0, 188, 212, 0.9);
  padding: 15px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 188, 212, 0.3);
}

.control-btn:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 188, 212, 0.5);
}

.control-btn:last-child {
  background-color: #e53935 !important;
  color: white;
}*/
.floating-controls {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  display: flex;
  flex-direction: column; /* Settings button stays at bottom */
  align-items: flex-end;
  gap: 10px;
}

.control-toggle {
  background: rgba(0, 188, 212, 0.9);
  padding: 15px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 188, 212, 0.3);
}

.control-toggle:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 188, 212, 0.5);
}

.control-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.control-container.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.control-btn,
.control-toggle {
  background: linear-gradient(135deg, #00c6ff, #0072ff); /* vibrant blue gradient */
  color: #fff;
  padding: 5px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 18px rgba(0, 123, 255, 0.5); /* glowing effect */
  border: 2px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
}

.control-btn:hover,
.control-toggle:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 10px 30px rgba(0, 188, 212, 0.6);
}

.control-btn:last-child {
  background: linear-gradient(135deg, #ff416c, #ff4b2b); /* red-orange gradient */
  color: white;
  box-shadow: 0 6px 18px rgba(255, 65, 108, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.control-btn:last-child:hover {
  box-shadow: 0 10px 30px rgba(255, 65, 108, 0.7);
  transform: translateY(-4px) scale(1.1);
}
/* Toggle Camera Button */
#toggleCameraBtn {
  position: fixed;
  top: 150px;
  height:50px;
  
  right: 20px;
  padding: 8px 16px; /* changed from 10px 20px */
  background-color: #007BFF;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px; /* changed from 16px */
  cursor: pointer;
  z-index: 1000;
}


/* Petrol Button */
#findPetrolButton {
  position: fixed;
  bottom: 30px;
  right: 370px;
  background-color: #06b6e6;
  color: white;
  border: none;
  padding: 15px 20px;
  font-size: 16px;
  border-radius: 50px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
}

#findPetrolButton:hover {
  background-color: #0056b3;
  transform: scale(1.05);
}

/* Alert Blink */
.alert-box {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #ff4d4d;
  color: white;
  padding: 20px 40px;
  font-size: 24px;
  border-radius: 12px;
  box-shadow: 0 0 10px #ff4d4d;
  z-index: 1000;
  animation: blink 1s infinite;
}

@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* Camera & Canvas */
#driverCam, #faceCanvas {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 200px;
  height: 150px;
  border-radius: 10px;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#driverCam {
  display: none;
  background-color: #fff;
}

#faceCanvas {
  z-index: 1001;
  pointer-events: none;
}

/* Responsive Camera */
@media (max-width: 600px) {
  #driverCam, #faceCanvas {
    width: 100%;
    max-width: 200px;
    height: auto;
    bottom: 10px;
    left: 10px;
  }
}

/* Petrol Shortcut Button */
#findPetrolBtn {
  position: fixed;
  bottom: 90px;
  left: 20px;
  z-index: 999;
  padding: 10px 16px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* User Profile Button */
.user-detail-btn {
  background: rgba(4, 138, 142, 0.148);
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 1000;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 0 20px rgba(10, 171, 171, 0.1);
  backdrop-filter: blur(0px);
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.user-detail-btn:hover {
  background-color: #0097a7;
}

.profile-picture {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

/* Floating Info Cards */
.floating-cards {
  position: absolute;
  top: 140px;
  left: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slideIn 1s ease-out forwards;
  opacity: 0;
}

.floating-cards .card {
  padding: 20px 15px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 10px;
  font-size: 14px;
  min-width: 70px;
  box-shadow: 0 4px 12px rgba(45, 12, 146, 0.4);
  transition: transform 0.3s ease, background-color 0.3s ease;
  transform: translateY(5px);
}

.floating-cards .card:hover {
  transform: translateY(-3px) scale(1.02);
  background-color: rgba(0, 0, 0, 0.8);
}

/* Light Mode */
body.light-mode .floating-cards .card {
  background-color: rgba(255, 255, 255, 0.9);
  color: black;
}

body.light-mode .floating-cards .card:hover {
  background-color: #ffffff;
}

/* Animations */
@keyframes titleGlow {
  from { text-shadow: 0 0 10px rgba(0, 188, 212, 0.5); }
  to { text-shadow: 0 0 25px rgba(0, 188, 212, 0.8); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

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

@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateX(-30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}
