/* Base shared styling (desktop/mobile/tablet handled via media queries).
 * Keep CSS out of HTML files.
 * NOTE: We’ll refine to match tutor-with-amit/tutorDesk as we migrate more pages.
 */

:root {
  --bg: #0b0d12;
  --surface: #0f172a;         /* dark blue */
  --surface-2: #111827;

  --border: #24324d;
  --text: #ffffff;
  --muted: #9ca3af;
  --accent: #4f9dff;
  --ok: #22c55e;
  --bad: #ef4444;

  --radius-lg: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

main {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 14px 16px 60px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 14px 0 10px; }

.dt-muted { color: var(--muted); }
.dt-error { color: var(--bad); }
.dt-ok { color: var(--ok); }

.dt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
}

/* Header */
.dt-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.dt-brand {
  flex: 0 0 auto;
}

.dt-brand-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  color: var(--text);
}

.dt-brand-title {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.dt-brand-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
}

.dt-header nav[data-nav] {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.dt-header nav[data-nav] a,
.dt-header nav[data-nav] button {
  font-size: 1.05rem;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}

.dt-header nav[data-nav] a:hover,
.dt-header nav[data-nav] button:hover {
  border-color: var(--border);
  background: var(--surface-2);
}

.dt-header nav[data-nav] a.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 157, 255, 0.2);
}

/* Search layout */
.results-panel {
  position: relative;
}

.dt-map {
  height: 400px;
  width: 100%;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

/* Map info panel */
.map-info-panel {
  position: absolute;
  left: 12px;
  top: 12px;
  bottom: 12px;
  width: 320px;
  max-width: calc(100% - 24px);
  background: transparent;
  overflow-y: auto;
  z-index: 1000;
  pointer-events: none;
}

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

.map-info-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 24px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: auto;
}

.map-info-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.map-info-content {
  padding: 12px;
  pointer-events: auto;
}

@media (max-width: 800px) {
  .map-info-panel {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 8px;
    width: auto;
    max-width: none;
    max-height: 50vh;
  }
}

.dt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.dt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
}

/* Field/layout helpers (no inline styles in HTML) */
.dt-field--grow {
  min-width: 220px;
  flex: 1 1 240px;
}

.dt-field--grow-wide {
  min-width: 260px;
  flex: 1 1 280px;
}

.dt-field--max320 {
  max-width: 320px;
}

.dt-mt-12 {
  margin-top: 12px;
}

.dt-mt-6 {
  margin-top: 6px;
}

.dt-strong {
  font-weight: 800;
}

/* Back-compat for older pages still using generic class names */
.muted { color: var(--muted); }
.error { color: var(--bad); }
.row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin: 12px 0;
}

label { font-weight: 600; }

input, select, textarea {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

button {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: filter 0.15s ease, border-color 0.15s ease;
}

button:hover {
  filter: brightness(1.12);
  border-color: rgba(79, 157, 255, 0.6);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Search results grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.results-grid .dt-card {
  margin: 0;
}

.search-tutor-card {
  cursor: pointer;
}

.search-tutor-card:focus {
  outline: 2px solid rgba(79, 157, 255, 0.6);
  outline-offset: 2px;
}

/* Tutor business card */
.tutor-business-card {
  padding: 0;
  overflow: hidden;
}

.tutor-card-cover {
  height: 160px;
  background: #0b1224;
  position: relative;
}

.tutor-card-cover-blur {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(12px);
  transform: scale(1.12);
  opacity: 0.55;
}

.tutor-card-body {
  padding: 14px 16px 16px;
}

.tutor-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tutor-card-identity {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.tutor-card-avatar-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  margin-top: -54px;
  flex: 0 0 auto;
}

.tutor-card-avatar {
  width: 92px;
  height: 92px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  background: #0b0d12;
  object-fit: cover;
}

.tutor-card-avatar--placeholder {
  display: grid;
  place-items: center;
  background: rgba(79, 157, 255, 0.18);
  border-color: rgba(79, 157, 255, 0.45);
}

.tutor-card-namebox {
  padding-top: 4px;
  min-width: 0;
}

.tutor-card-name {
  font-weight: 900;
  font-size: 1.3rem;
  line-height: 1.15;
}

.tutor-card-headline {
  margin-top: 6px;
}

.tutor-card-city {
  margin-top: 6px;
}

.tutor-card-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tutor-card-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(79, 157, 255, 0.35);
  background: rgba(79, 157, 255, 0.12);
  font-weight: 700;
}

.linkedin-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
}

