/* ============================================
   Team2meet stylesheet
   Vanilla CSS, no build step required.
   Theme tokens preserved from the original
   React project so the look matches Figma.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

:root {
  --background: hsl(0 0% 98%);
  --foreground: hsl(240 10% 3.9%);
  --card: hsl(0 0% 100%);
  --card-foreground: hsl(240 10% 3.9%);
  --primary: hsl(173 80% 36%);
  --primary-foreground: hsl(0 0% 100%);
  --primary-soft: hsl(173 80% 95%);
  --secondary: hsl(240 4.8% 95.9%);
  --secondary-foreground: hsl(240 5.9% 10%);
  --muted: hsl(240 4.8% 95.9%);
  --muted-foreground: hsl(240 3.8% 46.1%);
  --accent: hsl(173 80% 95%);
  --accent-foreground: hsl(173 80% 30%);
  --destructive: hsl(0 84.2% 60.2%);
  --destructive-foreground: hsl(0 0% 98%);
  --border: hsl(240 5.9% 90%);
  --input: hsl(240 5.9% 90%);
  --ring: hsl(173 80% 36%);
  --radius: 12px;

  --avail-none: hsl(240 4.8% 95.9%);
  --avail-low: hsl(173 40% 90%);
  --avail-med: hsl(173 60% 70%);
  --avail-high: hsl(173 80% 50%);
  --avail-full: hsl(173 80% 36%);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --background: hsl(240 10% 6%);
    --foreground: hsl(0 0% 98%);
    --card: hsl(240 10% 8%);
    --primary: hsl(173 70% 45%);
    --secondary: hsl(240 3.7% 15.9%);
    --muted: hsl(240 3.7% 15.9%);
    --muted-foreground: hsl(240 5% 64.9%);
    --accent: hsl(173 70% 15%);
    --accent-foreground: hsl(173 70% 80%);
    --border: hsl(240 3.7% 15.9%);
    --input: hsl(240 3.7% 15.9%);
    --primary-soft: hsl(173 70% 15%);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: 'DM Sans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img { max-width: 100%; height: auto; display: block; }

/* ============ Layout ============ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 8px 16px;
  border-radius: 0 0 8px 0;
  z-index: 999;
}
.skip-link:focus { left: 0; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  z-index: 30;
  box-shadow: var(--shadow-sm);
}
.site-header .header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--foreground);
  text-decoration: none;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}
.nav { display: flex; align-items: center; gap: 8px; }
.nav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--foreground);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav a:hover { background: var(--muted); text-decoration: none; }
.nav a.is-active { background: var(--primary-soft); color: var(--accent-foreground); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.btn:hover { box-shadow: var(--shadow-md); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-lg { padding: 14px 24px; font-size: 1rem; border-radius: 12px; }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-ghost { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn-ghost:hover { background: var(--muted); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-danger { background: var(--destructive); color: var(--destructive-foreground); }
.btn-block { width: 100%; }

/* ============ Cards ============ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-header { margin-bottom: 16px; }
.card-title { font-size: 1.125rem; font-weight: 700; margin: 0 0 4px 0; }
.card-description { color: var(--muted-foreground); font-size: 0.95rem; margin: 0; }

/* ============ Forms ============ */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
label, .label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--foreground);
}
.help-text {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  margin-top: 2px;
}
input[type="text"],
input[type="email"],
input[type="time"],
input[type="search"],
select,
textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  border: 1px solid var(--input);
  border-radius: 10px;
  background: var(--card);
  color: var(--foreground);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px hsla(173, 80%, 36%, 0.15);
}

/* ============ Hero ============ */
.hero {
  padding: 80px 0 60px 0;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--accent-foreground);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 20px 0;
}
.hero p {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 680px;
  margin: 0 auto 36px auto;
  line-height: 1.6;
}
.hero-form {
  max-width: 460px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  text-align: left;
}

/* ============ Features ============ */
.features {
  padding: 60px 0 80px 0;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 980px;
  margin: 0 auto;
}
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.feature:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--accent-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 14px;
}
.feature h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 6px 0;
}
.feature p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

/* ============ Section helper ============ */
.section {
  padding: 60px 0;
}
.section-heading {
  text-align: center;
  margin-bottom: 40px;
}
.section-heading h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px 0;
}
.section-heading p {
  color: var(--muted-foreground);
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 48px 0 32px 0;
  margin-top: 80px;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-grid h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--foreground);
  margin: 0 0 12px 0;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--muted-foreground); }
.footer-grid a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ============ Meeting page layout ============ */
.meeting-layout {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 24px;
  margin-top: 24px;
}
@media (max-width: 1180px) {
  .meeting-layout {
    grid-template-columns: 1fr;
  }
}

