/**
 * School Finder US - Styles
 */

/* Tool Layout */
.tool-header {
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid #dee2e6;
}

.tool-header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  color: #212529;
}

.hero-intent {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: #495057;
}

.intent-lock {
  margin: 0;
  font-size: 0.9rem;
  color: #6c757d;
}

.tool-container {
  display: flex;
  min-height: calc(100vh - 200px);
}

.tool-sidebar {
  width: 380px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #dee2e6;
  overflow-y: auto;
}

.sidebar-content {
  padding: 1rem;
}

.map-container {
  flex: 1;
  position: relative;
  min-height: 500px;
}

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

/* FAB */
.fab {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  font-size: 1.25rem;
  cursor: pointer;
  display: none;
}

/* Sections */
.tool-section {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.tool-section h2 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: #212529;
}

/* Inputs */
label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #495057;
}

input[type="text"],
select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #ced4da;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  box-sizing: border-box;
}

input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: #007bff;
  color: #fff;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-success {
  background: #28a745;
  color: #fff;
}

.btn-success:hover {
  background: #1e7e34;
}

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

.btn-secondary:hover {
  background: #545b62;
}

.btn-icon {
  font-size: 1.1rem;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 1rem 0;
  color: #6c757d;
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #dee2e6;
}

.divider span {
  padding: 0 0.75rem;
}

/* Results Summary */
.results-summary {
  display: flex;
  gap: 0.5rem;
  text-align: center;
}

.summary-stat {
  flex: 1;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 6px;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #212529;
}

.stat-label {
  font-size: 0.75rem;
  color: #6c757d;
}

/* Results List */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

/* School Card */
.school-card {
  padding: 0.75rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.school-card:hover {
  background: #e9ecef;
  border-color: #dee2e6;
}

.school-card.selected {
  background: #e7f1ff;
  border-color: #007bff;
}

.school-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.school-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #212529;
  line-height: 1.3;
}

.school-distance-badge {
  flex-shrink: 0;
  padding: 0.125rem 0.5rem;
  background: #007bff;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 12px;
}

.school-card-subheader {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 0.25rem;
}

.school-district {
  font-size: 0.8rem;
  color: #495057;
  margin-bottom: 0.5rem;
}

/* Score badges in cards */
.school-scores {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.score-badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 4px;
  background: #e9ecef;
  color: #495057;
}

.score-badge.ela {
  background: #d4edda;
  color: #155724;
}

.score-badge.math {
  background: #cce5ff;
  color: #004085;
}

/* School badges (general) */
.school-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
  background: #e9ecef;
  color: #495057;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

/* Loading */
.loading-indicator {
  text-align: center;
  padding: 2rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e9ecef;
  border-top-color: #007bff;
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

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

/* Data note */
.data-note {
  font-size: 0.75rem;
  color: #6c757d;
  margin: 0;
}

.data-note a {
  color: #007bff;
}

/* Popup styles */
.school-popup h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: #212529;
}

.school-popup-meta {
  margin-bottom: 0.5rem;
}

.school-popup-details {
  font-size: 0.85rem;
  color: #495057;
  margin-bottom: 0.75rem;
}

.school-popup-details p {
  margin: 0 0 0.25rem 0;
}

.school-popup-performance {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.perf-title {
  font-weight: 600;
  font-size: 0.8rem;
  color: #495057;
  margin-bottom: 0.5rem;
}

.perf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.perf-stat {
  text-align: center;
}

.perf-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #212529;
}

.perf-label {
  display: block;
  font-size: 0.7rem;
  color: #6c757d;
}

.perf-above {
  display: block;
  font-size: 0.7rem;
  color: #28a745;
  font-weight: 500;
}

.perf-below {
  display: block;
  font-size: 0.7rem;
  color: #dc3545;
  font-weight: 500;
}

.school-popup-links {
  font-size: 0.8rem;
  padding-top: 0.5rem;
  border-top: 1px solid #dee2e6;
}

.school-popup-links a {
  color: #007bff;
  text-decoration: none;
}

.school-popup-links a:hover {
  text-decoration: underline;
}

/* SEO Content */
.seo-content {
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  padding: 2rem 1rem;
}

.seo-inner {
  max-width: 800px;
  margin: 0 auto;
}

.content-section {
  margin-bottom: 2rem;
}

.content-section h2 {
  font-size: 1.25rem;
  color: #212529;
  margin: 0 0 0.75rem 0;
}

.content-section p {
  color: #495057;
  line-height: 1.6;
  margin: 0 0 0.75rem 0;
}

.content-section ul {
  color: #495057;
  line-height: 1.8;
  padding-left: 1.5rem;
}

.content-section a {
  color: #007bff;
}

/* Responsive */
@media (max-width: 900px) {
  .tool-container {
    flex-direction: column;
  }
  
  .tool-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #dee2e6;
  }
  
  .map-container {
    height: 60vh;
    min-height: 400px;
  }
  
  .fab {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .results-list {
    max-height: 250px;
  }
}

@media (max-width: 480px) {
  .tool-header h1 {
    font-size: 1.5rem;
  }
  
  .hero-intent {
    font-size: 1rem;
  }
  
  .results-summary {
    flex-wrap: wrap;
  }
  
  .summary-stat {
    min-width: calc(50% - 0.25rem);
  }
}
