:root {
  --primary-blue: #011936;
  --accent-orange: #ED254E;
  --secondary-brown: #465362;
  --muted-teal: #F4FFFD;
  --highlight-yellow: #F9DC5C;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--muted-teal) 100%);
  color: var(--highlight-yellow);
  min-height: 100vh;
}

h2 {
  font-weight: 700;
  color: var(--highlight-yellow);
  text-align: center;
  font-size: 2.5rem;
  margin: 0 0 2rem 0;
  text-shadow: 2px 2px 4px rgba(36,72,85,0.8);
  letter-spacing: 1px;
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--accent-orange);
  border-radius: 2px;
}

h3 {
  font-weight: 600;
  color: var(--highlight-yellow);
  text-shadow: 1px 1px 2px rgba(36,72,85,0.6);
}

.container {
  max-width: none;
  margin: 0 auto;
  padding: 2rem;
  min-height: 80vh;
  background: none;
}

#map-drawer-wrapper {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 400px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(36,72,85,0.18);
  border-radius: 16px;
  background: var(--primary-blue);
  margin-bottom: 3.5rem;
  border: 2px solid var(--accent-orange);
}

#map-container {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border-radius: 16px;
  overflow: hidden;
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1), transform 0.4s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
#map-drawer-wrapper.sidebar-open #map-container {
  width: calc(100% - 340px);
}

#map {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border-radius: 16px;
  overflow: hidden;
}

/* Custom Google Maps Controls Styling */
.gm-style .gm-style-cc {
  display: none; /* Hide Google logo/copyright for cleaner look */
}

.gm-style-mtc {
  background: rgba(1, 25, 54, 0.9) !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  border: 1px solid var(--accent-orange) !important;
}

.gm-style-mtc button {
  background: rgba(1, 25, 54, 0.9) !important;
  color: var(--highlight-yellow) !important;
  border: none !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
}

.gm-style-mtc button:hover {
  background: var(--accent-orange) !important;
  color: var(--primary-blue) !important;
}

/* Zoom controls */
.gm-bundled-control {
  background: rgba(1, 25, 54, 0.9) !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  border: 1px solid var(--accent-orange) !important;
}

.gm-bundled-control button {
  background: rgba(1, 25, 54, 0.9) !important;
  color: var(--highlight-yellow) !important;
  border: none !important;
}

.gm-bundled-control button:hover {
  background: var(--accent-orange) !important;
  color: var(--primary-blue) !important;
}

/* Override Google Maps InfoWindow styling */
.gm-style .gm-style-iw {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.gm-style .gm-style-iw-c {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  max-width: none !important;
}

.gm-style .gm-style-iw-d {
  overflow: visible !important;
}

.gm-style .gm-style-iw-t::after {
  display: none !important;
}

.gm-style .gm-style-iw-tc::after {
  display: none !important;
}

#form-overlay {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 340px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-brown) 100%);
  padding: 1.5rem 1.25rem 1.25rem 1.5rem;
  border-radius: 0 16px 16px 0;
  box-shadow: none;
  max-width: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  transform: translateX(0);
  min-height: 0;
  padding-top: 1rem;
  z-index: 10;
  border-left: 2px solid var(--accent-orange);
}
#form-overlay.closed {
  transform: translateX(100%);
  pointer-events: none;
}
#form-overlay.open {
  transform: translateX(0);
  pointer-events: auto;
}
#openDrawerBtn {
  position: absolute;
  top: 32px;
  right: 32px;
  z-index: 11;
  background: var(--accent-orange);
  color: var(--highlight-yellow);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
#form-overlay.closed ~ #openDrawerBtn {
  display: flex;
}
#closeDrawerBtn {
  background: none;
  border: none;
  color: var(--highlight-yellow);
  font-size: 1.5rem;
  cursor: pointer;
  margin: 0;
  padding: 0 0.25em;
  line-height: 1;
  transition: color 0.2s;
}
#closeDrawerBtn:hover {
  color: var(--accent-orange);
}

.drawer-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding-top: 0;
  border-bottom: 1px solid var(--muted-teal);
}
.drawer-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--highlight-yellow);
}

/* Form */
#form-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  overflow-y: auto;
}

