:root {
  --bg-primary: #f5f5f5;
  --bg-secondary: white;
  --text-primary: #333;
  --text-secondary: #555;
  --text-tertiary: #888;
  --border-color: #ddd;
  --shadow: rgba(0, 0, 0, 0.1);
  --input-bg: #fff;
  --slider-bg: #f0f0f0;
  --detail-bg: #f8f9fa;
  --accent-primary: #06b6d4;
  --accent-secondary: #8b5cf6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    --border-color: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --input-bg: #3a3a3a;
    --slider-bg: #404040;
    --detail-bg: #252525;
    --accent-primary: #06b6d4;
    --accent-secondary: #8b5cf6;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.container {
  padding: 0 30px;
}

h1 {
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 10px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: var(--text-secondary);
}

select, input {
  width: 100%;
  padding: 10px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 16px;
  box-sizing: border-box;
  background-color: var(--input-bg);
  color: var(--text-primary);
}

select:focus, input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.slider {
  flex: 1;
}

.slider-value {
  background: var(--slider-bg);
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: 600;
  min-width: 50px;
  text-align: center;
  color: var(--text-primary);
}

.distance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.distance-header label {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.distance-header:has(sl-range) {
  gap: 15px;
}

.distance-header:has(sl-range) label {
  flex-shrink: 0;
}

.distance-header sl-range {
  flex: 1;
}

#distancePresetButtons {
  flex-shrink: 0;
}

.result-container {
  display: flex;
  gap: 20px;
  align-items: stretch;
  flex: 1;
}

.result-number {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  min-width: 210px;
  min-height: 150px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: bold;
  flex-shrink: 0;
}

.result-details {
  flex: 1;
  background: var(--detail-bg);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-label {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 90px;
}

.detail-item span:last-child {
  color: var(--text-primary);
}

.selected-club-image {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.club-level-item {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-primary);
}

.extra-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  min-width: 80px;
}

.extra-result-item {
  background: var(--detail-bg);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.extra-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.extra-value {
  font-size: 20px;
  font-weight: bold;
  color: var(--accent-primary);
}

@media (max-width: 600px) {
  .result-container {
    flex-direction: column;
  }

  .result-number {
    min-width: 100%;
    min-height: 120px;
  }

  .extra-results {
    flex-direction: row;
    min-width: 100%;
    justify-content: space-around;
  }

  .extra-result-item {
    flex: 1;
  }
}

.wind-input {
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
}

.controls-container {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}

.wind-input-section {
  display: flex;
  flex-direction: column;
  min-width: 150px;
  flex: 0 0 auto;
}

.settings-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.wind-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
}

.wind-input-large {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 48px;
  font-weight: bold;
  text-align: center;
  padding: 20px 20px 60px 20px;
  flex: 1;
  min-height: 150px;
  width: 100%;
  position: relative;
}

/* Hide native spinners */
.wind-input-large::-webkit-inner-spin-button,
.wind-input-large::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.wind-input-large[type=number] {
  -moz-appearance: textfield;
}

/* Custom wind controls at bottom */
.wind-controls {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 1;
}

.wind-control-btn {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}

.wind-control-btn:hover {
  background: rgba(255, 255, 255, 0.5);
}

.wind-control-btn:active {
  background: rgba(255, 255, 255, 0.6);
}

.wind-speed-label {
  position: absolute;
  top: 10px;
  left: 10px;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1;
  margin-bottom: 0;
}

.clear-wind-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.3);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
  z-index: 1;
}

.clear-wind-button:hover {
  background: rgba(255, 255, 255, 0.5);
}

.clear-wind-button:active {
  background: rgba(255, 255, 255, 0.6);
}

.wind-input-large:focus {
  outline: 3px solid #10b981;
  background: linear-gradient(135deg, #059669, #10b981);
}

.wind-input-large::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 600px) {
  .controls-container {
    flex-direction: column;
  }

  .wind-input-section {
    min-width: 100%;
  }
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Shoelace customizations */
sl-tab-group::part(base) {
  margin-bottom: 20px;
}

sl-tab-panel::part(base) {
  padding: 15px 0;
}

sl-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

sl-button-group sl-button::part(base) {
  flex: 1;
  min-width: 50px;
  padding: 8px 0;
}

sl-button[variant="primary"]::part(base) {
  background-color: var(--accent-primary);
}

sl-button::part(label) {
  color: inherit;
}

.club-image {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

/* Useful Links section */
.useful-links-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--border-color);
}

.useful-links-section h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 20px;
  text-align: center;
}

.links-container {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.resource-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--detail-bg);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  min-width: 200px;
}

.resource-link:hover {
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow);
}

.link-icon {
  font-size: 24px;
}

.link-text {
  font-weight: 600;
  font-size: 16px;
}

@media (max-width: 600px) {
  .resource-link {
    min-width: 100%;
  }
}

/* Feedback section */
.feedback-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid var(--border-color);
  text-align: center;
}

.feedback-form-container {
  width: 100%;
}

.feedback-form-container iframe {
  width: 100%;
  border: none;
  border-radius: 8px;
}

sl-dialog::part(panel) {
  max-width: 680px;
}

sl-dialog::part(body) {
  padding: 0;
}

/* Elevation dropdown menu styling */
.elevation-dropdown {
  flex: 1;
  min-width: 60px;
}

.elevation-dropdown::part(trigger) {
  width: 100%;
}

.elevation-menu-button::part(base) {
  flex: 1;
  min-width: 60px;
  padding: 8px;
}

.elevation-menu-button[variant="primary"]::part(base) {
  background-color: var(--accent-primary);
}

/* PowerBall dropdown menu styling */
.powerball-dropdown {
  flex: 1;
  min-width: 60px;
}

.powerball-dropdown::part(trigger) {
  width: 100%;
}

.powerball-menu-button::part(base) {
  flex: 1;
  min-width: 60px;
  padding: 8px;
}

.powerball-menu-button[variant="primary"]::part(base) {
  background-color: var(--accent-primary);
}

/* Menu styling to match theme */
sl-menu {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 8px var(--shadow);
}

sl-menu-item::part(base) {
  color: var(--text-primary);
}

sl-menu-item::part(base):hover {
  background-color: var(--slider-bg);
}

sl-menu-item[aria-selected="true"]::part(base) {
  background-color: var(--accent-primary);
  color: white;
}
