/* Public UI Redesign - Modern Design System */
/* ! -------------------------------------------- ! */
/* !  Color Variables (adjust to match your brand)  ! */
/* ! -------------------------------------------- ! */

:root {
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --primary: 215 45% 72%;     /* Primary action color - softened for dark admin */
  --primary-foreground: 220 20% 12%; /* Text on primary */
  --secondary: 210 30% 15%;   /* Secondary backgrounds */
  --secondary-foreground: 0 0% 100%; /* Text on secondary */
  --muted: 215 20% 25%;       /* Muted/secondary text */
  --muted-foreground: 215 25% 55%; /* Secondary text */
  --accent: 30 80% 60%;       /* Accent color */
  --background: 220 20% 12%;    /* Page background */
  --foreground: 0 0% 98%; /* Main text */
  --border: 215 25% 25%;      /* Form borders */
  --input: 215 28% 20%;       /* Input backgrounds */
  --card: 215 25% 16%;          /* Card backgrounds */
  --card-foreground: 0 0% 98%; /* Card text */
  --popover: 215 25% 16%;       /* Popover/modal */
  --popover-foreground: 0 0% 98%; /* Popover text */
  --ring: 215 45% 72%;        /* Focus rings */
  --radius: 0.5rem;           /* Border radius default */
  --radius-sm: 0.375rem;     /* Small radius */
  --radius-lg: 0.75rem;      /* Large radius */
}

@media (prefers-color-scheme: dark) {
  html { color-scheme: dark; }
}

/* ! -------------------------------------------- ! */
/* !  Base Reset & Typography                     ! */
/* ! -------------------------------------------- ! */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
}

html[style*="--site-bg-image"] body {
  background-color: transparent !important;
}

/* Fixed background on html::before: stays put while body scrolls,
   avoids background-attachment:fixed jank and z-index stacking issues. */
html[style*="--site-bg-image"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(12, 14, 18, 0.72), rgba(12, 14, 18, 0.72)),
    var(--site-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}

html[style*="--site-bg-image"] body {
  position: relative;
  z-index: 1;
}

/* Let the page background show through main wrappers, but keep
   overlays/popovers/menus opaque for readability. */
html[style*="--site-bg-image"] main,
html[style*="--site-bg-image"] .content,
html[style*="--site-bg-image"] #containerSearchMobile,
html[style*="--site-bg-image"] footer {
  background-color: transparent !important;
}

html[style*="--site-bg-image"] .bg-card {
  background-color: hsl(var(--card) / 0.90) !important;
}

html[style*="--site-bg-image"] .bg-muted {
  background-color: hsl(var(--muted) / 0.86) !important;
}

h1, h2, h3, h4, h5, h6 {
  color: hsl(var(--foreground));
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p {
  line-height: 1.7;
}

p, ul, ol, dl {
  line-height: 1.6;
}

/* ! -------------------------------------------- ! */
/* !  Link Styles                                 ! */
/* ! -------------------------------------------- ! */

a {
  color: hsl(var(--primary));
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: hsl(var(--accent));
}

/* ! -------------------------------------------- ! */
/* !  Button Styles                               ! */
/* ! -------------------------------------------- ! */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  background-color: color-mix(in srgb, hsl(var(--primary)) 80%, black);
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
}

.btn-secondary:hover {
  background-color: color-mix(in srgb, hsl(var(--secondary)) 80%, black);
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--muted-foreground));
}

.btn-ghost:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--muted));
}

/* ! -------------------------------------------- ! */
/* !  Card Styles                                 ! */
/* ! -------------------------------------------- ! */

.card {
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
}

/* ! -------------------------------------------- ! */
/* !  Input & Form Styles                         ! */
/* ! -------------------------------------------- ! */

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  background-color: hsl(var(--input));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px color-mix(in srgb, hsl(var(--primary)) 15%, transparent);
  outline: none;
}

.input-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
}

.input-lg {
  padding: 1rem;
  font-size: 1rem;
}

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: hsl(var(--muted-foreground));
}

/* ! -------------------------------------------- ! */
/* !  Badge & Tag Styles                          ! */
/* ! -------------------------------------------- ! */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background-color: color-mix(in srgb, hsl(var(--primary)) 10%, transparent);
  color: hsl(var(--primary));
}

.badge-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

/* ! -------------------------------------------- ! */
/* !  Nav & Link Utilities                        ! */
/* ! -------------------------------------------- ! */

.nav-link {
  position: relative;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: hsl(var(--primary));
  transition: width 0.2s ease;
}

.nav-link:hover {
  color: hsl(var(--foreground));
}

.nav-link:hover::after {
  width: 100%;
}

/* ! -------------------------------------------- ! */
/* !  Utility Helpers                             ! */
/* ! -------------------------------------------- ! */

.bg-primary {
  background-color: hsl(var(--primary));
}

.bg-secondary {
  background-color: hsl(var(--secondary));
}

.bg-muted {
  background-color: hsl(var(--muted));
}

.text-primary {
  color: hsl(var(--primary));
}

.text-secondary {
  color: hsl(var(--secondary));
}

.text-muted {
  color: hsl(var(--muted));
}

.text-muted-foreground {
  color: hsl(var(--muted-foreground));
}

.text-foreground {
  color: hsl(var(--foreground));
}

.border-primary {
  border-color: hsl(var(--primary));
}

.border-secondary {
  border-color: hsl(var(--secondary));
}

.border-muted {
  border-color: hsl(var(--muted));
}

.rounded {
  border-radius: var(--radius);
}

.rounded-sm {
  border-radius: var(--radius-sm);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.shadow-sm {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ! -------------------------------------------- ! */
/* !  Responsive Utilities                        ! */
/* ! -------------------------------------------- ! */

@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ! -------------------------------------------- ! */
/* !  Focus States                                ! */
/* ! -------------------------------------------- ! */

*:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

/* ! -------------------------------------------- ! */
/* !  Reduced Motion                              ! */
/* ! -------------------------------------------- ! */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}