:root {
  --bg: #0b1020;
  --panel: #121936;
  --panel-2: #1a2347;
  --text: #f5f7ff;
  --soft: #aeb9df;
  --accent: #7c9cff;
  --accent-2: #62e2c4;
  --border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: radial-gradient(circle at top, #16214a, var(--bg));
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 28, 0.72);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 800;
  font-size: 1.2rem;
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  color: var(--soft);
  text-decoration: none;
}

main {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem 0 3rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.05;
  margin: 0.15rem 0 1rem;
}

.lede,
.section-heading p,
.match-card p,
.business-model div,
.panel p,
li {
  color: var(--soft);
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), #5fdbfe);
  color: #08101f;
}

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

.btn[hidden] {
  display: none;
}

.hero-card,
.panel {
  background: rgba(18, 25, 54, 0.9);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.hero-card {
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.mini-card {
  padding: 1.2rem;
  background: var(--panel-2);
  border-radius: 18px;
}

.mini-card.accent {
  background: linear-gradient(135deg, rgba(124, 156, 255, 0.18), rgba(98, 226, 196, 0.18));
}

.mini-label {
  color: var(--soft);
  font-size: 0.8rem;
  display: block;
  margin-bottom: 0.4rem;
}

.hero-card strong {
  font-size: 1.5rem;
}

.panel {
  margin-top: 1.4rem;
  padding: 1.4rem;
}

.section-heading h2,
.panel h2 {
  margin-top: 0;
}

.auth-layout {
  display: grid;
  gap: 1rem;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.auth-column {
  display: grid;
  gap: 1rem;
}

.profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.forgot-link {
  align-self: center;
  color: var(--accent-2);
  font-size: 0.85rem;
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.field-hint {
  margin: -0.5rem 0 0;
  color: var(--soft);
  font-size: 0.8rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--soft);
}

.full-width {
  grid-column: 1 / -1;
}

.detected-location {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--soft);
}

.detected-location .location-status {
  margin: 0;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f1733;
  color: var(--text);
}

.discovery-layout {
  display: grid;
  gap: 1rem;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.shows-filter-row {
  max-width: 320px;
}

.location-suggestions {
  margin-top: -0.6rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #132420;
  overflow: hidden;
}

.location-suggestion-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.location-suggestion-row:last-child {
  border-bottom: none;
}

.location-suggestion-row:hover {
  background: rgba(124, 156, 255, 0.12);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field-label {
  color: var(--soft);
  font-size: 0.85rem;
  font-weight: 600;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0f1733;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #08101f;
  font-weight: 700;
}

.radius-field input[type="range"] {
  padding: 0;
  background: transparent;
  border: none;
  accent-color: var(--accent);
}

.matches-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.match-grid,
.business-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.match-card,
.business-model div {
  background: var(--panel-2);
  border-radius: 18px;
  padding: 1rem;
}

.match-actions {
  display: flex;
  gap: 0.75rem;
}

.match-status,
.location-status {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(124, 156, 255, 0.12);
  border: 1px solid rgba(124, 156, 255, 0.32);
}

.matched-list,
.message-preview {
  background: var(--panel-2);
  border-radius: 18px;
  padding: 1rem;
}

.matched-list .match-card {
  cursor: pointer;
  border: 1px solid transparent;
}

.matched-list .match-card.active {
  border-color: var(--accent);
}

.message-thread {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 320px;
  overflow-y: auto;
  margin: 0.8rem 0;
}

.message-bubble {
  max-width: 80%;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.message-bubble.outgoing {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), #5fdbfe);
  color: #08101f;
}

.message-bubble time {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  opacity: 0.7;
}

.message-form {
  display: flex;
  gap: 0.6rem;
}

.message-form input {
  flex: 1;
}

.message-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.message-actions {
  display: flex;
  gap: 0.9rem;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--soft);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--text);
}

.link-btn.danger {
  color: #ff8a8a;
}

.link-btn.danger:hover {
  color: #ffb3b3;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 20, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-sheet {
  width: min(420px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.4rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.modal-header h3 {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--soft);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

.modal-sheet textarea {
  width: 100%;
  margin-top: 0.6rem;
}

.modal-sheet .btn {
  width: 100%;
  margin-top: 1rem;
  border: none;
}

.lessons-segment-row {
  display: flex;
  gap: 0.3rem;
  padding: 0.3rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 1.2rem;
  width: fit-content;
}

.lessons-segment-btn {
  border: none;
  background: transparent;
  color: var(--soft);
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
}

.lessons-segment-btn.active {
  background: var(--accent);
  color: #08101f;
}

.lessons-panel[hidden] {
  display: none;
}

#offerLessonsBtn {
  margin-bottom: 1.2rem;
}

.teacher-card-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.teacher-card-info h3 {
  margin: 0;
  font-size: 1.1rem;
}

.teacher-card-info p {
  margin: 0.15rem 0;
  font-size: 0.85rem;
}

.bookings-section {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.bookings-section h4 {
  margin: 0 0 0.6rem;
}

.booking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.booking-row:last-child {
  border-bottom: none;
}

.teaching-section {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.teaching-section h4 {
  margin: 0 0 0.6rem;
}

.teaching-section .btn {
  margin-top: 0.6rem;
}

#teachingRateRow label {
  margin-top: 0.6rem;
}

.blocked-section {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.blocked-section h4 {
  margin: 0 0 0.6rem;
}

.blocked-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.blocked-row:last-child {
  border-bottom: none;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08101f;
  font-weight: 800;
  margin-bottom: 0.8rem;
  object-fit: cover;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar-row .avatar {
  margin-bottom: 0;
  flex-shrink: 0;
}

.gallery-editor {
  display: grid;
  gap: 0.6rem;
}

.gallery-editor h4 {
  margin: 0;
  color: var(--text);
}

.gallery-row {
  display: flex;
  gap: 0.6rem;
}

.gallery-thumb-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel-2);
}

.gallery-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-play-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: #08101f;
  font-size: 0.6rem;
  display: grid;
  place-items: center;
}

.gallery-empty-slot {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px dashed var(--border);
}

.gallery-carousel {
  position: relative;
  margin-top: 0.6rem;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--panel-2);
  cursor: pointer;
  user-select: none;
}

.gallery-track {
  display: flex;
  height: 100%;
  transition: transform 0.25s ease;
}

.gallery-page {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}

.gallery-page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-carousel .gallery-play-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
}

.gallery-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.gallery-dot.active {
  background: var(--accent);
}

.match-card span {
  display: inline-block;
  margin-top: 0.6rem;
  color: var(--accent-2);
  font-weight: 700;
}

.match-card p {
  margin: 0.2rem 0;
}

.match-card p strong,
.match-card span strong {
  color: var(--text);
}

.match-card .btn {
  display: block;
  margin-top: 0.75rem;
  width: 100%;
}

.profile-card {
  position: relative;
  padding: 0;
  aspect-ratio: 0.72;
  overflow: hidden;
}

.profile-card .gallery-carousel {
  position: absolute;
  inset: 0;
  margin: 0;
  aspect-ratio: unset;
  border-radius: 0;
}

.profile-card .gallery-carousel .gallery-play-badge {
  top: 14px;
  bottom: auto;
  right: 14px;
}

.profile-card .gallery-carousel .gallery-dots {
  top: 14px;
  bottom: auto;
}

.profile-card-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3rem;
  font-weight: 800;
  color: var(--soft);
  background: var(--panel-2);
}

