/* ==========================================================================
   Route Optimiser Tool - Tool-Specific Styles
   Matching map-radius layout
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tool Container Layout
   -------------------------------------------------------------------------- */
.tool-container {
  display: flex;
  max-height: 700px;
  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 {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
  margin-top: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.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;
}

/* --------------------------------------------------------------------------
   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;
}

/* --------------------------------------------------------------------------
   Results Box
   -------------------------------------------------------------------------- */
.results-box {
  background-color: var(--glass);
  border-radius: var(--radius-lg);
  padding: 14px;
  border: 1px solid var(--border);
  min-height: 60px;
  font-size: 13px;
  line-height: 1.6;
}

.results-box:empty::before {
  content: "Results will appear here...";
  color: var(--text-muted);
  font-style: italic;
}

.results-box strong {
  color: var(--primary);
}

.results-box ol {
  margin: 8px 0;
  padding-left: 20px;
}

.results-box li {
  padding: 4px 0;
}

/* --------------------------------------------------------------------------
   Map Container
   -------------------------------------------------------------------------- */
.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 500px;
  max-height: 700px;
}

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

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

/* --------------------------------------------------------------------------
   Mobile FAB (Floating Action Button)
   -------------------------------------------------------------------------- */
.fab {
  display: none;
  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;
    max-height: none;
    height: auto;
  }

  .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: none;
    height: 500px;
    min-height: 400px;
    max-height: 500px;
  }

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

  .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;
  }

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

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

/* --------------------------------------------------------------------------
   Postcode Suggestions Dropdown
   -------------------------------------------------------------------------- */
.input-with-suggestions {
  position: relative;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.suggestions.show {
  display: block;
}

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

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

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

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