/* Modern Dark Theme for Tee Time Finder */
:root { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  
  /* Primary Colors */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: rgba(59, 130, 246, 0.1);
  --primary-glow: rgba(59, 130, 246, 0.3);
  --accent: #06b6d4;
  --accent-hover: #0891b2;
  
  /* Dark Background Colors */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --surface: #1e293b;
  --surface-elevated: #334155;
  --surface-hover: #475569;
  
  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  /* Border & Effects */
  --border: #334155;
  --border-hover: #475569;
  --border-focus: var(--primary);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --glow: 0 0 20px var(--primary-glow);
}

* {
  box-sizing: border-box;
}

body { 
  margin: 0;
  padding: clamp(8px, 2vw, 20px);
  max-width: 1400px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  background: var(--surface);
  border-radius: clamp(12px, 3vw, 20px);
  padding: clamp(12px, 4vw, 32px);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  width: 100%;
  box-sizing: border-box;
}

h1 { 
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 800;
  margin: 0 0 clamp(16px, 4vw, 32px);
  color: var(--text-primary);
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px var(--primary-glow);
}

.main-content {
  margin-bottom: 24px;
}

.section {
  background: var(--surface-elevated);
  border-radius: clamp(12px, 2vw, 16px);
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  margin-bottom: clamp(16px, 3vw, 24px);
  width: 100%;
  box-sizing: border-box;
}

.section:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.section h3 {
  margin: 0 0 clamp(12px, 3vw, 20px);
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section h3::before {
  content: '';
  width: 4px;
  height: clamp(16px, 4vw, 20px);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 2px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(16px, 4vw, 32px);
  align-items: start;
  width: 100%;
}

@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    justify-items: stretch;
  }
  
  .form-row {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  label {
    min-width: auto;
  }
  
  .container {
    padding: 16px;
    border-radius: 12px;
  }
  
  h1 {
    font-size: 1.8rem;
    margin: 0 0 20px;
  }
  
  input[type="date"], input[type="time"], select {
    min-width: auto;
    width: 100%;
    margin-bottom: 8px;
  }
  
  input[type="time"] {
    min-width: 120px;
    width: auto;
  }
  
  button {
    padding: 12px 16px;
    font-size: 14px;
    min-width: 80px;
  }
  
  .chips {
    justify-content: center;
  }
  
  .courses {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 8px;
  }
  
  .container {
    padding: 12px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .section {
    padding: 16px;
  }
  
  .form-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .form-row label {
    text-align: center;
    margin-bottom: 4px;
  }
  
  input[type="time"] {
    min-width: auto;
    width: 100%;
  }
  
  .courses {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  
  button {
    width: 100%;
    margin-bottom: 8px;
  }
  
  .course {
    padding: 12px;
    font-size: 0.9rem;
  }
}

.form-group {
  margin-bottom: clamp(12px, 3vw, 16px);
  width: 100%;
}

.form-row { 
  display: flex;
  gap: clamp(6px, 2vw, 12px);
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: clamp(8px, 2vw, 12px);
  justify-content: center;
}

label { 
  font-weight: 600;
  color: var(--text-secondary);
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  white-space: nowrap;
  flex-shrink: 0;
}

input[type="date"], input[type="time"], select { 
  padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 16px);
  font-size: clamp(12px, 3vw, 14px);
  border: 2px solid var(--border);
  border-radius: clamp(8px, 2vw, 12px);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: all 0.3s ease;
  flex-shrink: 0;
  min-width: 0;
}

input[type="time"] {
  width: clamp(100px, 20vw, 120px);
}

input[type="date"] {
  width: clamp(140px, 30vw, 180px);
}

select {
  width: clamp(70px, 15vw, 100px);
}

input[type="date"]:focus, input[type="time"]:focus, select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light), var(--glow);
  transform: translateY(-1px);
}

input[type="date"]:hover, input[type="time"]:hover, select:hover {
  border-color: var(--border-hover);
}

button { 
  padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 20px);
  border: 2px solid var(--primary);
  color: white;
  background: var(--primary);
  border-radius: clamp(8px, 2vw, 12px);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: clamp(12px, 3vw, 14px);
  position: relative;
  overflow: hidden;
  min-width: fit-content;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

button:hover::before {
  left: 100%;
}

button.secondary { 
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

button:hover { 
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow), var(--glow);
}

button.secondary:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-2px);
}

