/**
 * assets/css/contrast-lock.css
 * QBO Hacks — Global High-Contrast Enforcer & Zero Washed-Out CSS Lock
 * Strictly prevents faded gray text, low-opacity elements, and invisible borders.
 */

/* ==========================================================================
   1. GLOBAL FONT SMOOTHING & LEGIBILITY
   ========================================================================== */
*, *::before, *::after {
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: optimizeLegibility !important;
}

:root {
  --font-primary: 'Plus Jakarta Sans', 'Noto Sans Bengali', sans-serif;
  --muted: #F1F5F9;
  --muted-foreground: #334155;
  --border: #CBD5E1;
  --input: #94A3B8;
  --ring: #2563EB;
}

/* ==========================================================================
   2. ELIMINATE WASHED-OUT / FADED TEXT ON LIGHT BACKGROUNDS
   ========================================================================== */

/* Overriding low-contrast Tailwind light gray utilities on general / light pages */
body:not(.dark) .text-gray-400,
body:not(.dark) .text-slate-400,
body:not(.dark) .text-zinc-400,
body:not(.dark) .text-neutral-400 {
  color: #334155 !important; /* Deep crisp slate-700 instead of faded 400 */
}

body:not(.dark) .text-gray-300,
body:not(.dark) .text-slate-300,
body:not(.dark) .text-zinc-300,
body:not(.dark) .text-neutral-300 {
  color: #1E293B !important; /* Sharp charcoal slate-800 instead of faded 300 */
}

body:not(.dark) .text-gray-500,
body:not(.dark) .text-slate-500 {
  color: #334155 !important; /* Crisp slate-700 for optimal readability */
}

/* Eliminate low-opacity text filters that cause washed-out appearances */
body:not(.dark) [class*="opacity-40"],
body:not(.dark) [class*="opacity-50"],
body:not(.dark) [class*="opacity-60"],
body:not(.dark) [class*="opacity-70"] {
  opacity: 1 !important;
}

/* Base Body Text */
body {
  color: #1E293B !important;
  background-color: #F8FAFC;
}

p, span:not([class*="bg-"]):not([class*="text-white"]):not([class*="text-emerald"]):not([class*="text-blue"]):not([class*="text-amber"]):not([class*="text-rose"]):not([class*="text-cyan"]), li {
  color: inherit;
}

/* Headings & Labels */
h1, h2, h3, h4, h5, h6 {
  color: #0F172A !important;
  font-weight: 800 !important;
  letter-spacing: -0.015em;
}

label, .form-label {
  color: #0F172A !important;
  font-weight: 700 !important;
  font-size: 0.875rem;
}

/* ==========================================================================
   3. HIGH CONTRAST ON DARK CONTAINERS & HERO BANNERS
   ========================================================================== */
.dark,
[data-theme="dark"],
[class*="bg-slate-9"],
[class*="bg-gray-9"],
[class*="bg-slate-8"],
[class*="bg-emerald-9"],
[class*="bg-teal-9"],
[class*="bg-blue-9"],
.bg-black {
  color: #F8FAFC !important;
}

.dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6,
[class*="bg-slate-9"] h1, [class*="bg-slate-9"] h2, [class*="bg-slate-9"] h3, [class*="bg-slate-9"] h4,
[class*="bg-gray-9"] h1, [class*="bg-gray-9"] h2, [class*="bg-gray-9"] h3, [class*="bg-gray-9"] h4,
[class*="bg-emerald-9"] h1, [class*="bg-emerald-9"] h2, [class*="bg-emerald-9"] h3, [class*="bg-emerald-9"] h4,
.bg-black h1, .bg-black h2, .bg-black h3, .bg-black h4 {
  color: #FFFFFF !important;
}

.dark p, .dark span:not([class*="badge"]),
[class*="bg-slate-9"] p, [class*="bg-slate-9"] span:not([class*="badge"]):not([class*="text-"]):not([class*="bg-"]),
[class*="bg-gray-9"] p, [class*="bg-gray-9"] span:not([class*="badge"]):not([class*="text-"]):not([class*="bg-"]),
[class*="bg-emerald-9"] p, [class*="bg-emerald-9"] span:not([class*="badge"]):not([class*="text-"]):not([class*="bg-"]) {
  color: #E2E8F0 !important; /* Crisp light slate, never washed out */
}

.dark .text-gray-400,
.dark .text-slate-400,
[class*="bg-slate-9"] .text-gray-400,
[class*="bg-slate-9"] .text-slate-400,
[class*="bg-emerald-9"] .text-gray-300 {
  color: #CBD5E1 !important; /* Slate-300 minimum on dark */
}

/* ==========================================================================
   4. DEFINED BORDERS & CRISP FORM INPUT CONTROLS
   ========================================================================== */

/* Form Input Elements */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="url"],
input[type="search"],
select,
textarea {
  color: #0F172A !important;
  background-color: #FFFFFF !important;
  border: 1.5px solid #94A3B8 !important; /* Slate-400 solid defined border */
  border-radius: 0.65rem;
  font-weight: 500 !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #2563EB !important;
  outline: 2px solid #2563EB !important;
  outline-offset: 1px !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important;
}

/* Crisp, readable placeholders */
input::placeholder,
textarea::placeholder {
  color: #475569 !important; /* Slate-600 */
  opacity: 1 !important;
  font-weight: 500 !important;
}

/* Select Dropdown Options */
select option {
  color: #0F172A !important;
  background-color: #FFFFFF !important;
  font-weight: 600 !important;
}

/* ==========================================================================
   5. CARDS, PANELS, MODALS & TABLES
   ========================================================================== */

/* Replace weak invisible borders with crisp slate-300 */
.border-gray-100,
.border-gray-200,
.border-slate-100,
.border-slate-200 {
  border-color: #CBD5E1 !important;
}

.card,
.panel,
.bg-white.rounded-2xl.border,
.bg-white.rounded-xl.border {
  border-color: #CBD5E1 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
}

/* Tables */
table {
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  color: #0F172A !important;
  font-weight: 700 !important;
  background-color: #F1F5F9 !important;
  border-bottom: 2px solid #94A3B8 !important;
  letter-spacing: 0.03em;
}

tbody td {
  color: #1E293B !important;
  border-bottom: 1px solid #E2E8F0 !important;
}

tbody tr:hover {
  background-color: #F8FAFC !important;
}

/* ==========================================================================
   6. VIBRANT BADGES, PILLS & BUTTONS
   ========================================================================== */

/* Badges */
.badge,
[class*="rounded-full"][class*="text-"] {
  font-weight: 700 !important;
  letter-spacing: 0.015em;
}

/* Buttons */
button,
.btn,
a[class*="btn-"],
a[class*="bg-primary"],
button[class*="bg-primary"] {
  font-weight: 700 !important;
  letter-spacing: 0.01em;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid #2563EB !important;
  outline-offset: 2px !important;
}

/* ==========================================================================
   7. CAREER GENERATOR & KANBAN CARDS SHARPNESS
   ========================================================================== */
.trainee-card {
  border: 1.5px solid #CBD5E1 !important;
  background: #FFFFFF !important;
  color: #0F172A !important;
}

.trainee-name {
  color: #0F172A !important;
  font-weight: 800 !important;
}

.trainee-role {
  color: #334155 !important;
  font-weight: 600 !important;
}

.column-title {
  color: #0F172A !important;
  font-weight: 800 !important;
}
