/* ===========================================================================
   Talent Kaki Portal — Tweakcn Theme System
   Modern design tokens with dark mode support
   =========================================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Source+Serif+4:wght@400;600&family=Outfit:wght@400;500;600;700&display=swap');

/* Theme Tokens - Light Mode */
:root {
  --background: #ffffff;
  --foreground: #333333;
  --card: #ffffff;
  --card-foreground: #333333;
  --popover: #ffffff;
  --popover-foreground: #333333;
  --primary: #2474f5;
  --primary-foreground: #ffffff;
  --secondary: #f3f4f6;
  --secondary-foreground: #4b5563;
  --muted: #f9fafb;
  --muted-foreground: #6b7280;
  --accent: #e0f2fe;
  --accent-foreground: #1a4f9c;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #e5e7eb;
  --input: #e5e7eb;
  --ring: #2474f5;
  --chart-1: #2474f5;
  --chart-2: #1a5fda;
  --chart-3: #154ab5;
  --chart-4: #103a90;
  --chart-5: #0a2a6b;
  --sidebar: #f9fafb;
  --sidebar-foreground: #333333;
  --sidebar-primary: #2474f5;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #e0f2fe;
  --sidebar-accent-foreground: #1a4f9c;
  --sidebar-border: #e5e7eb;
  --sidebar-ring: #2474f5;
  --font-sans: Inter, sans-serif;
  --font-serif: Source Serif 4, serif;
  --font-mono: JetBrains Mono, monospace;
  --font-display: Outfit, sans-serif;
  --radius: 0.375rem;
  --shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
  --shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
  --shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
  --shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
  --shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 2px 4px -1px hsl(0 0% 0% / 0.10);
  --shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 4px 6px -1px hsl(0 0% 0% / 0.10);
  --shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 8px 10px -1px hsl(0 0% 0% / 0.10);
  --shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);

  /* Button hover states */
  --primary-hover: #2474f5;
  --primary-active: #1a5fda;
}

/* Theme Tokens - Dark Mode */
.dark {
  --background: #171717;
  --foreground: #e5e5e5;
  --card: #262626;
  --card-foreground: #e5e5e5;
  --popover: #262626;
  --popover-foreground: #e5e5e5;
  --primary: #2474f5;
  --primary-foreground: #ffffff;
  --secondary: #262626;
  --secondary-foreground: #e5e5e5;
  --muted: #1f1f1f;
  --muted-foreground: #a3a3a3;
  --accent: #1a4f9c;
  --accent-foreground: #bfdbfe;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #404040;
  --input: #404040;
  --ring: #2474f5;
  --chart-1: #5a9fff;
  --chart-2: #2474f5;
  --chart-3: #1a5fda;
  --chart-4: #154ab5;
  --chart-5: #103a90;
  --sidebar: #171717;
  --sidebar-foreground: #e5e5e5;
  --sidebar-primary: #2474f5;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #1a4f9c;
  --sidebar-accent-foreground: #bfdbfe;
  --sidebar-border: #404040;
  --sidebar-ring: #2474f5;

  /* Button hover states */
  --primary-hover: #2474f5;
  --primary-active: #1a5fda;
}

/* Base Styles */
* {
  border-color: var(--border);
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
}

/* Ensure [hidden] always hides, even when a framework adds display utilities */
[hidden] {
  display: none !important;
}

/* Modal fade/scale-in */
#detail-modal:not([hidden]) .modal-panel,
#lead-modal:not([hidden]) > div {
  animation: modal-in 0.18s ease-out;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Thin, subtle scrollbar for the detail modal's scrollable body */
.modal-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--muted-foreground) transparent;
}

.modal-scroll::-webkit-scrollbar {
  width: 6px;
}

.modal-scroll::-webkit-scrollbar-thumb {
  background-color: var(--muted-foreground);
  border-radius: 9999px;
}

.modal-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* Inline error highlight for lead form inputs */
.input-error {
  border-color: var(--destructive) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--destructive) 15%, transparent);
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Smooth theme transitions */
* {
  transition-property: background-color, border-color, color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}