@import "../../../node_modules/fullcalendar/skeleton.css";
@import "../../../node_modules/fullcalendar/themes/classic/theme.css";
@import "../../../node_modules/fullcalendar/themes/classic/palette.css";
@import "./theme.css";
@import "./landing.css";
@import "tailwindcss";
@plugin "flowbite/plugin";
@source "../../../node_modules/flowbite";

@theme {
  --font-sans: var(--theme-font-sans);
  --color-002-sand: var(--theme-surface-soft);
  --color-002-clay: var(--theme-brand-primary);
  --color-002-charcoal: var(--theme-text-dark);
  --color-002-olive: var(--theme-brand-secondary);
  --color-002-cream: var(--theme-surface-light);
}

@layer base {
  html {
    font-family: var(--theme-font-sans);
  }

  body {
    background: var(--theme-page-bg);
  }
}

@layer components {
  .page-shell {
    color: var(--theme-text-primary);
  }

  .page-section {
    max-width: var(--theme-container-max);
    margin-inline: auto;
    padding-inline: var(--theme-space-container-x);
    padding-block: var(--theme-space-section-y);
  }

  @media (min-width: 64rem) {
    .page-section {
      padding-block: var(--theme-space-section-y-lg);
    }
  }

  .section-heading {
    font-family: var(--theme-font-display);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--theme-text-primary);
  }

  .section-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.9rem;
    border-radius: 9999px;
    border: 1px solid var(--theme-border-brand);
    background: color-mix(in srgb, var(--theme-surface-dark) 88%, transparent);
    color: var(--theme-text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04);
  }

  .theme-card {
    border-radius: var(--theme-radius-xl);
    padding: var(--theme-space-card);
  }

  .theme-card-tight {
    border-radius: var(--theme-radius-lg);
    padding: var(--theme-space-card-tight);
  }

  .hero-glow {
    background: var(--theme-hero-glow);
  }

  .theme-nav {
    background: color-mix(in srgb, var(--theme-bg-bottom) 80%, transparent);
    border-color: var(--theme-border-light);
  }

  .theme-nav-link {
    color: var(--theme-text-secondary);
  }

  .theme-nav-link:hover {
    color: var(--theme-text-primary);
    background: var(--theme-surface-overlay);
  }

  .theme-badge {
    border: 1px solid var(--theme-border-brand);
    background: color-mix(in srgb, var(--theme-brand-primary) 10%, transparent);
    color: var(--theme-text-primary);
  }

  .theme-btn-primary {
    background: var(--theme-brand-primary);
    color: var(--theme-text-dark);
    transition: background var(--theme-transition-fast), color var(--theme-transition-fast), transform var(--theme-transition-fast);
  }

  .theme-btn-primary:hover {
    background: var(--theme-brand-primary-strong);
  }

  .theme-btn-secondary {
    border: 1px solid var(--theme-border-soft);
    color: var(--theme-text-primary);
    transition: background var(--theme-transition-fast), color var(--theme-transition-fast), border-color var(--theme-transition-fast);
  }

  .theme-btn-secondary:hover {
    background: var(--theme-surface-overlay);
  }

  .theme-btn-light {
    background: var(--theme-surface-soft);
    color: var(--theme-text-dark);
    transition: background var(--theme-transition-fast), color var(--theme-transition-fast);
  }

  .theme-btn-light:hover {
    background: #fff;
  }

  .theme-form-label {
    color: var(--theme-text-dark);
  }

  .theme-form-input,
  .theme-form-select,
  .theme-form-choice {
    border: 1px solid var(--theme-border-light-panel);
    background: color-mix(in srgb, var(--theme-surface-light) 92%, transparent);
    color: var(--theme-text-dark);
    box-shadow:
      0 1px 2px rgb(15 23 42 / 0.06),
      inset 0 1px 0 rgb(255 255 255 / 0.22);
    transition: border-color var(--theme-transition-fast), box-shadow var(--theme-transition-fast), background var(--theme-transition-fast);
  }

  .theme-form-input::placeholder,
  .theme-form-select::placeholder {
    color: var(--theme-text-dark-muted);
    opacity: 0.85;
  }

  .theme-form-input:focus,
  .theme-form-select:focus,
  .theme-form-choice:focus-within {
    border-color: var(--theme-border-brand);
    outline: none;
    box-shadow:
      0 0 0 3px color-mix(in srgb, var(--theme-brand-primary) 18%, transparent),
      0 1px 2px rgb(15 23 42 / 0.08);
  }

  .swal2-popup select.booking-calendar-dialog-select.swal2-input {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-right: 3rem !important;
  }

  .theme-form-note {
    color: var(--theme-text-dark-muted);
  }

  .session-form--helpers-hidden .theme-form-note {
    display: none;
  }

  .theme-inline-link {
    color: var(--theme-text-dark);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--theme-brand-primary) 45%, transparent);
    text-underline-offset: 0.18em;
  }

  .theme-inline-link:hover {
    color: var(--theme-brand-primary-strong);
  }

  .theme-inline-separator {
    color: color-mix(in srgb, var(--theme-text-dark-muted) 72%, transparent);
  }

  .theme-subtle-panel {
    border: 1px solid var(--theme-border-light-panel);
    background: color-mix(in srgb, var(--theme-surface-soft) 65%, transparent);
  }

  .theme-menu-dropdown[open] {
    z-index: 80;
  }

  .theme-menu-dropdown-panel {
    z-index: 81;
    pointer-events: auto;
  }

  .theme-floating-panel {
    border: 1px solid color-mix(in srgb, var(--theme-text-dark) 8%, transparent);
    background: color-mix(in srgb, var(--theme-surface-light) 55%, transparent);
    box-shadow:
      0 10px 24px rgb(15 23 42 / 0.08),
      inset 0 1px 0 rgb(255 255 255 / 0.3);
  }

  .theme-picker-button {
    border: 1px solid color-mix(in srgb, var(--theme-text-dark) 10%, transparent);
    background: color-mix(in srgb, var(--theme-surface-light) 72%, transparent);
    color: var(--theme-text-dark);
    transition: background var(--theme-transition-fast), border-color var(--theme-transition-fast), color var(--theme-transition-fast), transform var(--theme-transition-fast);
  }

  .theme-picker-button:hover {
    background: color-mix(in srgb, var(--theme-surface-light) 88%, transparent);
    border-color: var(--theme-border-brand);
  }

  .theme-table {
    color: var(--theme-text-dark);
  }

  .theme-table thead tr {
    color: var(--theme-text-dark-muted);
  }

  .theme-table tbody tr {
    color: var(--theme-text-dark);
  }

  .theme-table tbody tr + tr,
  .theme-table thead {
    border-color: color-mix(in srgb, var(--theme-text-dark) 12%, transparent);
  }

  .theme-avatar-frame {
    background: color-mix(in srgb, var(--theme-surface-soft) 70%, transparent);
    color: var(--theme-text-dark-muted);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--theme-text-dark) 10%, transparent);
  }

  .theme-secondary-action {
    border: 1px solid var(--theme-border-light-panel);
    background: color-mix(in srgb, var(--theme-surface-light) 82%, transparent);
    color: var(--theme-text-dark-muted);
    transition: border-color var(--theme-transition-fast), color var(--theme-transition-fast), background var(--theme-transition-fast);
  }

  .theme-secondary-action:hover {
    border-color: var(--theme-border-brand);
    color: var(--theme-text-dark);
    background: color-mix(in srgb, var(--theme-surface-light) 92%, transparent);
  }

  .theme-dark-chip {
    background: color-mix(in srgb, var(--theme-surface-light) 8%, transparent);
    color: var(--theme-text-secondary);
  }

  .theme-dark-list {
    border: 1px solid color-mix(in srgb, var(--theme-text-primary) 10%, transparent);
  }

  .theme-dark-list > * + * {
    border-top: 1px solid color-mix(in srgb, var(--theme-text-primary) 10%, transparent);
  }

  .theme-control {
    border: 1px solid var(--theme-border-light-panel);
    background: color-mix(in srgb, var(--theme-surface-light) 92%, transparent);
    color: var(--theme-text-dark);
    accent-color: var(--theme-brand-primary);
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  }

  .theme-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-brand-primary) 18%, transparent);
  }

  .theme-text-primary {
    color: var(--theme-text-primary);
  }

  .theme-text-secondary {
    color: var(--theme-text-secondary);
  }

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

  .theme-text-dark {
    color: var(--theme-text-dark);
  }

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

  .theme-text-brand-soft {
    color: var(--theme-brand-soft);
  }

  .theme-border {
    border-color: var(--theme-border-light);
  }

  .theme-swatch {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--theme-brand-primary), var(--theme-brand-secondary));
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.18);
  }

  .grain-panel {
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--theme-surface-light) 96%, transparent), color-mix(in srgb, var(--theme-surface-soft) 92%, transparent)),
      radial-gradient(circle at 20% 20%, rgb(255 255 255 / 0.35), transparent 24%);
    color: var(--theme-text-dark);
    border-color: var(--theme-border-light-panel);
    box-shadow:
      var(--theme-shadow-light),
      inset 0 1px 0 rgb(255 255 255 / 0.4);
  }

  .dark-panel {
    background:
      linear-gradient(180deg, var(--theme-surface-dark-strong), var(--theme-surface-dark)),
      radial-gradient(circle at top, color-mix(in srgb, var(--theme-brand-primary) 18%, transparent), transparent 40%);
    border-color: var(--theme-border-light);
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.05),
      var(--theme-shadow-dark);
  }

  .accent-panel {
    background: color-mix(in srgb, var(--theme-brand-primary) 10%, transparent);
    border-color: var(--theme-border-brand);
  }

  .brand-panel {
    background: var(--theme-brand-primary);
    color: var(--theme-text-dark);
  }

  .secondary-panel {
    background: var(--theme-brand-secondary);
    color: var(--theme-text-primary);
  }

  .dark-solid-panel {
    background: color-mix(in srgb, var(--theme-bg-mid) 88%, transparent);
    border-color: var(--theme-border-light);
  }

  .ts-hidden-accessible {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .ts-wrapper {
    width: 100%;
  }

  .ts-wrapper.single .ts-control,
  .ts-wrapper.multi .ts-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    border: 1px solid var(--theme-border-light-panel);
    background: color-mix(in srgb, var(--theme-surface-light) 92%, transparent);
    color: var(--theme-text-dark);
    border-radius: 0.5rem;
    min-height: 3.25rem;
    padding: 0.75rem 1rem;
    box-shadow:
      0 1px 2px rgb(15 23 42 / 0.06),
      inset 0 1px 0 rgb(255 255 255 / 0.22);
  }

  .ts-wrapper.focus .ts-control {
    border-color: var(--theme-border-brand);
    box-shadow:
      0 0 0 3px color-mix(in srgb, var(--theme-brand-primary) 18%, transparent),
      0 1px 2px rgb(15 23 42 / 0.08);
  }

  .ts-wrapper .ts-control > input {
    flex: 1 1 auto;
    width: 100% !important;
    min-width: 12rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--theme-text-dark);
    box-shadow: none;
    outline: none;
  }

  .ts-wrapper .ts-control > input::placeholder {
    color: var(--theme-text-dark-muted);
    opacity: 0.85;
  }

  .ts-dropdown {
    border: 1px solid var(--theme-border-light-panel);
    background: color-mix(in srgb, var(--theme-surface-light) 98%, transparent);
    border-radius: 0.75rem;
    color: var(--theme-text-dark);
    box-shadow: 0 10px 24px rgb(15 23 42 / 0.12);
    overflow: hidden;
  }

  .ts-dropdown .option,
  .ts-dropdown .create {
    padding: 0.7rem 1rem;
  }

  .ts-dropdown .option.active {
    background: color-mix(in srgb, var(--theme-brand-primary) 16%, white);
    color: var(--theme-text-dark);
  }
}

/* External tournament listings use the same form with booking controls omitted. */
[data-controller~="session-form"][data-external-tournament="true"] [data-session-form-internal],
[data-controller~="session-form"]:not([data-external-tournament="true"]) [data-session-form-external] {
  display: none !important;
}