.profile-card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(8, 16, 31, 0.6) 50%, rgba(8, 16, 31, 0.97) 100%);
  pointer-events: none;
}

.profile-card-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.profile-card-content h3 {
  margin: 0 0 0.1rem;
  font-size: 1.35rem;
  color: var(--text);
}

.listing-poster-preview:empty {
  display: none;
}

.listing-poster-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 0.4rem;
}

.listing-card {
  padding: 0;
  overflow: hidden;
}

.listing-poster {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.listing-poster-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--panel-2), var(--bg));
  color: var(--accent-2);
  font-size: 2rem;
  opacity: 0.7;
}

.listing-card-body {
  padding: 1rem;
}

.listing-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.listing-card-title-row h3 {
  margin: 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-card {
  background: var(--panel-2);
  border-radius: 18px;
  padding: 1rem;
}

.feature-card h3 {
  margin-top: 0;
}

.split-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.profile-dashboard {
  background: var(--panel-2);
  border-radius: 18px;
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.current-profile {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 14px;
  padding: 1rem;
}

.profile-dashboard .profile-form {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.success-message {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(98, 226, 196, 0.15);
  border: 1px solid rgba(98, 226, 196, 0.4);
}

@media (max-width: 820px) {
  .hero,
  .auth-grid,
  .profile-form,
  .split-layout,
  .matches-grid,
  .match-grid,
  .business-grid,
  .features-grid,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    gap: 0.6rem;
  }
}