label {
  font-weight: 600;
  margin-top: 0.5rem;
  color: var(--highlight-yellow);
}

select, input {
  padding: 0.5rem;
  border: 1.5px solid var(--muted-teal);
  border-radius: 4px;
  font-size: 1rem;
  background: var(--primary-blue);
  color: var(--highlight-yellow);
}
select:focus, input:focus {
  border-color: var(--accent-orange);
  outline: none;
  box-shadow: 0 0 0 2px rgba(230,72,51,0.2);
}

#customAntennaFields {
  display: none;
}



button, #calculateBtn {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  border: none;
  background: var(--accent-orange);
  color: var(--highlight-yellow);
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(36,72,85,0.04);
}

#calculateBtn {
  margin: 1rem auto 3rem auto;
  padding: 0.8rem 2rem;
  width: 80%;
  max-width: 200px;
  font-size: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(36,72,85,0.15);
}
button:hover, #calculateBtn:hover {
  background: var(--primary-blue);
  color: var(--highlight-yellow);
  box-shadow: 0 4px 12px rgba(36,72,85,0.2);
}

/* Results */
.section {
  margin-top: 2.5rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-brown) 100%);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
  border: 2px solid var(--accent-orange);
}

#output p {
  margin: 0.5rem 0;
  color: var(--highlight-yellow);
}

/* Charts */
.chart-container,
#fresnelChart,
#rssiChart {
  display: block;
  width: 100%;
  max-width: 1390px;
  height: 400px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
  margin: 0 auto 1.5rem auto;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-brown) 100%);
  border-radius: 8px;
  border: 2px solid var(--accent-orange);
  padding: 1rem;
}

.charts-visible .chart-container,
.charts-visible #fresnelChart,
.charts-visible #rssiChart {
  opacity: 1;
  pointer-events: auto;
}

/* Ensure Plotly containers are properly sized */
js-plotly-plot {
  width: 100% !important;
}

.mapboxgl-popup-content {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  border: none !important;
}
.mapboxgl-popup-tip {
  display: none !important;
}

/* Marker labels */
.marker-label {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: bold;
  color: var(--highlight-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
  background: var(--accent-orange);
  cursor: grab;
  user-select: none;
}

::-webkit-scrollbar-thumb {
  background: var(--muted-teal);
}
::-webkit-scrollbar-track {
  background: var(--primary-blue);
}

/* Charts wrapper */
.charts-wrapper {
  position: relative;
  width: 100%;
}

/* Fresnel zone note */
.fresnel-note {
  background: linear-gradient(135deg, rgba(1, 25, 54, 0.95) 0%, rgba(30, 58, 138, 0.95) 100%);
  border: 2px solid var(--accent-orange);
  border-radius: 8px;
  padding: 0;
  margin-bottom: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.fresnel-note-content {
  padding: 12px;
  text-align: left;
}

.fresnel-note-content p {
  margin: 0;
  color: var(--highlight-yellow);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

/* Coordinate input section */
.coordinate-section {
  margin: 0 0 0.2rem 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}

.coordinate-section label {
  font-size: 14px;
  color: var(--highlight-yellow);
  font-weight: 500;
  margin-bottom: 0.2rem;
  display: block;
}

.coordinate-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.coordinate-group input {
  padding: 0.4rem 0.6rem;
  font-size: 14px;
  background: rgba(1, 25, 54, 0.8);
  border: 1px solid var(--accent-orange);
  border-radius: 4px;
  color: var(--highlight-yellow);
  width: 100%;
  box-sizing: border-box;
}

.coordinate-group input:focus {
  outline: none;
  border-color: var(--highlight-yellow);
  box-shadow: 0 0 0 2px rgba(249, 220, 92, 0.2);
}

#setCoordinatesBtn {
  width: 100%;
  padding: 0.6rem 1.2rem;
  background: var(--accent-orange);
  color: var(--highlight-yellow);
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(36,72,85,0.04);
}

#setCoordinatesBtn:hover {
  background: var(--primary-blue);
  color: var(--highlight-yellow);
  box-shadow: 0 4px 12px rgba(36,72,85,0.2);
}

/* Radio selection styling */
#radioSelection {
  margin-bottom: 1rem;
}

