/* SyncGaze custom styles */

/* Smooth page transitions for HTMX navigation */
[hx-boost] {
  transition: opacity 150ms ease-in-out;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ── Form input defaults ────────────────────────────────────── */
/* :where() keeps specificity at (0,0,0) so Tailwind utilities can override */
:where(input[type="text"]),
:where(input[type="email"]),
:where(input[type="password"]),
:where(input[type="tel"]),
:where(input[type="number"]),
:where(input[type="url"]),
:where(input[type="search"]),
:where(input[type="date"]),
:where(select),
:where(textarea) {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  width: 100%;
  color: #111827;
  background-color: #ffffff;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 150ms, box-shadow 150ms;
}

/* Select chevron */
select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Placeholder */
input::placeholder,
textarea::placeholder {
  color: #9ca3af;
}

/* Focus */
input:focus,
select:focus,
textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

/* Checkbox & radio */
input[type="checkbox"],
input[type="radio"] {
  width: 1rem;
  height: 1rem;
  padding: 0;
  color: #2563eb;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  cursor: pointer;
}
input[type="radio"] {
  border-radius: 9999px;
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background-color: #2563eb;
  border-color: #2563eb;
}
input[type="checkbox"]:focus,
input[type="radio"]:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ── Dark-mode overrides ──────────────────────────────────────── */
.dark input[type="text"],
.dark input[type="email"],
.dark input[type="password"],
.dark input[type="tel"],
.dark input[type="number"],
.dark input[type="url"],
.dark input[type="search"],
.dark input[type="date"],
.dark select,
.dark textarea {
  color: #f3f4f6;
  background-color: rgba(55, 65, 81, 0.5);
  border-color: #4b5563;
}
.dark input::placeholder,
.dark textarea::placeholder {
  color: #9ca3af;
}
.dark select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}
.dark input[type="checkbox"],
.dark input[type="radio"] {
  border-color: #4b5563;
  background-color: rgba(55, 65, 81, 0.5);
}
.dark input[type="checkbox"]:checked,
.dark input[type="radio"]:checked {
  background-color: #2563eb;
  border-color: #2563eb;
}

