/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #5c78f7 0%, #768ef8 100%);
  min-height: 100vh;
}

/* Header */
.top-bar {
  background: rgb(70, 150, 243);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 10px 20px;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  align-items: center;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: auto;
}

/* Header */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  padding: 0.8rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
}

.header-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.header-title i {
  color: #667eea;
  margin-right: 0.5rem;
}

.header-subtitle {
  font-size: 1.1rem;
  color: #7f8c8d;
  font-weight: 300;
}

/* Main Content */
.main-content {
  flex: 1 1 auto;
  display: flex;
  min-height: calc(100vh - 140px);
  gap: 1rem;
  padding: 1.5rem;
  max-width: 4000px;
  margin: 0 auto;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 350px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  max-height: calc(100vh - 160px);
}

.sidebar-content {
  padding: 1.5rem;
}

.control-section,
.info-section,
.navigation-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e9ecef;
}

.control-section:last-child,
.navigation-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title i {
  color: #667eea;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.form-select {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
  transition: all 0.3s ease;
}

.form-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-help {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  width: 100%;
  margin-bottom: 0.5rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #5a6268;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: #667eea;
  border: 2px solid #667eea;
}

.btn-outline:hover:not(:disabled) {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

.btn-nav {
  width: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  background: #f8f9fa;
  color: #495057;
  border: 1px solid #dee2e6;
}

.btn-nav:hover:not(:disabled) {
  background: #e9ecef;
}

/* Info Section */
.info-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 6px;
}

.stat-label {
  font-weight: 500;
  color: #495057;
}

.stat-value {
  font-weight: 700;
  color: #667eea;
}

/* Navigation Controls */
.nav-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.marker-position {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
}