#radioSelection > label {
  font-size: 14px;
  color: var(--highlight-yellow);
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
}

.radio-toggle-container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.radio-toggle {
  position: relative;
  flex: 1;
  min-width: 80px;
}

.radio-toggle input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-toggle label {
  display: block;
  padding: 0.5rem 0.8rem;
  background: rgba(1, 25, 54, 0.8);
  border: 2px solid var(--accent-orange);
  border-radius: 6px;
  color: var(--highlight-yellow);
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.radio-toggle input[type="radio"]:checked + label {
  background: var(--accent-orange);
  color: var(--highlight-yellow);
  box-shadow: 0 2px 8px rgba(249, 220, 92, 0.3);
  transform: translateY(-1px);
}

.radio-toggle label:hover {
  background: rgba(249, 220, 92, 0.1);
  border-color: var(--highlight-yellow);
}

.radio-toggle input[type="radio"]:checked + label:hover {
  background: var(--primary-blue);
  border-color: var(--highlight-yellow);
}

@media (max-width: 600px) {
  .coordinate-group {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* Building controls */
.building-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  padding: 16px;
  background: linear-gradient(135deg, #F9DC5C 0%, #FDE68A 100%);
  border: 2px solid #011936;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(1, 25, 54, 0.15);
}

.get-buildings-btn {
  background: linear-gradient(135deg, #011936 0%, #1E3A8A 100%);
  color: #F9DC5C;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(1, 25, 54, 0.3);
}

.get-buildings-btn:hover {
  background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(1, 25, 54, 0.4);
}

.get-buildings-btn:active {
  transform: translateY(0);
}

.get-buildings-btn:disabled {
  background: #6B7280;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.building-info {
  color: #011936;
  font-size: 14px;
  font-weight: 500;
}

/* Chart container wrapper for positioning loading overlay */
.chart-container-wrapper {
  position: relative;
  display: block;
}

/* Loading overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(1, 25, 54, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: 12px;
}

.loading-content {
  text-align: center;
  color: #F9DC5C;
  padding: 32px;
  background: rgba(1, 25, 54, 0.95);
  border-radius: 16px;
  border: 2px solid #F9DC5C;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  min-width: 300px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(249, 220, 92, 0.3);
  border-top: 4px solid #F9DC5C;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.loading-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(249, 220, 92, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #F9DC5C 0%, #FDE68A 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 14px;
  font-weight: 600;
  min-width: 40px;
}



/* 
   pop up form
 */
.modal {
    
    display: none;
    position: absolute;
    top: 0px;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    justify-content: center;
    align-items: flex-start;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}


.modal-box {
    background: rgba(255,255,255,0.12);
   
    padding: 20px 30px;       
    width: 380px;            
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    backdrop-filter: blur(6px);
    animation: popIn 0.3s ease;
    position: relative;
    height: auto;       
    margin: auto;      
    
}


.close-btn {
    position: absolute;
    right: 12px;
    top: 10px;
    font-size: 26px;
    cursor: pointer;
    color: #ffd248;
}


.modal-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #ffd248;
    margin-bottom: 20px;
}


.modal-box label {
    font-weight: 600;
    font-size: 14px;
    color: #ffd248;
}


.modal-box input {
    width: 95%;
    padding: 10px;
    margin: 8px 0 16px 0;
    border-radius: 6px;
    border: none;
    font-size: 16px;
    outline: none;
}


.modal-submit-btn {
    width: 100%;
    padding: 12px;
    background: #ff3c57;
    color: white;
    font-size: 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 5px;
}

.modal-submit-btn:hover {
    background: #e1324a;
}

/* ================================
   ANIMATIONS
================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}


 @media (max-width: 768px) {
    .modal-box {
        width: 65%;         
        height: auto;       
        max-height: 80vh;   
        padding: 15px 20px;
         margin: 0 auto;      
    }
}


@media (max-width: 450px) {
    .modal-box {
        width: 85%;
        height: 470px;  
        padding: 10px 7px;
         margin: 0 auto; 
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-box input {
        padding: 6px;
        font-size: 14px;
    }

    .modal-submit-btn {
        padding: 8px;
        font-size: 14px;
    }
}