/* ── Auth page dark-mode — keep cards light-themed ────────────── */
.dark .bg-white.rounded-2xl {
  background-color: white;
  border-color: rgb(243 244 246);
}
.dark .bg-white.rounded-2xl input[type="text"],
.dark .bg-white.rounded-2xl input[type="email"],
.dark .bg-white.rounded-2xl input[type="password"],
.dark .bg-white.rounded-2xl input[type="tel"],
.dark .bg-white.rounded-2xl input[type="number"],
.dark .bg-white.rounded-2xl input[type="url"],
.dark .bg-white.rounded-2xl input[type="search"],
.dark .bg-white.rounded-2xl input[type="date"],
.dark .bg-white.rounded-2xl select,
.dark .bg-white.rounded-2xl textarea {
  color: #111827;
  background-color: white;
  border-color: #d1d5db;
}
.dark .bg-white.rounded-2xl input::placeholder,
.dark .bg-white.rounded-2xl textarea::placeholder {
  color: #9ca3af;
}
.dark .bg-white.rounded-2xl label {
  color: #374151;
}
.dark .bg-white.rounded-2xl h1,
.dark .bg-white.rounded-2xl h2,
.dark .bg-white.rounded-2xl h3 {
  color: #111827;
}
.dark .bg-white.rounded-2xl .text-gray-900 { color: #111827; }
.dark .bg-white.rounded-2xl .text-gray-700 { color: #374151; }
.dark .bg-white.rounded-2xl .text-gray-600 { color: #4b5563; }
.dark .bg-white.rounded-2xl .text-gray-500 { color: #6b7280; }
.dark .bg-white.rounded-2xl .text-gray-400 { color: #9ca3af; }
.dark .bg-white.rounded-2xl input[type="checkbox"],
.dark .bg-white.rounded-2xl input[type="radio"] {
  border-color: #d1d5db;
  background-color: white;
}
.dark .bg-white.rounded-2xl input[type="checkbox"]:checked,
.dark .bg-white.rounded-2xl input[type="radio"]:checked {
  background-color: #2563eb;
  border-color: #2563eb;
}

/* Button base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 150ms;
  cursor: pointer;
}

.btn-primary {
  background: #2563eb;
  color: white;
}
.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
}
.btn-secondary:hover {
  background: #f9fafb;
}

.btn-danger {
  background: #dc2626;
  color: white;
}
.btn-danger:hover {
  background: #b91c1c;
}

/* Alpine.js x-cloak: hide until Alpine initializes */
[x-cloak] {
  display: none !important;
}

/* ================================================================
   Tailwind Utility Supplements
   Classes missing from the prebuilt tailwind.min.css that are
   needed by auth and other redesigned templates.
   ================================================================ */

/* --- Layout & Grid -------------------------------------------- */
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.max-w-5xl  { max-width: 64rem; }
.rounded-2xl { border-radius: 1rem; }
.object-contain { object-fit: contain; }

/* --- Spacing -------------------------------------------------- */
.p-10   { padding: 2.5rem; }
.pr-4   { padding-right: 1rem; }
.pl-11  { padding-left: 2.75rem; }
.pl-3\.5 { padding-left: 0.875rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }

/* Negative space-x */
.-space-x-2 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 0;
  margin-right: calc(-0.5rem * var(--tw-space-x-reverse));
  margin-left: calc(-0.5rem * calc(1 - var(--tw-space-x-reverse)));
}

/* Arbitrary min-height */
.min-h-\[calc\(100vh-8rem\)\] { min-height: calc(100vh - 8rem); }

/* --- Typography ----------------------------------------------- */
.leading-tight   { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }

/* --- Gradient ------------------------------------------------- */
.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}
.from-blue-500 {
  --tw-gradient-from: #3b82f6;
  --tw-gradient-to: rgba(59, 130, 246, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.to-blue-700 {
  --tw-gradient-to: #1d4ed8;
}

/* --- Blue color palette --------------------------------------- */
.bg-blue-200  { background-color: #bfdbfe; }
.bg-blue-300  { background-color: #93c5fd; }
.bg-blue-500  { background-color: #3b82f6; }
.bg-blue-700  { background-color: #1d4ed8; }

.text-blue-50  { color: #eff6ff; }
.text-blue-100 { color: #dbeafe; }
.text-blue-600 { color: #2563eb; }
/* text-blue-800 already in tailwind.min.css */

.border-blue-400 { border-color: #60a5fa; }
.border-blue-500 { border-color: #3b82f6; }
.border-blue-600 { border-color: #2563eb; }

/* --- Opacity variants ----------------------------------------- */
.bg-white\/20       { background-color: rgba(255, 255, 255, 0.2); }
.border-blue-400\/30 { border-color: rgba(96, 165, 250, 0.3); }

/* --- Green accent --------------------------------------------- */
.text-green-300 { color: #86efac; }
.bg-green-400   { background-color: #4ade80; }

/* --- Purple accent -------------------------------------------- */
.bg-purple-400 { background-color: #c084fc; }

/* --- Orange accent -------------------------------------------- */
.bg-orange-400 { background-color: #fb923c; }

/* --- Yellow accent -------------------------------------------- */
.text-yellow-500 { color: #eab308; }

/* --- Extra blue shades ---------------------------------------- */
.text-blue-200 { color: #bfdbfe; }

/* --- Focus states --------------------------------------------- */
.focus\:border-blue-500:focus { border-color: #3b82f6; }
.focus\:ring-blue-200:focus   { --tw-ring-color: #bfdbfe; }
.focus\:ring-blue-500:focus   { --tw-ring-color: #3b82f6; }
/* focus:ring-offset-2 already in tailwind.min.css */

/* --- Focus-within states -------------------------------------- */
.focus-within\:ring-blue-200:focus-within   { --tw-ring-color: #bfdbfe; }
.focus-within\:border-blue-500:focus-within { border-color: #3b82f6; }

/* --- Hover states --------------------------------------------- */
.hover\:bg-blue-500:hover   { background-color: #3b82f6; }
.hover\:bg-blue-700:hover   { background-color: #1d4ed8; }
.hover\:text-blue-500:hover { color: #3b82f6; }
.hover\:text-blue-600:hover { color: #2563eb; }

/* --- Small fractional sizes ----------------------------------- */
.h-3\.5 { height: 0.875rem; }
.w-3\.5 { width: 0.875rem; }

/* --- Tracking (letter-spacing) -------------------------------- */
.tracking-\[0\.3em\] { letter-spacing: 0.3em; }

/* --- Red error border ----------------------------------------- */
.border-red-300 { border-color: #fca5a5; }

/* --- Blue palette supplements --------------------------------- */
.bg-blue-50   { background-color: #eff6ff; }
.bg-blue-100  { background-color: #dbeafe; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-500 { color: #3b82f6; }
.text-blue-400 { color: #60a5fa; }
.border-blue-100 { border-color: #dbeafe; }
.border-blue-200 { border-color: #bfdbfe; }
.border-blue-300 { border-color: #93c5fd; }
.ring-blue-100   { --tw-ring-color: #dbeafe; }
.hover\:bg-blue-50:hover { background-color: #eff6ff; }
.hover\:bg-blue-100:hover { background-color: #dbeafe; }
.hover\:border-blue-300:hover { border-color: #93c5fd; }

/* --- Toggle switch -------------------------------------------- */
.toggle-switch {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  background-color: #d1d5db;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 200ms;
}
.toggle-switch.active {
  background-color: #2563eb;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background: white;
  border-radius: 9999px;
  transition: transform 200ms;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.toggle-switch.active::after {
  transform: translateX(1.25rem);
}

/* --- Avatar hover overlay ------------------------------------- */
.avatar-upload {
  position: relative;
  cursor: pointer;
}
.avatar-upload .avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 200ms;
}
.avatar-upload:hover .avatar-overlay {
  opacity: 1;
}

/* --- Timeline connector (activity log) ------------------------ */
.timeline-item {
  position: relative;
  padding-left: 2rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 0.5625rem;
  top: 1.75rem;
  bottom: -0.75rem;
  width: 2px;
  background-color: #e5e7eb;
}
.timeline-item:last-child::before {
  display: none;
}
.timeline-dot {
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e5e7eb;
  background: white;
}

/* --- Card hover elevation ------------------------------------- */
.card-hover {
  transition: box-shadow 200ms, border-color 200ms;
}
.card-hover:hover {
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  border-color: #bfdbfe;
}

/* --- Page breadcrumb ------------------------------------------ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}
.breadcrumb a { color: #6b7280; text-decoration: none; }
.breadcrumb a:hover { color: #374151; }
.breadcrumb .separator { color: #d1d5db; }

/* --- Additional spacing --------------------------------------- */
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.pb-2  { padding-bottom: 0.5rem; }
.pt-6  { padding-top: 1.5rem; }
.mt-8  { margin-top: 2rem; }
.mb-6  { margin-bottom: 1.5rem; }
.mb-8  { margin-bottom: 2rem; }

/* --- Additional layout ---------------------------------------- */
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.min-w-0 { min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.grow { flex-grow: 1; }
.aspect-square { aspect-ratio: 1 / 1; }
.object-cover { object-fit: cover; }
.overflow-clip { overflow: clip; }
.break-all { word-break: break-all; }
.whitespace-nowrap { white-space: nowrap; }
.line-clamp-1 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.group:hover .group-hover\:opacity-100 { opacity: 1; }

/* --- Border & ring utilities ---------------------------------- */
.ring-2 { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); }
.ring-4 { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); }
.ring-white { --tw-ring-color: #fff; }
.ring-blue-600 { --tw-ring-color: #2563eb; }

/* --- Max-width constraints ------------------------------------ */
.max-w-xs  { max-width: 20rem; }
.max-w-sm  { max-width: 24rem; }
.max-w-md  { max-width: 28rem; }
.max-w-lg  { max-width: 32rem; }
.max-w-xl  { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }

/* --- Text overflow / truncate --------------------------------- */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-center { text-align: center; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.tracking-widest { letter-spacing: 0.1em; }
.tracking-wider { letter-spacing: 0.05em; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.overflow-x-auto { overflow-x: auto; }
.overflow-hidden { overflow: hidden; }

/* --- Orange colours (for pending status) ---------------------- */
.bg-orange-50 { background-color: #fff7ed; }
.text-orange-500 { color: #f97316; }
.text-orange-600 { color: #ea580c; }

/* --- Ring utilities ------------------------------------------- */
.ring-2 { box-shadow: 0 0 0 2px var(--tw-ring-color, #3b82f6); }
.ring-blue-500 { --tw-ring-color: #3b82f6; }

/* --- Position ------------------------------------------------- */
.relative { position: relative; }
.absolute { position: absolute; }

/* --- Translate ------------------------------------------------ */
.-translate-y-1\/2 { transform: translateY(-50%); }

/* --- Flex wrap ------------------------------------------------ */
.flex-wrap { flex-wrap: wrap; }
.gap-x-4 { column-gap: 1rem; }
.gap-y-1 { row-gap: 0.25rem; }

/* --- Divide --------------------------------------------------- */
.divide-y > :not([hidden]) ~ :not([hidden]) { border-top: 1px solid #f3f4f6; }
.divide-gray-100 > :not([hidden]) ~ :not([hidden]) { border-color: #f3f4f6; }

/* --- Responsive: sm (≥640px) - additional --------------------- */
@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
  .sm\:flex-col-reverse { flex-direction: column-reverse; }
  .sm\:items-center { align-items: center; }
  .sm\:justify-between { justify-content: space-between; }
  .sm\:justify-end { justify-content: flex-end; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:inline { display: inline; }
  .sm\:text-left { text-align: left; }
  .sm\:gap-4 { gap: 1rem; }
  .sm\:w-auto { width: auto; }
  .sm\:w-80 { width: 20rem; }
  .sm\:p-6 { padding: 1.5rem; }
  .sm\:ml-14 { margin-left: 3.5rem; }
  .sm\:max-w-sm { max-width: 24rem; }
}

/* --- Responsive: md (≥768px) ---------------------------------- */
@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:flex-row { flex-direction: row; }
  .md\:items-center { align-items: center; }
  .md\:justify-between { justify-content: space-between; }
  .md\:gap-6 { gap: 1.5rem; }
  .md\:text-left { text-align: left; }
}

/* --- Responsive: sm (≥640px) ---------------------------------- */
@media (min-width: 640px) {
  .sm\:p-8  { padding: 2rem; }
  .sm\:p-10 { padding: 2.5rem; }
}

/* --- Responsive: lg (≥1024px) --------------------------------- */
@media (min-width: 1024px) {
  .lg\:flex    { display: flex; }
  .lg\:grid    { display: grid; }
  .lg\:block   { display: block; }
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lg\:flex-col    { flex-direction: column; }
  .lg\:justify-between { justify-content: space-between; }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:col-span-3 { grid-column: span 3 / span 3; }
  .lg\:p-10 { padding: 2.5rem; }
  .lg\:p-12 { padding: 3rem; }
}