.linkedin-badge-in {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #0a66c2;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.linkedin-badge-check {
  color: var(--ok);
  font-weight: 900;
}

.tutor-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.tutor-card-message {
  margin-top: 10px;
  min-height: 1.4em;
}

/* Search map */
.dt-map {
  width: 100%;
  height: 380px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .dt-map {
    height: 260px;
  }
}

.map-marker-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  background: linear-gradient(135deg, rgba(79, 157, 255, 0.3), rgba(255, 255, 255, 0.1));
  display: grid;
  place-items: center;
}

.map-marker-avatar-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  color: #0b0d12;
  font-weight: 900;
  display: grid;
  place-items: center;
}

/* My Tutors list */
.my-tutors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.my-tutor-card {
  cursor: pointer;
}

.my-tutor-card:focus {
  outline: 2px solid rgba(79, 157, 255, 0.6);
  outline-offset: 2px;
}

.tutor-card-badges {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

@media (max-width: 520px) {
  .tutor-card-actions {
    grid-template-columns: 1fr;
  }
}

.dt-kv {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px 12px;
}

/* Home cards */
.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.home-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
}

.home-card:hover {
  text-decoration: none;
  filter: brightness(1.06);
}

.home-card-title {
  font-weight: 800;
  margin-bottom: 4px;
}

.home-card-desc {
  color: var(--muted);
  font-size: 0.95em;
}

/* Header partial styles */
#site-header { margin-bottom: 16px; }
#site-header .dt-header { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
#site-header .dt-brand { font-weight: 800; letter-spacing: 0.02em; }
#site-header nav { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
#site-header nav a { color: var(--text); padding: 8px 10px; border-radius: 999px; }
#site-header nav a:hover { background: rgba(79, 157, 255, 0.12); text-decoration: none; }
#site-header nav a.active, #site-header nav a[aria-current="page"] { background: rgba(79, 157, 255, 0.18); }

/* Footer */
.dt-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 32px 20px 24px;
}

.dt-footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  text-align: center;
}

.dt-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dt-footer-brand-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.dt-footer-brand-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
}

.dt-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: center;
}

.dt-footer-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.2s;
}

.dt-footer-nav a:hover {
  color: var(--accent);
}

.dt-footer-copy {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 8px;
}

.dt-footer-copy p {
  margin: 0;
}

/* Legal pages */
.legal-page {
  max-width: 900px;
  margin: 0 auto;
}

.legal-page h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.legal-page h2 {
  font-size: 1.5rem;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--accent);
}

.legal-page h3 {
  font-size: 1.2rem;
  margin-top: 20px;
  margin-bottom: 10px;
}

.legal-page section {
  margin-bottom: 24px;
}

.legal-page p {
  line-height: 1.6;
  margin: 12px 0;
}

.legal-page ul {
  line-height: 1.7;
  margin: 12px 0;
  padding-left: 24px;
}

.legal-page li {
  margin: 8px 0;
}

.legal-page a {
  color: var(--accent);
  text-decoration: underline;
}

.legal-page a:hover {
  color: var(--text);
}

/* Responsive placeholders */
@media (max-width: 767px) {
  main { padding: 12px 12px 60px; }

  .dt-kv {
    grid-template-columns: 1fr;
  }

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

  .filters-panel { position: static; }

  .legal-page h1 {
    font-size: 1.8rem;
  }

  .legal-page h2 {
    font-size: 1.3rem;
  }

  .dt-footer {
    padding: 24px 16px 20px;
  }

  .dt-footer-nav {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 767px) and (orientation: landscape) {
  /* phone landscape tweaks (placeholder) */
}

@media (min-width: 768px) and (max-width: 1024px) {
  /* iPad / small laptop tweaks (placeholder) */
}
