/* ==========================================================================
   Map Radius Tool - Tool-Specific Styles
   Only styles unique to this tool
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tool Container Layout
   -------------------------------------------------------------------------- */
.tool-container {
  display: flex;
  min-height: 800px; /* Large minimum height for good map visibility */
  background-color: var(--bg);
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.tool-sidebar {
  width: 380px;
  background-color: var(--card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.sidebar-content {
  padding: 20px;
}

.sidebar-content label {
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.tool-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tool-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.tool-section h3 {
  font-size: 15px;
  margin-bottom: 16px;
  color: var(--text);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Search Suggestions
   -------------------------------------------------------------------------- */
.suggestions {
  position: relative;
  background-color: var(--card);
  border: 1px solid var(--border);
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  display: none;
  box-shadow: var(--shadow);
}

.suggestions.show {
  display: block;
}

.suggestions .item {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  transition: background-color 0.2s ease;
}

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

.suggestions .item:hover {
  background-color: var(--hover-bg);
}

/* --------------------------------------------------------------------------
   Unit Toggle
   -------------------------------------------------------------------------- */
.unit-toggle {
  display: flex;
  gap: 0;
  margin: 12px 0;
  background-color: var(--hover-bg);
  border-radius: var(--radius-lg);
  padding: 4px;
}

.unit-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.unit-btn.active {
  background-color: var(--primary);
  color: white;
}

/* --------------------------------------------------------------------------
   Radius Display
   -------------------------------------------------------------------------- */
.radius-display {
  text-align: center;
  padding: 20px;
  margin: 16px 0;
  background-color: var(--glass);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

.radius-display span:first-child {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
}

.radius-display span:last-child {
  font-size: 16px;
  color: var(--text-muted);
  margin-left: 8px;
}

/* --------------------------------------------------------------------------
   Tool Info Box
   -------------------------------------------------------------------------- */
.tool-info {
  background-color: var(--glass);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin: 12px 0;
  border: 1px solid var(--border);
}

.tool-item {
  font-size: 13px;
  color: var(--text);
  padding: 6px 0;
}

/* --------------------------------------------------------------------------
   Button Groups
   -------------------------------------------------------------------------- */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   File Upload
   -------------------------------------------------------------------------- */
.file-upload-label {
  display: block;
  cursor: pointer;
  margin-bottom: 12px;
}

.file-upload-label input[type="file"] {
  display: none;
}

.file-upload-btn {
  display: block;
  padding: 14px;
  background-color: white;
  border: 2px dashed var(--primary);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

html[data-theme="dark"] .file-upload-btn {
  background-color: rgba(255, 255, 255, 0.03);
}

.file-upload-btn:hover {
  background-color: rgba(37, 99, 235, 0.05);
}

/* --------------------------------------------------------------------------
   Map Container
   -------------------------------------------------------------------------- */
.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 800px; /* Much larger map */
}

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

/* Force Leaflet container to exact size - prevent it from being larger */
#map .leaflet-container {
  width: 100% !important;
  height: 100% !important;
}

/* --------------------------------------------------------------------------
   Leaflet Controls - Let Leaflet handle positioning
   -------------------------------------------------------------------------- */
.coordinates-control {
  background: var(--glass) !important;
  backdrop-filter: blur(12px);
  padding: 8px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-family: monospace;
  color: var(--text-muted);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Mobile FAB (Floating Action Button)
   -------------------------------------------------------------------------- */
.fab {
  display: none; /* Hidden by default on desktop */
  width: 56px;
  height: 56px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 9999;
}

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .tool-container {
    flex-direction: column;
    height: calc(100vh - 250px);
  }

  .tool-sidebar {
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    transition: max-height 0.3s ease;
  }

  .tool-sidebar.collapsed {
    max-height: 0;
    overflow: hidden;
  }

  .map-container {
    flex: 1;
  }

  .fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 600px) {
  .sidebar-content {
    padding: 16px;
  }

  .tool-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
  }

  .radius-display span:first-child {
    font-size: 28px;
  }

  .radius-display span:last-child {
    font-size: 14px;
  }

  .map-container {
    min-height: 400px;
  }
}