/* Map Container */
.map-container {
  flex: 1;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.map {
  width: 100%;
  height: 100%;
  min-height: 500px;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.loading-spinner {
  text-align: center;
  color: #667eea;
}

.loading-spinner i {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.loading-spinner p {
  font-weight: 600;
}

.hidden {
  display: none !important;
}

/* Map Legend */
.map-legend {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: white;
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  min-width: 150px;
  z-index: 1001;
}

.legend-title {
  font-size: 20px;
  font-weight: 800;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 16px;
  color: #495057;
}

.legend-marker {
  width: 12px;
  height: 12px;
  background: #667eea;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


/* Make legend items start with title case */
.legend-item span {
  text-transform: none;
}

.legend-item span::first-letter {
  text-transform: uppercase;
}

/* Footer */
.footer {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  text-align: center;
  border-top: 1px solid #e9ecef;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer p {
  color: #6c757d;
  font-size: 0.9rem;
}

/* Custom Popup Styles */
.leaflet-popup-content {
  margin: 1rem;
  line-height: 1.5;
}

.leaflet-popup-content h4 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.leaflet-popup-content p {
  margin-bottom: 0.5rem;
}

.leaflet-popup-content strong {
  color: #495057;
}

.leaflet-popup-content em {
  color: #6c757d;
}

.leaflet-popup-content img {
  border-radius: 6px;
  margin: 0.5rem 0;
}

.leaflet-popup-content audio {
  width: 100%;
  margin: 0.5rem 0;
}

.leaflet-popup-content button {
  background: #667eea;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  margin: 0.2rem;
  font-size: 0.8rem;
}

.leaflet-popup-content button:hover {
  background: #5a67d8;
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
    padding: 0.5rem;
  }
  
  .sidebar {
    width: 100%;
    max-height: none;
    margin-bottom: 1rem;
  }
  
  .header-title {
    font-size: 2rem;
  }
  
  .header-subtitle {
    font-size: 1rem;
  }
  
  .map {
    min-height: 400px;
  }
  
  .map-legend {
    bottom: 10px;
    right: 10px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0 1rem;
  }
  
  .sidebar-content {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
  
  .nav-controls {
    flex-wrap: wrap;
    gap: 0.3rem;
  }
}

/* Fix Leaflet basemap control in the top-right corner of the map */
.leaflet-control-layers {
  position: absolute !important;
  top: 20px;
  right: 20px;
  z-index: 1100; /* higher than legend and map */
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.leaflet-control-layers-list{
  width: 110px;
}














/* Refresh data button */

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.action-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.refresh-button {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border: none;
    border-radius: 50px;
    padding: 18px 36px;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 200px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(76, 175, 80, 0.4);
}

.refresh-button:active {
    transform: translateY(-1px);
}

.refresh-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.button-text {
    transition: opacity 0.3s ease;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

.refresh-button.loading .button-text {
    opacity: 0.7;
}

.refresh-button.loading .spinner {
    display: inline-block;
}

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


/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    
    .refresh-button {
        padding: 15px 30px;
        font-size: 1.1rem;
        min-width: 180px;
    }
}







/* Top menu items*/
.homepage .frame {
  position: relative;
  width: 80px;
  height: 80px;
  border: 1px solid;
  border-color: #000000;
  background-image: url(./img/images.jpg);
  background-size: cover;
  background-position: 50% 50%;
}

.homepage .frame-2 {
  display: inline-flex;
  align-items: center;
  gap: 42px;
  position: relative;
  flex: 0 0 auto;
}

.homepage .menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background-color: #ffffff;
  box-shadow: 0px 4px 8px #00000040;
  width: 100%;
  position: relative;
  top: 0;
  left: 0;
  z-index: 100;
}

.homepage .frame {
  width: 60px;
  height: 60px;
  border: 1px solid #000;
  background-image: url(./img/images.jpg);
  background-size: cover;
  background-position: 50% 50%;
  border-radius: 8px;
  flex-shrink: 0;
}

.homepage .div-wrapper-3,
.homepage .div-wrapper-4,
.homepage .div-wrapper,
.homepage .div-wrapper-2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 5px;
  background: none;
  border: none;
  box-shadow: none;
  height: auto;
  min-width: 0;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.homepage .div-wrapper {
  border: 2px solid #56bfe5;
  box-shadow: 0px 4px 4px #56bfe540;
}

.homepage .div-wrapper-2 {
  background-color: #56bfe5;
  box-shadow: 0px 4px 4px #56bfe540;
}

.homepage .avatar {
  width: 48px;
  height: 48px;
  background-color: #daa6d1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 32px;
  flex-shrink: 0;
}


.homepage .text-wrapper-7,
.homepage .text-wrapper-3,
.homepage .text-wrapper-2,
.homepage .text-wrapper-8 {
  font-family: "Inter-Medium", Helvetica, Arial, sans-serif;
  font-weight: 500;
  color: #000;
  font-size: 22px;
  letter-spacing: 0;
  line-height: normal;
  position: static;
  margin: 0;
  padding: 0;
}

.homepage .text-wrapper-8 {
  font-size: 22px;
  color: #fff;
  font-weight: 700;
}

@media (max-width: 900px) {
  .homepage .menu {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }
  .homepage .frame-2 {
    margin-left: 0;
    gap: 12px;
    flex-wrap: wrap;
  }
  .homepage .avatar {
    margin-left: 0;
    align-self: flex-end;
  }
}

/* Highlight on hover */
.homepage .div-wrapper-3:hover,
.homepage .div-wrapper-4:hover,
.homepage .div-wrapper:hover,
.homepage .div-wrapper-2:hover {
  background: #56bfe5;
  color: #fff;
  box-shadow: 0 2px 8px #56bfe540;
}

.homepage .div-wrapper-3:hover .text-wrapper-7,
.homepage .div-wrapper-4:hover .text-wrapper-3,
.homepage .div-wrapper:hover .text-wrapper-2,
.homepage .div-wrapper-2:hover .text-wrapper-3 {
  color: #fff;
}

/* Highlight when active (clicked/tabbed) */
.homepage .div-wrapper-3.active,
.homepage .div-wrapper-4.active,
.homepage .div-wrapper.active,
.homepage .div-wrapper-2.active {
  background: #56bfe5;
  color: #fff;
  box-shadow: 0 2px 8px #56bfe540;
}

.homepage .div-wrapper-3.active .text-wrapper-7,
.homepage .div-wrapper-4.active .text-wrapper-3,
.homepage .div-wrapper.active .text-wrapper-2,
.homepage .div-wrapper-2.active .text-wrapper-3 {
  color: #fff;
}

.homepage .frame {
  position: relative;
  width: 80px;
  height: 80px;
  border: 1px solid;
  border-color: #000000;
  background-image: url(./img/images.jpg);
  background-size: cover;
  background-position: 50% 50%;
}

.homepage .frame-2 {
  display: inline-flex;
  align-items: center;
  gap: 42px;
  position: relative;
  flex: 0 0 auto;
}