:root {
  --primary: #3d5a80;
  --primary-light: #98c1d9;
  --secondary: #ee6c4d;
  --secondary-light: #f8a08e;
  --dark: #293241;
  --light: #e0fbfc;
  --gray: #6c757d;
  --gray-light: #e9ecef;
  --success: #2a9d8f;
  --warning: #e9c46a;
  --danger: #e76f51;
  --radius: 8px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--light);
  overflow-x: hidden;
}

/* Layout */
.app-container {
  display: grid;
  height: 100vh;
  height: 100dvh;
  grid-template-columns: 350px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "header header"
    "sidebar map";
}

.header {
  grid-area: header;
  background-color: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  box-shadow: var(--shadow);
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-title svg {
  width: 60px;
  height: 45px;
  margin-right: 0.5rem;
  color: var(--light);
}

.sidebar {
  position: relative;
  grid-area: sidebar;
  background-color: white;
  box-shadow: var(--shadow);
  z-index: 5;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--gray-light);
}

.sidebar-header {
  padding: 1rem;
  background-color: var(--primary-light);
  color: var(--dark);
}

.stats-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background-color: white;
  border-bottom: 1px solid var(--gray-light);
}

.stat-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-radius: var(--radius);
  background-color: var(--gray-light);
}

.stat-title {
  font-size: 0.875rem;
  color: var(--gray);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
}

.progress-container {
  margin-top: 0.5rem;
}

.progress-bar {
  height: 6px;
  background-color: var(--light);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--success);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.map-list-container {
  background-color: white;
  overflow-y: auto;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  transition: height 0.3s ease;
}

#map-list-items {
  list-style: none;
}

.track-item {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-light);
  cursor: pointer;
  transition: var(--transition);
}

.track-item:hover {
  background-color: var(--gray-light);
}

.track-item.active {
  background-color: var(--primary-light);
  border-left: 4px solid var(--primary);
}

.track-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.track-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--gray);
}

.track-meta span {
  margin-right: 0.5rem;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  transition: color 0.2s ease;
  margin-left: auto;
}

.download-btn:hover {
  color: var(--primary);
}

.map-container {
  grid-area: map;
  position: relative;
  z-index: 1;
}

#map {
  width: 100%;
  height: 100%;
}

.map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 10px;
  z-index: 99;
}

.map-controls .button {
  position: relative;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: white;
  color: var(--dark);
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.button-primary {
  background-color: var(--primary);
  color: white;
}

.button-secondary {
  background-color: var(--secondary);
  color: white;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--gray-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spinner 1s linear infinite;
}

.loading-text {
  margin-top: 1rem;
  font-weight: 600;
}

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

/* Responsive styles */
@media (max-width: 768px) {
  .app-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "header"
      "sidebar"
      "map";
    overflow: hidden;
  }
  
  .header {
    padding: 0.75rem 0.5rem;
  }

  .sidebar {
    position: relative;
    z-index: 2;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--gray-light);
    transition: height 0.3s ease;
  }

  .sidebar.mobile-show {
    height: calc(100dvh - 64px);
  }

  .map-container {
    height: 100%;
  }

  body {
    overflow: hidden;
  }

  .map-list-container {
    top: auto;
    position: absolute;
    z-index: 1;
  }
  
  #mobile-toggle-sidebar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    background-color: white;
    color: var(--dark);
    border-radius: 4px;
  }

  #mobile-toggle-sidebar svg {
    color: var(--dark);
  }

  /* Make stat cards more compact */
  .stats-container {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .stat-card {
    flex-wrap: wrap;
    padding: 0.5rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  
  .stat-card > div {
    margin-right: 0.5rem;
  }
  
  .stat-title {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
  }
  
  .stat-value {
    font-size: 1rem;
    text-align: right;
  }
  
  .progress-container {
    margin-top: 0.25rem;
    width: 100%;
  }

  .sidebar.mobile-show .map-list-container {
    overflow-y: auto;
  }

  .header-title svg {
    width: 54px;
    height: 40px;
  }
}

@media (min-width: 769px) {
  #mobile-toggle-sidebar {
    display: none;
  }
}

/* Add styles for the layers dropdown menu */
.layers-dropdown {
  position: absolute;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: 12px;
  margin-top: 50px;
  right: 0;
  z-index: 100;
  min-width: 200px;
}

.layers-dropdown-item {
  padding: 8px 0;
}

.layers-dropdown-item label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.layers-dropdown-item input {
  margin-right: 8px;
}

.mobile-toggle-icon {
  position: relative;
  width: 24px;
  height: 24px;
}

.mobile-toggle-icon line {
  transition: all 0.3s ease;
  transform-origin: center;
}

.mobile-menu-open .mobile-toggle-icon line:first-child {
  transform: rotate(45deg) translate(0, 4px);
}

.mobile-menu-open .mobile-toggle-icon line:last-child {
  transform: rotate(-45deg) translate(0, -4px);
} 