/* DiscGolfAPI Course Finder Configurator
 * Main stylesheet for the interactive configurator interface
 */

:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-muted: #eef4f8;
  --text: #334155;
  --heading: #0f172a;
  --border: #d8e3ec;
  --primary: #1e73be;
}

* {
  box-sizing: border-box;
}

header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
  margin-bottom: 40px;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 16px;
}

header h1 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(24px, 5vw, 32px);
  font-weight: 700;
  line-height: 1.2;
}

header p {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 16px;
}

.intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 40px;
}

.intro h2 {
  margin-top: 0;
  color: var(--heading);
  font-size: 20px;
  font-weight: 700;
}

.intro ul {
  margin: 16px 0;
  padding-left: 20px;
}

.intro li {
  margin: 10px 0;
  color: var(--text);
}

.intro strong {
  color: var(--heading);
  font-weight: 600;
}

.intro a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.intro a:hover {
  text-decoration: underline;
}

.intro p {
  margin: 14px 0;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.feature {
  background: var(--surface-muted);
  padding: 14px;
  border-radius: 6px;
  border-left: 3px solid var(--primary);
}

.feature strong {
  display: block;
  color: var(--heading);
  margin-bottom: 4px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feature span {
  font-size: 13px;
  color: var(--text);
}

main {
  margin-bottom: 60px;
}

.configurator-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 80px;
  text-align: center;
  font-size: 13px;
  color: var(--text);
}

.configurator-footer p {
  margin: 8px 0;
}

.configurator-footer a {
  color: var(--primary);
  text-decoration: none;
}

.configurator-footer a:hover {
  text-decoration: underline;
}

.attribution {
  font-weight: 600;
  margin: 16px 0;
}

/* Configurator Panel Styles */

.cfg-header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
}

.cfg-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: contain;
}

.cfg-kicker {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.cfg-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.cfg-panel,
.cfg-output {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.cfg-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.cfg-row {
  display: grid;
  gap: 6px;
}

.cfg-section {
  display: grid;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.cfg-section:first-child {
  padding-top: 0;
  border-top: none;
}

.cfg-section-title {
  margin: 0;
  color: var(--heading);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.8;
}

.cfg-section-divider {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.6;
}

.cfg-checks {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.cfg-row label,
.cfg-checks label {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--heading);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: color 0.2s ease;
}

.cfg-checks label:hover {
  color: var(--primary);
}

.cfg-optional,
.cfg-required {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.cfg-help {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.cfg-help code {
  background: var(--surface-muted);
  padding: 2px 5px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
}

.cfg-help a {
  color: var(--primary);
  font-weight: 500;
  text-underline-offset: 2px;
}

.cfg-help a:hover {
  text-decoration: underline;
}

/* Tooltip */

.cfg-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--primary);
  border-radius: 50%;
  background: rgba(30, 115, 190, 0.08);
  color: var(--primary);
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: help;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cfg-tip:hover,
.cfg-tip:focus-visible {
  background: rgba(30, 115, 190, 0.12);
  border-color: #1560a8;
}

.cfg-tip::after {
  content: attr(aria-label);
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(100% + 8px);
  width: min(260px, 72vw);
  padding: 9px 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 7px;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.cfg-tip:hover::after,
.cfg-tip:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Form Inputs */

select,
input[type="text"],
input[type="number"],
input[type="color"],
input[type="search"],
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input[type="text"]:hover,
input[type="number"]:hover,
input[type="color"]:hover,
input[type="search"]:hover,
select:hover,
textarea:hover {
  border-color: #b3b8c3;
  background: #fafbfc;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="color"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 115, 190, 0.15);
  background: #fff;
}

input[type="text"],
input[type="number"],
input[type="search"],
select {
  padding: 10px 12px;
  background: #fafbfc;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

input[type="text"]:hover,
input[type="number"]:hover,
input[type="search"]:hover,
select:hover {
  background: #fff;
}

/* Enhanced input fields */

#cfg-country,
#cfg-region,
#cfg-locality,
#cfg-badges-url {
  padding: 12px 14px;
  border: 1.5px solid #d1d5db;
  background: linear-gradient(to bottom, #ffffff, #fafbfc);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

#cfg-country:hover,
#cfg-region:hover,
#cfg-locality:hover,
#cfg-badges-url:hover {
  border-color: #a0aec0;
  background: linear-gradient(to bottom, #ffffff, #ffffff);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

#cfg-country:focus,
#cfg-region:focus,
#cfg-locality:focus,
#cfg-badges-url:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 115, 190, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

input[type="checkbox"] {
  width: auto;
  min-height: auto;
  cursor: pointer;
}

/* Colour Picker */

.cfg-colour-input {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cfg-colour-input input[type="text"] {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.cfg-colour-input input[type="color"] {
  width: 50px;
  height: 42px;
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.15s ease;
}

.cfg-colour-input input[type="color"]:hover {
  border-color: #b3b8c3;
}

.cfg-colour-input input[type="color"]:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 115, 190, 0.15);
}

/* Text Area */

textarea {
  min-height: 560px;
  padding: 14px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
}

/* Output Panel */

.cfg-output {
  overflow: hidden;
}

.cfg-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.cfg-output-title {
  color: var(--heading);
  font-weight: 800;
}

.cfg-copy {
  min-height: 34px;
  padding: 7px 12px;
  border: none;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(30, 115, 190, 0.2);
}

.cfg-copy:hover {
  background: #1560a8;
  box-shadow: 0 4px 12px rgba(30, 115, 190, 0.3);
  transform: translateY(-1px);
}

.cfg-copy:active {
  transform: translateY(0);
}

/* Tabs */

.cfg-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.cfg-tab-btn {
  min-height: 44px;
  padding: 0 16px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
  border-bottom: 3px solid transparent;
  position: relative;
  bottom: -1px;
}

.cfg-tab-btn:hover {
  background: rgba(30, 115, 190, 0.08);
  color: var(--heading);
}

.cfg-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.cfg-tab-content {
  display: none;
}

.cfg-tab-content.active {
  display: block;
}

.cfg-output textarea {
  border: 0;
  border-radius: 0;
}

/* Preview */

.cfg-preview {
  overflow: hidden;
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.cfg-preview-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.cfg-preview-title {
  color: var(--heading);
  font-weight: 800;
}

.cfg-preview-note {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.cfg-preview-frame {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
  background: #fff;
}

/* Responsive Design */

@media (max-width: 768px) {
  header h1 {
    font-size: 24px;
  }

  .intro {
    padding: 20px;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .cfg-layout {
    grid-template-columns: 1fr;
  }

  .cfg-preview-frame {
    height: 760px;
  }
}
