:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --charcoal: #334155;
  --cream: #faf9f6;
  --cream-dark: #f2f0e9;
  --coral: #f97066;
  --coral-dark: #e85c50;
  --teal: #14b8a6;
  --teal-dark: #0d9488;
  --gold: #f59e0b;
  --text: #1e293b;
  --text-muted: #64748b;
  --white: #ffffff;
  --radius: 1rem;
  --radius-sm: 0.5rem;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.65;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 50;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--coral);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--white);
  text-decoration: none;
}

/* Hero */
.hero {
  background: var(--navy);
  color: var(--white);
  padding: 5rem 1.5rem 6rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(249, 112, 102, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3.25rem;
  line-height: 1.1;
  margin: 0 0 1.25rem;
  letter-spacing: -0.03em;
  max-width: 650px;
}

.hero p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.75);
  max-width: 560px;
  margin: 0 0 2rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-primary {
  background: var(--coral);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--coral-dark);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--coral);
  border: 1.5px solid var(--coral);
}

.btn-outline:hover {
  background: rgba(249, 112, 102, 0.08);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Section styling */
section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--text-muted);
  margin: 0 0 2rem;
  font-size: 1.1rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(249, 112, 102, 0.1);
}

.help-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Teacher cards */
.teacher-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.teacher-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.teacher-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.teacher-card h3 a {
  color: var(--text);
}

.teacher-card h3 a:hover {
  color: var(--coral);
  text-decoration: none;
}

.teacher-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.subject-tag {
  background: rgba(20, 184, 166, 0.1);
  color: var(--teal-dark);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

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

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

label.required::after {
  content: " *";
  color: var(--coral);
  font-weight: 700;
}

/* Search bar */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  background: var(--white);
  padding: 0.75rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  align-items: stretch;
}

.search-bar input,
.search-bar select,
.search-bar button {
  flex: 1 1 auto;
  min-width: 140px;
  margin-bottom: 0;
  font-size: 0.9rem;
  white-space: nowrap;
}

.search-bar input#subject,
.search-bar input#location {
  min-width: 170px;
}

.search-bar select#lesson_format {
  min-width: 160px;
}

.search-bar input#price_min,
.search-bar input#price_max {
  min-width: 120px;
}

.search-bar select#distance {
  min-width: 140px;
}

.search-bar button {
  flex: 0 1 auto;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}

/* Profile page */
.profile-hero {
  background: var(--navy);
  color: var(--white);
  padding: 3rem 0 4rem;
}

.profile-header {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 2rem;
  align-items: start;
}

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--navy-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  color: var(--coral);
  border: 4px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: 2.5rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.profile-meta {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1rem;
}

.profile-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 2px solid var(--cream-dark);
  margin-bottom: 2rem;
}

.tab {
  padding: 1rem 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.15s;
}

.tab:hover {
  color: var(--coral);
}

.tab.active {
  border-color: var(--coral);
  color: var(--coral);
}

/* Info list (credentials etc.) */
.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--cream-dark);
  display: flex;
  gap: 0.75rem;
}

.info-list li:last-child {
  border-bottom: none;
}

.info-list strong {
  color: var(--coral);
  min-width: 120px;
}

/* Reviews */
.review {
  border-bottom: 1px solid var(--cream-dark);
  padding: 1.25rem 0;
}

.review:last-child {
  border-bottom: none;
}

.stars {
  color: var(--gold);
  letter-spacing: 0.05em;
}

/* Admin */
.admin-section {
  margin-bottom: 2.5rem;
}

.admin-section h2 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 1rem;
  border-bottom: 1px solid var(--cream-dark);
}

th {
  background: var(--cream);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-approved {
  background: #d1fae5;
  color: #065f46;
}

/* Messages */
.message {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.message-success {
  background: #d1fae5;
  color: #065f46;
}

.message-error {
  background: #fee2e2;
  color: #991b1b;
}

/* Footer */
footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 3rem 1.5rem;
  margin-top: 4rem;
}

footer a {
  color: var(--coral);
}

/* Utility */
.text-center {
  text-align: center;
}

.mb-0 {
  margin-bottom: 0;
}

.mt-1 {
  margin-top: 1rem;
}

/* Responsive */
@media (max-width: 700px) {
  .hero {
    padding: 3.5rem 1rem 4.5rem;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  .profile-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .avatar {
    margin: 0 auto;
    width: 140px;
    height: 140px;
  }

  .profile-name {
    font-size: 2rem;
  }

  nav {
    flex-wrap: wrap;
    height: auto;
    padding: 1rem 0;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    margin-top: 0.75rem;
    gap: 1rem;
  }

  .cta-buttons {
    justify-content: center;
  }

  .tabs {
    gap: 1rem;
    overflow-x: auto;
  }
}

/* Musical imagery */
.hero {
  position: relative;
  overflow: hidden;
}

.hero .music-notes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.12;
  font-size: 2.5rem;
  color: var(--coral);
}

.hero .music-notes span {
  position: absolute;
  animation: float 8s ease-in-out infinite;
}

.hero .music-notes span:nth-child(1) { top: 15%; left: 8%; animation-delay: 0s; }
.hero .music-notes span:nth-child(2) { top: 60%; left: 12%; animation-delay: 1.5s; }
.hero .music-notes span:nth-child(3) { top: 25%; right: 10%; animation-delay: 3s; }
.hero .music-notes span:nth-child(4) { top: 70%; right: 15%; animation-delay: 4.5s; }
.hero .music-notes span:nth-child(5) { top: 40%; left: 5%; animation-delay: 2s; }
.hero .music-notes span:nth-child(6) { top: 80%; right: 8%; animation-delay: 5.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(8deg); }
}

.hero .container {
  position: relative;
  z-index: 1;
}

.section-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.subject-tag::before {
  content: "♪ ";
  opacity: 0.7;
}

.profile-hero .music-accent {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.08;
  font-size: 4rem;
  color: var(--coral);
}

.profile-hero .music-accent span {
  position: absolute;
}

.profile-hero .music-accent span:nth-child(1) { top: 20%; right: 10%; }
.profile-hero .music-accent span:nth-child(2) { bottom: 20%; right: 20%; }
.profile-hero .music-accent span:nth-child(3) { top: 50%; right: 5%; }

.profile-hero .container {
  position: relative;
  z-index: 1;
}

@media (max-width: 700px) {
  .hero .music-notes {
    font-size: 1.75rem;
  }
  .profile-hero .music-accent {
    font-size: 2.5rem;
  }
}
