/* Coaches UI alignment with the shared SwimMENA form and action system. */
.coaches-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 28px 32px 36px;
}

.coach-profile-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 28px 32px 60px;
}

.coaches-directory-hero {
  max-width: none;
}

.coaches-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.coaches-results-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 10px;
}

.coach-button {
  min-height: var(--btn-min-height);
  border: 1px solid var(--btn-secondary-border);
  border-radius: var(--btn-radius);
  padding: var(--btn-padding-y) var(--btn-padding-x);
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  font-weight: var(--btn-font-weight);
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.coach-button:hover {
  border-color: var(--btn-secondary-hover-border);
  background: var(--btn-secondary-hover-bg);
  color: var(--btn-secondary-text);
  transform: none;
}

.coach-button--primary {
  border-color: var(--btn-primary-border);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

.coach-button--primary:hover {
  border-color: var(--btn-primary-hover-border);
  background: var(--btn-primary-hover-bg);
  color: var(--btn-primary-text);
}

.coach-join-card,
.coach-card,
.coach-empty,
.coach-section,
.coach-editor-section,
.coach-editor-status,
.coach-editor-locked {
  border: var(--border-surface);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow);
}

.coach-card {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
}

.coach-card--clickable {
  color: var(--coach-ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.coach-card--clickable:hover {
  border-color: var(--accent);
  color: var(--coach-ink);
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(20, 52, 74, 0.13);
}

.coach-card--clickable:focus-visible {
  outline: 3px solid rgba(65, 166, 198, 0.3);
  outline-offset: 3px;
}

.coach-card-view {
  width: 100%;
  margin-top: auto;
  pointer-events: none;
}

.coach-card-photo {
  position: relative;
  display: grid;
  flex: 0 0 230px;
  width: 100%;
  height: 230px;
  min-height: 230px;
  max-height: 230px;
  overflow: hidden;
}

.coach-card-photo > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.coach-card-photo .coach-badge {
  z-index: 1;
}

.coach-card-body {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
}

.coach-card-actions {
  margin-top: auto;
  padding-top: 18px;
}

.coach-join-card {
  min-height: 112px;
  padding: 22px 24px;
}

.coach-join-card .coach-button {
  flex: 0 0 auto;
  min-width: 154px;
}

.coach-filters {
  grid-template-columns: minmax(280px, 1.6fr) minmax(170px, 0.75fr) minmax(190px, 0.85fr) minmax(110px, auto) !important;
  gap: 10px !important;
  align-items: stretch !important;
  margin-bottom: 18px !important;
  padding: 14px !important;
  border: var(--border-surface) !important;
  border-radius: var(--radius-surface) !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow) !important;
}

.coach-filters > label,
.coach-filters > .swimmers-filter-submit,
.coach-filters .site-filter-sheet-body > label,
.coach-filters .site-filter-sheet-body > .swimmers-filter-submit {
  display: grid !important;
  grid-template-rows: 1.125rem var(--btn-min-height) 15px !important;
  gap: 7px !important;
  align-content: start;
  align-items: stretch;
  margin: 0;
}

.coach-filters label > span:first-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.125rem;
}

.coach-filters input[type="search"],
.coach-filters input[type="text"] {
  width: 100%;
  height: var(--btn-min-height);
  min-height: var(--btn-min-height);
  margin: 0;
  border: var(--border-surface);
  border-radius: var(--radius-inner);
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.coach-filters .swimmer-search-field input[type="search"] {
  width: auto;
  height: calc(var(--btn-min-height) - 2px);
  min-height: calc(var(--btn-min-height) - 2px);
  border: 0;
  border-radius: 0;
  padding: 9px 8px 9px 0;
  background: transparent;
  box-shadow: none;
}

.coach-filters input:focus,
.coach-editor-form input:focus,
.coach-editor-form textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(65, 166, 198, 0.16);
  outline-offset: 1px;
}

.coach-filters .coach-check {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: 1.125rem var(--btn-min-height) 15px !important;
  gap: 7px !important;
}

.coach-check-control {
  display: flex;
  align-items: center;
  gap: 9px;
  height: var(--btn-min-height);
  padding: 0 12px;
  border: var(--border-surface);
  border-radius: var(--radius-inner);
  background: var(--surface-muted);
}

.coach-check-control input,
.coach-toggle input {
  flex: 0 0 auto;
  width: 18px !important;
  height: 18px !important;
  min-height: 0 !important;
  margin: 0;
  accent-color: var(--accent);
}

.coach-check-control span {
  color: var(--text) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 1.2 !important;
}

.coach-filters .swimmers-filter-submit button {
  width: 100%;
  height: var(--btn-min-height);
  min-height: var(--btn-min-height);
  margin: 0;
  border: 1px solid var(--btn-primary-border);
  border-radius: var(--btn-radius);
  padding: 0 16px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: var(--btn-font-weight);
  cursor: pointer;
}

.coach-filters .swimmers-filter-submit button:hover {
  border-color: var(--btn-primary-hover-border);
  background: var(--btn-primary-hover-bg);
}

.coach-card-actions,
.coach-contact-actions {
  align-items: center;
}

.coach-card-actions .coach-button {
  flex: 1 1 120px;
}

.coach-editor-heading {
  align-items: center;
}

.coach-editor-form {
  gap: 14px;
}

.coach-editor-section {
  padding: 22px 24px;
}

.coach-editor-form label {
  gap: 7px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.coach-editor-form input:not([type="checkbox"]),
.coach-editor-form select {
  width: 100%;
  height: var(--btn-min-height);
  min-height: var(--btn-min-height);
  border: var(--border-surface);
  border-radius: var(--radius-inner);
  padding: 0 13px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.coach-editor-form textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border: var(--border-surface);
  border-radius: var(--radius-inner);
  padding: 11px 13px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
}

.coach-form-grid {
  gap: 14px 16px;
  align-items: start;
}

.coach-toggle {
  display: flex !important;
  min-height: var(--btn-min-height);
  align-items: center;
  gap: 9px !important;
  padding: 10px 12px;
  border: var(--border-surface);
  border-radius: var(--radius-inner);
  background: var(--surface-muted);
}

.coach-editor-item {
  border: var(--border-surface);
  border-radius: var(--radius-inner);
  background: var(--surface-muted);
}

.coach-remove {
  min-height: 36px;
  border: 1px solid var(--error-border);
  border-radius: var(--btn-radius);
  padding: 7px 12px;
  background: var(--error-bg);
  color: var(--error);
}

.coach-save-bar {
  align-items: center;
  min-height: 70px;
  border: var(--border-surface);
  border-radius: var(--radius-surface);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.97);
}

.coach-save-bar .coach-button {
  min-width: 172px;
}

@media (max-width: 960px) {
  .coach-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .coach-filters > .swimmers-filter-submit {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .coaches-page {
    padding: 16px 16px 24px;
  }

  .coach-profile-page {
    padding: 16px 16px 32px;
  }

  .coaches-results-head,
  .coach-join-card,
  .coach-editor-heading,
  .coach-section-title,
  .coach-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .coaches-results-actions,
  .coaches-results-actions .coach-button {
    width: 100%;
  }

  .coach-card-photo {
    flex-basis: 210px;
    height: 210px;
    min-height: 210px;
    max-height: 210px;
  }

  .coach-join-card .coach-button,
  .coach-editor-heading .coach-button,
  .coach-save-bar .coach-button {
    width: 100%;
  }

  .coach-filters {
    grid-template-columns: 1fr !important;
  }

  .coach-filters > label,
  .coach-filters > .swimmers-filter-submit {
    grid-template-rows: 1.125rem var(--btn-min-height) !important;
    grid-column: auto;
  }

  .coach-filters .swimmers-filter-spacer {
    display: none;
  }

  .coach-card-actions .coach-button,
  .coach-contact-actions .coach-button {
    flex-basis: 100%;
  }

  .coach-editor-section {
    padding: 18px 16px;
  }

  .coach-save-bar {
    flex-direction: column;
  }
}
.account-tab-panel--coach .coach-editor-page--embedded {
  max-width: none;
  padding: 0 0 48px;
}

.account-tab-panel--coach .coach-editor-heading {
  padding: 24px 28px;
  border: 1px solid var(--coach-line);
  border-radius: 20px;
  background: linear-gradient(135deg, #f2fdfe, #f7f5ff);
}

/* Keep coach directory and detail views behaviorally aligned with swimmers. */
.coach-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.coach-directory-card {
  height: auto;
  min-height: 172px;
}

.coach-directory-card:hover {
  border-color: var(--accent);
}

.coach-directory-card .swimmer-avatar {
  align-self: start;
}

.coach-directory-card .swimmer-card-body > p {
  min-height: 35px;
  margin-bottom: 10px;
}

.coach-directory-card dl {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.coach-directory-card dd {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.coach-directory-status {
  background: #fff7df;
  color: #745500;
}

.coach-directory-status.is-verified {
  background: var(--success-soft-bg);
  color: var(--success);
}

.coach-profile-back {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.coach-profile-back:hover {
  color: var(--accent-strong);
}

.coach-analytics-topbar {
  align-items: center;
}

.coach-analytics-headline {
  margin: 5px 0 0 !important;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.coach-unclaimed-badge {
  background: #fff4cf;
  color: #745500;
}

.coach-topbar-action {
  flex: 0 0 auto;
  min-width: 150px;
}

.coach-kpi-grid article {
  min-width: 0;
}

.coach-kpi-grid small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coach-profile-notice,
.coach-profile-surface {
  border: var(--border-surface);
  border-radius: var(--radius-surface);
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.coach-profile-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-color: rgba(220, 174, 63, 0.42);
  background: linear-gradient(135deg, #fffdf6, #fff8e8);
}

.coach-profile-notice h2,
.coach-profile-notice p {
  margin: 0;
}

.coach-profile-notice .eyebrow {
  margin-bottom: 4px;
}

.coach-profile-notice h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

.coach-profile-notice > .badge {
  flex: 0 0 auto;
}

.coach-profile-content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.coach-profile-surface {
  min-width: 0;
}

.coach-profile-surface > .section-title {
  margin-bottom: 14px;
}

.coach-profile-surface > p {
  color: var(--text);
  line-height: 1.7;
}

.coach-profile-wide {
  width: 100%;
}

.coach-profile-source {
  border-left: 4px solid var(--accent);
}

.coach-profile-contact {
  border-color: rgba(65, 166, 198, 0.4);
  background: linear-gradient(135deg, var(--surface), var(--accent-soft-bg));
}

.coach-profile-surface .coach-timeline,
.coach-profile-surface .coach-qualification-grid {
  margin-top: 0;
}

.coach-profile-surface .coach-timeline article,
.coach-profile-surface .coach-qualification-grid article {
  background: var(--surface-muted);
}

@media (max-width: 960px) {
  .coach-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coach-analytics-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .coach-topbar-action {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .coach-grid,
  .coach-profile-content-grid {
    grid-template-columns: 1fr;
  }

  .coach-directory-card dl {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .coach-profile-notice {
    align-items: flex-start;
    flex-direction: column;
  }
}
