/* 1:1 port of the SPA's globals.css (Tailwind v4 theme variables + base styles). */

:root {
  --background: #ffffff;
  --foreground: #171717;
  /* CFPB brand green (was orange from the old SPA — aligned with the rebrand). */
  --primary: #16a34a;
  --primary-foreground: #ffffff;
  --secondary: #f1f5f9;
  --secondary-foreground: #0f172a;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --accent: #f1f5f9;
  --accent-foreground: #0f172a;
  --ring: #16a34a;
  --input: #e2e8f0;
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-ring: var(--ring);
  --color-input: var(--input);
}

/* Admin UI is intentionally light-only — no dark-mode override (it clashed with the
   white cards / gray surfaces and made some areas render on a near-black body). */

body {
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Global input and select styles to ensure dark grey text */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select {
  color: #374151; /* text-gray-700 */
}

/* Ensure placeholder text is also styled properly */
input::placeholder,
textarea::placeholder {
  color: #9ca3af; /* text-gray-400 */
}

/* --- Form design system ----------------------------------------------------
   Shared form components so every form partial looks identical. Plain CSS (the
   Tailwind browser build does not process this file), so edit here to restyle
   ALL forms at once. Usage:
     <div class="form-row"> <label class="form-label">…</label>
       <input class="form-control" …> <p class="form-hint">…</p> </div>
     <div class="form-actions">
       <button class="btn btn-secondary">Zrušit</button>
       <button class="btn btn-primary">Uložit</button> </div>
--------------------------------------------------------------------------- */

/* Body padding of a form (the modal already pads, but standalone forms use this). */
.app-form { display: flex; flex-direction: column; gap: 1.1rem; }
.app-form .form-row + .form-row { margin-top: 0; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.375rem;
}
.form-label .req { color: #ef4444; margin-left: 2px; }

.form-control {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  color: #111827;
  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0.625rem;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
textarea.form-control { min-height: 5rem; resize: vertical; }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.17l3.71-3.94a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1.1em;
  padding-right: 2.25rem;
}
.form-control::placeholder { color: #9ca3af; }
.form-control:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.form-control:disabled { background-color: #f9fafb; color: #9ca3af; cursor: not-allowed; }
.form-control.is-invalid { border-color: #ef4444; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }

.form-hint { margin-top: 0.3rem; font-size: 0.75rem; color: #6b7280; }
.form-error { margin-top: 0.3rem; font-size: 0.75rem; color: #dc2626; }

/* Two-column grid inside a form (e.g. time-from / time-to). */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Footer with right-aligned action buttons. */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.625rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background-color: #16a34a; color: #fff; }
.btn-primary:hover:not(:disabled) { background-color: #15803d; }
.btn-secondary { background-color: #fff; color: #374151; border-color: #d1d5db; }
.btn-secondary:hover:not(:disabled) { background-color: #f9fafb; }
.btn-danger { background-color: #dc2626; color: #fff; }
.btn-danger:hover:not(:disabled) { background-color: #b91c1c; }

/* Info / note callout shared by several forms. */
.form-info {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.625rem;
  font-size: 0.8125rem;
  color: #1d4ed8;
}
.form-info svg { flex-shrink: 0; }

/* --- Global UI polish ------------------------------------------------------ */

/* Buttons: a touch of depth + a tactile press. */
.btn-primary { box-shadow: 0 1px 2px rgba(22, 163, 74, 0.28); }
.btn-danger  { box-shadow: 0 1px 2px rgba(220, 38, 38, 0.28); }
.btn:active:not(:disabled) { transform: translateY(1px); }

/* Consistent keyboard-focus ring across links & buttons (a11y + polish). */
a:focus-visible, button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.35);
}

/* Smooth colour/background transitions app-wide where no utility sets one. */
a, button { transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }

/* Slimmer, softer scrollbars (sidebar, tables, calendar). */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
*::-webkit-scrollbar-track { background: transparent; }

/* Gentle entrance for toasts / panels. */
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Modal pop-in. */
@keyframes modalpop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }

/* FullCalendar tuning to match the app's green accent + softer chrome. */
.fc { --fc-border-color: #eef2f7; --fc-today-bg-color: #f0fdf4; }
.fc .fc-button-primary {
  background-color: #16a34a; border-color: #16a34a; text-transform: none; font-weight: 600;
  box-shadow: none;
}
.fc .fc-button-primary:not(:disabled):hover { background-color: #15803d; border-color: #15803d; }
.fc .fc-button-primary:not(:disabled).fc-button-active { background-color: #166534; border-color: #166534; }
.fc .fc-button-primary:disabled { background-color: #86efac; border-color: #86efac; }
.fc .fc-toolbar-title { font-size: 1.1rem; font-weight: 700; color: #111827; text-transform: capitalize; }
.fc .fc-col-header-cell-cushion { color: #6b7280; font-weight: 600; text-transform: uppercase; font-size: .7rem; padding: 8px; }
.fc .fc-daygrid-day-number { color: #374151; font-weight: 600; }
.fc .fc-event { border-radius: 5px; padding: 1px 5px; font-weight: 600; font-size: .72rem; line-height: 1.25; cursor: pointer; }
.fc .fc-event:hover { filter: brightness(0.95); }
/* Make the colored block (not just a dot) fill the chip in month view for readability. */
.fc .fc-daygrid-event .fc-event-time { font-weight: 700; margin-right: 2px; }
.fc .fc-daygrid-event-dot { display: none; }
.fc .fc-daygrid-block-event .fc-event-title { font-weight: 600; }
.fc .fc-more-link { font-size: .7rem; font-weight: 700; color: #16a34a; }
.fc-theme-standard td, .fc-theme-standard th { border-color: #eef2f7; }
