/* Language Selector */
.language-selector {
  background: transparent;
  color: inherit;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 4px;
  padding: 6px 12px 6px 8px;
  font-size: 14px;
  cursor: pointer;
  margin-right: 8px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%239ca3af%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat, repeat;
  background-position: right 0.5em top 50%, 0 0;
  background-size: 0.65em auto, 100%;
  padding-right: 2em;
  transition: all 0.2s ease;
  min-width: 140px;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.language-selector option {
  padding: 8px 12px;
  background: white;
  color: #1f2937;
}

.language-selector:hover {
  border-color: #9ca3af;
}

.language-selector:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* Dark theme overrides */
html[data-theme="dark"] .language-selector {
  border-color: #4b5563;
  background-color: #1f2937;
}

html[data-theme="dark"] .language-selector option {
  background: #1f2937;
  color: #f9fafb;
}

html[data-theme="dark"] .language-selector:hover {
  border-color: #6b7280;
}

/* Radix pretty table: normalize header/body cell sizing */
#radixPretty table.list {
  display: table;            /* override global .list display:grid */
  table-layout: fixed;
  border-collapse: collapse;
}

/* welcome-page footer overrides moved to index.css */
#radixPretty table.list th,
#radixPretty table.list td {
  border: 1px solid var(--border-color, #1f2937);
  vertical-align: middle;
}
#radixPretty table.list thead th { border-bottom: 1px solid var(--border-color, #1f2937); }
#radixPretty table.list thead + tbody tr:first-child td {
  /* Remove double seam between header and first row */
  border-top: none;
}
#radixPretty table.list thead th,
#radixPretty table.list tfoot th {
  text-align: center;
  font-weight: 600;
}
#radixPretty .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

/* Radix two-panel layout */
#radixPretty .radix-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 8px;
  width: 100%;
}
/* Force single-column layout for radix section on all widths */
@media (min-width: 980px) {
  #radixPretty .radix-layout { grid-template-columns: 1fr; }
}
#radixPretty .radix-panel {
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  width: 100%;
}
@media (prefers-color-scheme: light) {
  #radixPretty .radix-panel { background: #ffffff; border-color: #e5e7eb; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
}

#radixPretty .planets-table { width: 100%; table-layout: fixed; }
#radixPretty .planets-table col.icon { width: auto; }
#radixPretty .planets-table col.planet { width: auto; }
#radixPretty .planets-table col.sign { width: 56px; }
#radixPretty .planets-table col.deg { width: 90px; }
#radixPretty .planets-table col.pos { width: 120px; }
#radixPretty .planets-table col.house { width: 72px; }
#radixPretty .planets-table col.cusp { width: 100px; }
#radixPretty .planets-table col.aspect { width: 80px; }
#radixPretty .planets-table th, 
#radixPretty .planets-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#radixPretty .planets-table thead th { overflow: visible; text-overflow: clip; white-space: nowrap; }
#radixPretty .planets-table th,
#radixPretty .planets-table td { padding: 6px 8px; }
#radixPretty .planets-table thead th { font-weight: 700; }
#radixPretty .aspect-grid { width: 100%; }

#radixPretty .badge { margin-right: 6px; }

/* Ensure fixed column widths for houses table regardless of content */
#radixPretty table.houses-table { table-layout: auto; }
#radixPretty table.houses-table th:nth-child(1),
#radixPretty table.houses-table td:nth-child(1) { width: auto; }
#radixPretty table.houses-table th:nth-child(2),
#radixPretty table.houses-table td:nth-child(2) { width: auto; }
#radixPretty table.houses-table th:nth-child(3),
#radixPretty table.houses-table td:nth-child(3) { width: auto; }

/* Prevent wrapping and stretching; clip long content in fixed-layout tables */
#radixPretty table.list td,
#radixPretty table.list th { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#radixPretty table.list td.mono { white-space: nowrap; }
/* Allow wrapping inside the Planets column for houses table so content can flex */
#radixPretty table.houses-table td:nth-child(3),
#radixPretty table.houses-table th:nth-child(3) { white-space: normal; overflow: visible; text-overflow: clip; }

/* Force 24-hour format for time inputs */
input[type="time"]::-webkit-datetime-edit-ampm-field {
  display: none;
}