.meeting-name {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.meeting-name h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
  min-width: 240px;
}
.meeting-name input {
  flex: 1;
  min-width: 240px;
  font-size: 1.5rem;
  font-weight: 700;
  padding: 6px 10px;
  border: 1px dashed var(--border);
  background: transparent;
}

/* ============ Calendar ============ */
.calendar {
  user-select: none;
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.calendar-header button {
  background: transparent;
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--foreground);
}
.calendar-header button:hover { background: var(--muted); }
.calendar-month {
  font-weight: 700;
  font-size: 1rem;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-grid .dow {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 600;
  padding: 6px 0;
}
.calendar-day {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--foreground);
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.calendar-day:hover { background: var(--muted); }
.calendar-day.is-other-month { color: var(--muted-foreground); opacity: 0.4; }
.calendar-day.is-today { border-color: var(--primary); }
.calendar-day.is-selected {
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 700;
}
.calendar-day.is-past { opacity: 0.3; cursor: not-allowed; }

/* ============ Availability grid ============ */
.availability {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.availability .empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted-foreground);
}
.availability-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.tabs {
  display: inline-flex;
  background: var(--muted);
  border-radius: 10px;
  padding: 4px;
}
.tabs button {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted-foreground);
  cursor: pointer;
}
.tabs button.is-active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

.grid-table {
  display: grid;
  gap: 2px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.grid-table .grid-cell {
  background: var(--avail-none);
  border-radius: 4px;
  height: 28px;
  cursor: pointer;
  transition: background 0.1s ease, transform 0.05s ease;
  position: relative;
}
.grid-table .grid-cell.is-selected { background: var(--avail-full); }
.grid-table .grid-cell.is-hover { outline: 2px solid var(--ring); outline-offset: -2px; }
.grid-table .row-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-align: right;
  padding-right: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}
.grid-table .col-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-align: center;
  font-weight: 600;
  padding-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Heatmap cells */
.grid-table .grid-cell.heat-0 { background: var(--avail-none); }
.grid-table .grid-cell.heat-1 { background: var(--avail-low); }
.grid-table .grid-cell.heat-2 { background: var(--avail-med); }
.grid-table .grid-cell.heat-3 { background: var(--avail-high); }
.grid-table .grid-cell.heat-4 { background: var(--avail-full); }

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  margin-top: 12px;
  flex-wrap: wrap;
}
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
}

/* ============ Participants ============ */
.participant-list { list-style: none; padding: 0; margin: 0; }
.participant-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.participant-list li:last-child { border-bottom: none; }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--accent-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ============ Best times ============ */
.best-times .item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.best-times .item .top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.best-times .item .when {
  font-weight: 700;
  font-size: 0.95rem;
}
.best-times .item .count {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}
.best-times .item .bar {
  height: 6px;
  background: var(--muted);
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}
.best-times .item .bar > span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

/* ============ Toast / banner ============ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--foreground);
  color: var(--background);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  pointer-events: none;
  max-width: 360px;
}
.toast.is-shown { opacity: 1; transform: translateY(0); }

.banner {
  background: var(--primary-soft);
  color: var(--accent-foreground);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  border: 1px solid hsla(173, 80%, 36%, 0.2);
}

/* ============ Share box ============ */
.share-box {
  background: var(--muted);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.share-box input {
  background: var(--card);
  font-size: 0.85rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ============ Share to platforms (Teams, Outlook, Google Calendar) ============ */
.share-platforms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.share-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.05s;
  text-align: left;
}
.share-btn:hover {
  background: var(--muted);
  border-color: var(--primary);
}
.share-btn:active { transform: translateY(1px); }
.share-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.share-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* Brand colours, sourced from each platform's published brand guidance */
.share-logo-teams   { background: #6264A7; } /* Microsoft Teams brand purple */
.share-logo-outlook { background: #0078D4; } /* Microsoft Outlook brand blue */
.share-logo-gcal    { background: #ffffff; border: 1px solid var(--border); }
.share-label { line-height: 1.2; }
.share-note {
  margin: 10px 2px 0;
  font-size: 0.78rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* ============ Misc ============ */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--muted-foreground); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.fw-700 { font-weight: 700; }
.hidden { display: none !important; }

/* ============ 404 page ============ */
.page-404 {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}
.page-404 h1 {
  font-size: 6rem;
  margin: 0 0 8px 0;
  font-weight: 800;
  color: var(--primary);
}
.page-404 p { color: var(--muted-foreground); margin-bottom: 24px; }

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