.chips { 
  display: flex;
  gap: clamp(6px, 2vw, 8px);
  flex-wrap: wrap;
  margin-top: clamp(8px, 2vw, 12px);
  justify-content: center;
}

.chip { 
  background: var(--primary-light);
  color: var(--primary);
  border-radius: clamp(16px, 4vw, 20px);
  padding: clamp(6px, 1.5vw, 8px) clamp(12px, 3vw, 16px);
  cursor: pointer;
  font-size: clamp(11px, 2.5vw, 13px);
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid var(--primary);
}

.chip:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow);
}

.courses-section {
  grid-column: 1 / -1;
}

.courses { 
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(120px, 25vw, 200px), 1fr));
  gap: clamp(8px, 2vw, 12px);
  margin-top: clamp(12px, 3vw, 16px);
}

.course { 
  padding: clamp(12px, 3vw, 16px) clamp(16px, 4vw, 20px);
  border: 2px solid var(--border);
  border-radius: clamp(8px, 2vw, 12px);
  cursor: pointer;
  user-select: none;
  text-transform: capitalize;
  transition: all 0.3s ease;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  text-align: center;
  position: relative;
  overflow: hidden;
  font-size: clamp(0.8rem, 2.5vw, 1rem);
}

.course::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.course:hover::before {
  transform: scaleX(1);
}

.course:hover { 
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  background: var(--surface-hover);
}

.course.selected { 
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow), var(--glow);
}

.course.selected::before {
  background: rgba(255, 255, 255, 0.3);
  transform: scaleX(1);
}

#run { 
  margin-top: clamp(20px, 5vw, 32px);
  padding: clamp(12px, 3vw, 16px) clamp(24px, 6vw, 32px);
  font-size: clamp(14px, 4vw, 18px);
  background: linear-gradient(135deg, var(--accent), var(--primary));
  border: none;
  width: 100%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#run:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--primary-hover));
  transform: translateY(-3px);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 40vw, 320px), 1fr));
  gap: clamp(16px, 4vw, 20px);
  margin-top: clamp(20px, 5vw, 24px);
}

.course-result {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: clamp(12px, 3vw, 16px);
  padding: clamp(16px, 4vw, 24px);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.course-result:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

.course-result h4 {
  margin: 0 0 clamp(12px, 3vw, 16px);
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  color: var(--primary);
  font-weight: 700;
  border-bottom: 2px solid var(--border);
  padding-bottom: clamp(8px, 2vw, 12px);
  position: relative;
}

.course-result h4::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: clamp(30px, 10vw, 50px);
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.time-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(6px, 1.5vw, 8px) clamp(8px, 2vw, 12px);
  margin: clamp(6px, 1.5vw, 8px) 0;
  background: var(--bg-secondary);
  border-radius: clamp(8px, 2vw, 10px);
  border-left: clamp(3px, 1vw, 4px) solid var(--accent);
  transition: all 0.3s ease;
}

.time-slot:hover {
  background: var(--surface-hover);
  transform: translateX(clamp(2px, 1vw, 4px));
  box-shadow: var(--shadow);
}

.time-slot .time {
  font-weight: 700;
  color: var(--text-primary);
  font-size: clamp(0.9rem, 3vw, 1.1rem);
}

.time-slot .slots {
  color: var(--text-muted);
  font-size: clamp(0.8rem, 2.5vw, 0.9rem);
  background: var(--primary-light);
  padding: clamp(3px, 1vw, 4px) clamp(6px, 1.5vw, 8px);
  border-radius: clamp(4px, 1vw, 6px);
  font-weight: 600;
}

.no-results {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 32px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 2px dashed var(--border);
}

#output-container {
  margin-top: 32px;
}

.muted { 
  color: var(--text-muted);
}

.loading {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 48px;
  font-size: 1.1rem;
  background: var(--surface-elevated);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.loading::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 12px;
  vertical-align: middle;
}

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

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

.muted {
  color: var(--text-muted);
  font-size: clamp(0.75rem, 2vw, 0.85rem);
}

.time-filter-note {
  font-size: clamp(0.7rem, 1.8vw, 0.8rem);
  margin-top: clamp(3px, 1vw, 4px);
}

.selected-dates-label {
  font-size: clamp(0.7rem, 1.8vw, 0.8rem);
}

.course-controls {
  margin-bottom: clamp(12px, 3vw, 16px);
}

/* Focus indicators for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