input[type="time"]::-webkit-datetime-edit {
  padding: 0;
}

input[type="time"]::-webkit-datetime-edit-hour-field,
input[type="time"]::-webkit-datetime-edit-minute-field {
  padding: 0 2px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif; color: #0f172a; background: #f8fafc; }
/* Reserve space so the fixed footer doesn't overlap page content */
body { padding-bottom: 44px; }

.container { max-width: 980px; margin: 40px auto; padding: 0 20px; }

h1 { font-size: 28px; margin: 0 0 24px; color: #111827; }
section { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; margin: 16px 0; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
section h2 { margin: 0 0 12px; font-size: 18px; color: #111827; }

.row { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 10px; 
  align-items: center; 
  margin: 8px 0;
  width: 100%;
}

/* Timezone search specific styles */
#tzSearch {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: 40px;
}

#tzSearch:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

#liveTz {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  height: 40px;
  cursor: pointer;
}

#liveTz:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* Make inputs in the profile form take full width on mobile */
@media (max-width: 640px) {
  .row > input,
  .row > select,
  .row > button {
    width: 100%;
  }
}
.small { font-size: 12px; color: #6b7280; }


input { height: 36px; padding: 0 12px; border: 1px solid #d1d5db; border-radius: 8px; outline: none; min-width: 220px; background: #fff; }
input:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15); }
select { height: 36px; padding: 0 12px; border: 1px solid #d1d5db; border-radius: 8px; outline: none; min-width: 140px; background: #fff; }
select:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15); }

/* Base button styles */
button,
.button,
.btn-confirm-meetup,
.btn-cancel-meetup,
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 80px;
  padding: 0 16px;
  margin: 0;
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  line-height: 34px;
  font-family: inherit;
  font-size: 14px;
  text-decoration: none;
  box-sizing: border-box;
  vertical-align: middle;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  position: relative;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

/* Reset specific button styles */
button {
  /* Reset anchor specific styles */
  text-decoration: none;
  color: inherit;
  /* Ensure consistent height calculation */
  line-height: 34px;
  /* Fix for vertical alignment */
  position: relative;
  top: 0;
  display: inline-flex;
}

/* Primary button styles */
button:not(.secondary):not(.btn-cancel-meetup),
.button:not(.secondary),
.btn-confirm-meetup {
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  color: white !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Secondary button styles */
button.secondary,
.button.secondary,
.btn-cancel-meetup {
  background: transparent;
  color: #0f172a;
  border: 1px solid #c7d2fe;
}

/* Hover states */
button:hover:not(:disabled),
.button:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Active states */
button:active:not(:disabled),
.button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Disabled state */
button:disabled,
.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

pre { background: #0b1020; color: #e2e8f0; border-radius: 12px; padding: 12px; overflow: auto; max-height: 380px; border: 1px solid #1f2937; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #e5e7eb; color: #111827; font-weight: 600; }
.badge.info { background: #dbeafe; color: #1e40af; }
.badge.success { background: #dcfce7; color: #166534; }
.badge.error { background: #fee2e2; color: #991b1b; }

/* Lists */
.list:not(table) { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
.item-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.item-title { font-weight: 800; color: #0f172a; font-size: 16px; line-height: 1.3; }
.item-sub { color: #374151; font-size: 13px; line-height: 1.4; word-break: break-word; }
.item-card { line-height: 1.45; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 12px; }
.chip .meta { color: #6b7280; }
.tz-inline { white-space: nowrap; }
.chip .chip-block { margin-top: 4px; }
.chip .chip-block:first-of-type { margin-top: 2px; }
.item-actions { display: flex; gap: 8px; margin-top: 6px; }
.item-actions.center { justify-content: center; }

/* 3-column layout inside overlap chips */
.chip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; }
.chip-col { display: flex; flex-direction: column; gap: 2px; }
.chip-col:not(:last-child) { border-right: 1px dashed #e5e7eb; padding-right: 10px; }

/* Two-column layout on wide screens */
.two-col { display: grid; grid-template-columns: 1fr; gap: 20px; max-width: 980px; margin: 0 auto; }
@media (min-width: 980px) {
  .two-col { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* Availability grid layout */
.avail-grid {
  display: grid;
  grid-template-columns: repeat(3, auto); /* date, start, end in one row */
  gap: 8px 12px;
  align-items: center;
  justify-content: start;
  margin: 12px 0;
}

/* Flatten groups so their children become grid items */
.avail-grid .avail-group { display: contents; }

/* Compact availability inputs on larger screens */
.avail-grid .avail-group input[type="date"],
.avail-grid .avail-group input[type="text"],
.avail-grid .avail-group select {
  width: auto;
  min-width: 0;
  max-width: 180px;
}

/* Make the date input compact so three controls fit on one row */
.avail-grid #availStartDate[type="date"] {
  width: 18ch;   /* room for mm/dd/yyyy and calendar icon */
  min-width: 0;
}

/* Slightly wider for the start time picker */
.avail-grid #availStartHour,
.avail-grid #availEndHour {
  width: 11ch;     /* a tick wider for better fit */
  min-width: 0;    /* override global select min-width */
  max-width: none; /* do not cap */
  padding-left: 8px; /* compact left padding */
  padding-right: 18px; /* leave room for caret without clipping */
  text-align: center;
}

/* Prevent inner spans from constraining button width unnecessarily */
.avail-grid button span {
  max-width: none !important;
  width: auto;
}

/* Responsive availability layout */
@media (max-width: 640px) {
  .avail-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  /* On mobile, inputs should stretch nicely */
  .avail-grid .avail-group input,
  .avail-grid .avail-group select {
    width: 100%;
    max-width: none;
  }
  .avail-grid #availStartHour,
  .avail-grid #availEndHour {
    width: 100%;
    text-align: left;
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* dark theme overrides moved to theme.css */

/* footer styles moved to theme.css */

/* Manual override: html[data-theme="dark"] forces dark regardless of OS */
html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] .container,
html[data-theme="dark"] .welcome-container {
  color: #e5e7eb;
  background: #0b1220;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
  color: #f8fafc;
}

/* Ensure all text is visible in dark mode */
html[data-theme="dark"] {
  color-scheme: dark;
}

/* Fix any light backgrounds that might be hardcoded */
html[data-theme="dark"] .card,
html[data-theme="dark"] .welcome-card,
html[data-theme="dark"] .md {
  background: #0f172a;
  color: #e5e7eb;
}

/* Fix code blocks */
html[data-theme="dark"] code,
html[data-theme="dark"] pre {
  background: #0b1020;
  color: #e2e8f0;
  border-color: #1f2937;
}
html[data-theme="dark"] section { background: #0f172a; border: 1px solid #1f2937; box-shadow: 0 1px 2px rgba(0,0,0,0.4); }
html[data-theme="dark"] .card { background: #0f172a !important; border: 1px solid #1f2937 !important; }
html[data-theme="dark"] section h2 { color: #f1f5f9; }
html[data-theme="dark"] .small { color: #9ca3af; }
 

/* Profile page layout tweaks */
.container { padding-top: 4px; }
.card .row + .small { margin-top: -6px; }
html[data-theme="dark"] .brand { background: linear-gradient(135deg, #a78bfa, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[data-theme="dark"] input { background: #0b1020; color: #e5e7eb; border: 1px solid #334155; }
html[data-theme="dark"] select { background: #0b1020; color: #e5e7eb; border: 1px solid #334155; }
html[data-theme="dark"] input::placeholder { color: #64748b; }
html[data-theme="dark"] input:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25); }
html[data-theme="dark"] select:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25); }
html[data-theme="dark"] .badge { background: #1f2937; color: #e5e7eb; }
html[data-theme="dark"] .badge.info { background: #1e293b; color: #93c5fd; }
html[data-theme="dark"] .badge.success { background: #0f2d17; color: #86efac; }
html[data-theme="dark"] .badge.error { background: #2a1616; color: #fecaca; }
html[data-theme="dark"] .item-card { background: #0f172a; border: 1px solid #1f2937; box-shadow: 0 1px 2px rgba(0,0,0,0.4); }
html[data-theme="dark"] .item-title { color: #e2e8f0; }
html[data-theme="dark"] .item-sub { color: #cbd5e1; }
html[data-theme="dark"] .chip { background: #111827; border: 1px solid #1f2937; }
html[data-theme="dark"] .chip .meta { color: #94a3b8; }
html[data-theme="dark"] .chip-col:not(:last-child) { border-right-color: #334155; }
html[data-theme="dark"] pre { background: #0b1020; color: #e2e8f0; border: 1px solid #1f2937; }
html[data-theme="dark"] a { color: #93c5fd; }
/* Dark theme data attribute overrides */
html[data-theme="dark"] button:not(.secondary):not(.btn-cancel-meetup),
html[data-theme="dark"] .button:not(.secondary),
html[data-theme="dark"] .btn-confirm-meetup {
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] button.secondary,
html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] .btn-cancel-meetup {
  background: transparent;
  color: #c7d2fe !important;
  border-color: #4b5563;
}

html[data-theme="dark"] button:hover:not(:disabled),
html[data-theme="dark"] .button:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] * { scrollbar-color: #334155 #0b1220; }
html[data-theme="dark"] *::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="dark"] *::-webkit-scrollbar-track { background: #0b1220; }
html[data-theme="dark"] *::-webkit-scrollbar-thumb { background: #334155; border-radius: 8px; }

/* Shared utility classes */
.muted { color: #6b7280; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
button.primary { background: linear-gradient(135deg, #7c3aed, #06b6d4); color: white; cursor: pointer; font-weight: 600; letter-spacing: .2px; }
.header { font-weight: 800; color: #0f172a; font-size: 16px; line-height: 1.3; }
/* Utilities */
.hidden { display: none; }
.link-unstyled { color: inherit; text-decoration: none; }
.link-unstyled:hover { text-decoration: none; }

/* Autocomplete (birth place) */
.autocomplete { position: relative; display: inline-block; min-width: 320px; }
.autocomplete-list { position: absolute; top: 38px; left: 0; right: 0; z-index: 50; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.autocomplete-item { padding: 8px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.autocomplete-item:hover { background: #f3f4f6; }

.autocomplete-item:focus {
  background: #f3f4f6;
  outline: 2px solid #7c3aed;
  outline-offset: -2px;
}

/* Keyboard navigation support for autocomplete */
.autocomplete-item[tabindex] {
  cursor: pointer;
}
.autocomplete-item .title { font-weight: 600; color: #111827; }
.autocomplete-item .sub { font-size: 12px; color: #6b7280; }

@media (prefers-color-scheme: dark) {
  .autocomplete-list { background: #0f172a; border-color: #1f2937; box-shadow: 0 8px 24px rgba(2,6,23,0.4); }
  .autocomplete-item:hover { background: #111827; }
  .autocomplete-item .title { color: #e5e7eb; }
  .autocomplete-item .sub { color: #9ca3af; }
}


/* Markdown styles */
.md {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #0f172a;
}

.md h1 {
  font-size: 24px;
  margin-bottom: 12px;
}

.md h2 {
  font-size: 18px;
}

.md p {
  margin-bottom: 12px;
}

.md a {
  color: #7c3aed;
  text-decoration: none;
}

.md a:hover {
  color: #06b6d4;
}

.md code {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 12px;
}

.md pre {
  background: #0b1020;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  overflow: auto;
  max-height: 380px;
  border: 1px solid #1f2937;
}

.md pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
}

/* Dark theme variants */
@media (prefers-color-scheme: dark) {
  /* welcome-specific rules moved to index.css; keep generic .md dark rules here */
  .md {
    color: #e5e7eb;
  }
  .md a {
    color: #93c5fd;
  }
  .md code {
    background: #111827;
    border: 1px solid #1f2937;
  }
  .md pre {
    background: #0b1020;
    color: #e2e8f0;
    border: 1px solid #1f2937;
  }
}

/* === Page-specific styles migrated from inline <style> blocks === */

/* dashboard.html moved to dashboard.css */

/* dev.html moved to admin/dev.css */

/* login.html moved to login.css */

/* profile.html moved to profile.css */

/* welcome-page moved to index.css */

/* Force dark theme when data-theme="dark" is set */
/* moved to index.css: html[data-theme="dark"] .welcome-page vars */
/* moved to index.css: html[data-theme="dark"] .welcome-page .md code */
