* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body{
  background: linear-gradient(to right, #4285f4,#34a853, #fbbc05, #ea4335)
}

/* MAP FULLSCREEN */
#map {
  position: fixed;
  top: 100;           /* Starts at the very top */
  left: 0;
  width: 100vw;
  height: 100vh;    /* Covers full height */
  z-index: 0;
}

/* --- 2. FLOATING INDIVIDUAL NAVBAR ITEMS --- */
.navbar-maps {
  position: fixed;
  width: 100%;
  z-index: 1000;
  pointer-events: none; /* Allows clicking through the empty space around buttons */
}

.navbar-maps nav {
  display: flex;
  justify-content: center;
  gap: 15px;        /* Space between the glass pills */
  pointer-events: auto; /* Re-enables clicking on the buttons themselves */
}

/* The Glass Pills */
.navbar-maps nav a {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: 'Montserrat', sans-serif;
  
  /* Glassmorphism Style */
  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  
  padding: 10px 25px;
  border-radius: 50px; /* Pill shape */
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  
  /* Resetting inherited styles */
  position: static !important; 
  margin: 0 !important;
}

/* Hover Effects */
.navbar-maps nav a:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

/* Active Page Style */
.navbar-maps nav a.active-link {
  background: #4CAF50; /* Green */
  color: white;
  border-color: #4CAF50;
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

/* Special styling for Register/Logout button to fit in */
.navbar-maps .nav-btn {
  /* Ensuring it looks just like the others */
  right: auto !important; 
  background: rgba(20, 20, 20, 0.75);
}

/* NAVBAR */
.navbar {
  position: relative;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px 30px;
}

.navbar nav a {
  margin-right: 20px;
  text-decoration: none;
  font-weight: bold;
  color: #333;
}

/* CONTROLS CARD */

.controls {
  position: absolute;
  top: 10%; 
  left: 30px;
  width: 280px; 
  background: white;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 1000;
}


.controls input, 
.controls button {
  width: 100%; 
  padding: 12px;
  box-sizing: border-box; 
  border-radius: 8px;
  font-family: inherit;
}

.controls input {
  border: 1px solid #ddd;
  font-size: 14px;
}

.controls button {
  background: #4CAF50;
  color: white;
  border: none;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.controls button:hover {
  background: #45a049;
}



/* LEGEND */
#legend {
  position: absolute;
  bottom: 30px;
  left: 30px;
  z-index: 10;

  background: white;
  padding: 12px 15px;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.safe { color: green; font-weight: bold; }
.moderate { color: orange; font-weight: bold; margin-left: 10px; }
.risky { color: red; font-weight: bold; margin-left: 10px; }


.safety-glass-container {
    position: fixed;
    bottom: 10.5%;
    left: 12.3%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 275px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    border-radius: 20px; /* Rounded pill shape */
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    font-family: sans-serif;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

.hidden { display: none !important; }

.safety-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.safety-title { font-size: 12px; font-weight: bold; color: #555; }
.safety-value { font-size: 16px; font-weight: 900; color: #27ae60; }

.progress-track { width: 100%; height: 8px; background: #eee; border-radius: 10px; }
.progress-fill { height: 100%; background: #2ecc71; border-radius: 10px; transition: width 0.8s ease-in-out; }

#advait{
  height: 120px;
  width: 120px;
}

.feedback-container {
    margin-top: 6px;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.circle-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.route-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.route-circle:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* Glassy background for the circles */
.circle-green { background: #27ae60;  }
.circle-orange { background: #f39c12;  }
.circle-red { background: #e74c3c;  }

.hidden { display: none !important; }

/* Darken the map when feedback opens */
.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* Higher than everything */
}

/* Glassy Comic Bubble */
.comic-speech-bubble {
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    border: 4px solid #333; /* Thick comic outline */
    border-radius: 40px;
    padding: 25px;
    width: 300px;
    box-shadow: 15px 15px 0px rgba(0, 0, 0, 0.15); /* Hard comic shadow */
    animation: comicPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* The Speech Bubble Tail (The "Triangle") */
.bubble-tail {
    position: absolute;
    left: -30px; /* Positions it to point back at the sidebar circles */
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-right: 30px solid #333; /* Triangle pointing left */
}

/* Inner elements */
.comic-title { 
    font-weight: 900; 
    font-style: italic; 
    margin: 0; 
    color: #222; 
}

textarea {
    width: 100%;
    height: 80px;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid #333;
    border-radius: 12px;
    padding: 10px;
    margin: 15px 0;
}

/* Buttons */
.comic-footer { display: flex; gap: 10px; }
.btn-zap , .btn-cancel { 
    background: #ffcc00; /* Classic Comic Yellow */
    border: 3px solid #333; 
    border-radius: 40px;
    padding: 10px; 
    flex: 2; 
    font-weight: bold; 
    cursor: pointer;
}
.btn-cancel{
  background: #ffffff;
    border: 3px solid #333; 
    border-radius: 40px;
    padding: 10px; 
    flex: 2; 
    font-weight: bold; 
    cursor: pointer;
}
#feedbackText{
  color: rgb(0, 0, 0);
}

/* Pop Animation */
@keyframes comicPop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.hidden { display: none !important; }

.test-mode {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.slide-up-enter {
    animation: slideUpBox 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes slideUpBox {
    from {
        opacity: 0;
        transform: translate(-50%, 50px); /* Start lower */
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0); /* End at original position */
    }
}

@media (max-width: 768px) {
    /* Stack controls at the top */
    .controls {
        top: 80px; /* Below navbar */
        left: 5%;
        width: 90%;
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    /* Hide the owl logo on mobile to save space */
    #advait {
        display: none;
    }

    /* Adjust Map Height */
    #map {
        height: 100vh;
        top: 0;
    }

    /* Move Safety Score Box to top-right or just below controls */
    .safety-glass-container {
        bottom: 80px; /* Above legend */
        left: 50%;
        width: 90%;
        padding: 10px;
    }

    /* Make legend smaller */
    #legend {
        bottom: 20px;
        left: 10px;
        font-size: 0.8rem;
        padding: 8px;
        width: calc(100% - 20px);
        text-align: center;
        display: flex;
        justify-content: center;
    }
    
    /* Adjust Modal size */
    .comic-speech-bubble {
        width: 90%;
        margin: 0 auto;
    }
}


/* USER DOCK (Bottom Right Capsule) */
.user-dock {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    background: rgba(20, 20, 20, 0.85); /* Dark background */
    backdrop-filter: blur(12px); /* Glass effect */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px; /* Pill shape */
    padding: 8px 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.user-dock:hover {
    transform: translateY(-5px);
    border-color: rgba(76, 175, 80, 0.5);
}

.user-dock.hidden {
    display: none !important;
}

.dock-item {
    color: white;
    font-size: 1.5rem;
    padding: 8px 12px;
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dock-item:hover {
    color: #4CAF50; /* Green glow */
    transform: scale(1.1);
}

.logout-trigger:hover {
    color: #ff4d4d; /* Red for logout */
}

.dock-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 5px;
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .user-dock {
        bottom: 90px; /* Move up so it doesn't hit the legend/attribution */
        right: 20px;
    }
}


/* --- CUSTOM ANIMATED DROPDOWN --- */
.custom-dropdown-container {
    position: relative;
    width: 100%;
    margin-top: 10px;
    font-family: 'Montserrat', sans-serif;
}

.dropdown-trigger {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 12px 15px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.dropdown-trigger:hover {
    background: #fff;
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
}

.arrow-icon {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
    color: #888;
}

/* Rotate arrow when active */
.custom-dropdown-container.active .arrow-icon {
    transform: rotate(180deg);
}

/* The List Container */
.dropdown-options {
    position: absolute;
    top: 110%; /* Just below the trigger */
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    
    /* Hidden State */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 999;
}

/* Active State (Visible) */
.custom-dropdown-container.active .dropdown-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Individual Items */
.dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #444;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.2s;
    
    /* Animation Start State */
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

/* THE STAGGERED ANIMATION LOGIC */
.custom-dropdown-container.active .dropdown-item {
    opacity: 1;
    transform: translateX(0);
    transition-delay: var(--delay); /* Uses the CSS variable we added in HTML */
}


@media (max-width: 768px) {
  .navbar-maps {
    top: auto;
    bottom: 20px; /* Move navbar to bottom on mobile for easier reach? */
    /* OR keep at top but scale down */
    top: 15px;
  }
  
  .navbar-maps nav {
    gap: 8px;
  }
  
  .navbar-maps nav a {
    padding: 8px 16px;
    font-size: 0.8rem;
    backdrop-filter: blur(8px);
  }
}


/* =========================================
   🚀 HIGH-END ENTRANCE ANIMATIONS
   (Paste at bottom of style_map.css)
   ========================================= */

/* 1. MAP REVEAL (Subtle Scale & Fade) */
#map {
    animation: mapReveal 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    transform-origin: center center;
}

@keyframes mapReveal {
    0% {
        opacity: 0;
        transform: scale(1.05); /* Starts slightly zoomed in */
        filter: blur(10px); /* Starts blurry */
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

/* 2. NAVBAR (Slide Down Smoothly) */
.navbar-maps {
    animation: slideDownGlass 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.3s; /* Waits for map */
    opacity: 0; /* Hidden initially */
    transform: translateY(-50px);
}

@keyframes slideDownGlass {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 3. CONTROLS PANEL (Elastic Slide from Left) */
.controls {
    animation: elasticSlideRight 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: 0.5s; /* Waits for navbar */
    opacity: 0;
    transform: translateX(-100px);
}

@keyframes elasticSlideRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 4. LEGEND & USER DOCK (Pop Up from Bottom) */
#legend, .user-dock {
    animation: popUpBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.8s; /* Appears last */
    opacity: 0;
    transform: translateY(50px) scale(0.9);
}

@keyframes popUpBounce {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 5. INTERACTIVE HOVER EFFECTS (Making it feel alive) */
.controls:hover, #legend:hover, .user-dock:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

/* 6. BUTTON PULSE (Find Route Button) */
#findRouteBtn {
    position: relative;
    overflow: hidden;
}

#findRouteBtn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%) rotate(45deg) translateY(100%);
    transition: transform 0.6s ease;
}

#findRouteBtn:hover::after {
    transform: translate(-50%, -50%) rotate(45deg) translateY(-100%); /* Shine effect */
}

/* 7. LOADING SPINNER ENTRANCE */
#map-loader {
    animation: fadeOutLoader 0.5s ease-out 2s forwards; /* Disappears after 2s */
}

@keyframes fadeOutLoader {
    to {
        opacity: 0;
        visibility: hidden;
    }
}