/*
 * theme-polish.css
 * Additive visual refinements layered on top of main.css (DaisyUI 4 / Tailwind).
 * Purely cosmetic — no markup or behaviour is changed.
 *
 * NOTE: semantic colors (success / warning / error / info) are intentionally
 * left untouched — they encode risk levels across the GRC app.
 */

/* ============================================================
 * 1. Theme palette refinement (OKLCH: "L% C H", DaisyUI format)
 * ============================================================ */

[data-theme="dark"] {
  /* Deeper, more layered surfaces (keeps b1 > b2 > b3 ordering) */
  --b1: 26% 0.019 264;   /* main surface / cards   */
  --b2: 21.5% 0.02 264;  /* sidebar / grouped bg   */
  --b3: 16.5% 0.018 264; /* borders / deepest      */
  --bc: 89.5% 0.013 248; /* brighter body text     */
  /* A slightly more vivid indigo-blue primary */
  --p: 60% 0.195 262;
  --pc: 98% 0 0;
  --rounded-btn: 0.6rem;
}

[data-theme="light"] {
  --b2: 98.4% 0.003 255;
  --b3: 94.2% 0.006 256; /* more visible borders   */
  --bc: 30% 0.035 256;   /* darker, crisper text   */
  --p: 55% 0.205 262;
  --pc: 99% 0 0;
  --rounded-btn: 0.6rem;
}

/* ============================================================
 * 2. Global typography & rendering
 * ============================================================ */

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .card-title {
  letter-spacing: -0.01em;
}

/* ============================================================
 * 3. Custom scrollbars (themed, slim)
 *    .no-scrollbar (class selector) still wins where used.
 * ============================================================ */

* {
  scrollbar-width: thin;
  scrollbar-color: oklch(var(--bc) / 0.22) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: oklch(var(--bc) / 0.18);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: oklch(var(--bc) / 0.34);
  background-clip: padding-box;
}

/* ============================================================
 * 4. Cards — soft elevation & smooth transitions
 * ============================================================ */

.card {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card.bg-base-100,
.card.bg-base-200 {
  box-shadow: 0 1px 2px oklch(0% 0 0 / 0.05),
              0 6px 20px -10px oklch(0% 0 0 / 0.18);
}

.card.bg-base-100:hover,
.card.bg-base-200:hover {
  box-shadow: 0 2px 4px oklch(0% 0 0 / 0.06),
              0 10px 28px -10px oklch(0% 0 0 / 0.28);
}

/* ============================================================
 * 5. Buttons — smoother motion & subtle depth
 * ============================================================ */

.btn {
  transition-property: color, background-color, border-color, box-shadow, transform;
  transition-duration: 0.15s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  box-shadow: 0 1px 2px oklch(0% 0 0 / 0.12),
              0 4px 12px -4px oklch(var(--p) / 0.4);
}

.btn-primary:hover {
  box-shadow: 0 2px 14px -3px oklch(var(--p) / 0.55);
}

/* ============================================================
 * 6. Form controls — soft focus ring
 * ============================================================ */

.input:focus,
.input:focus-within,
.textarea:focus,
.select:focus,
.input-bordered:focus {
  outline: none;
  border-color: oklch(var(--p));
  box-shadow: 0 0 0 3px oklch(var(--p) / 0.18);
}

/* ============================================================
 * 7. Tables — crisper headers, gentle row hover
 * ============================================================ */

.table thead th {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  font-weight: 600;
  opacity: 0.85;
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

/* ============================================================
 * 8. Overlays — modals & dropdowns get real depth
 * ============================================================ */

.modal-box {
  box-shadow: 0 24px 60px -15px oklch(0% 0 0 / 0.5);
}

.dropdown-content,
.menu.bg-base-100,
.menu.bg-base-200 {
  box-shadow: 0 10px 30px -12px oklch(0% 0 0 / 0.35);
}

/* ============================================================
 * 9. Keyboard accessibility — visible focus
 * ============================================================ */

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid oklch(var(--p) / 0.6);
  outline-offset: 2px;
}

/* ============================================================
 * 10. Extra selectable themes (full DaisyUI variable sets)
 *     Defined here so no Tailwind rebuild is needed. The risk
 *     semantic colors (info / success / warning / error) are kept
 *     identical across every theme so risk levels stay consistent.
 * ============================================================ */

/* --- midnight : premium deep-violet dark --- */
[data-theme="midnight"] {
  color-scheme: dark;
  --p: 62% 0.2 277;     --pc: 98% 0 0;
  --s: 70% 0.13 200;    --sc: 15% 0.02 200;
  --a: 74% 0.15 55;     --ac: 16% 0.03 55;
  --n: 27% 0.03 277;    --nc: 88% 0.02 277;
  --b1: 21% 0.026 276;
  --b2: 17% 0.026 276;
  --b3: 13.5% 0.024 276;
  --bc: 90% 0.02 270;
  --in: 77.8611% 0.105438 201.419646;  --inc: 15.5722% 0.021088 201.419646;
  --su: 72.2746% 0.192007 149.57933;   --suc: 30.8627% 0.011563 264.391386;
  --wa: 79.5243% 0.161668 86.046788;   --wac: 30.8627% 0.011563 264.391386;
  --er: 69.1473% 0.191138 23.880962;   --erc: 30.8627% 0.011563 264.391386;
  --rounded-box: 1rem;
  --rounded-btn: 0.6rem;
  --rounded-badge: 1.9rem;
}

/* --- emerald : clean light, green compliance accent --- */
[data-theme="emerald"] {
  color-scheme: light;
  --p: 58% 0.15 159;    --pc: 99% 0 0;
  --s: 50% 0.13 230;    --sc: 99% 0 0;
  --a: 60% 0.13 33;     --ac: 99% 0 0;
  --n: 30% 0.03 175;    --nc: 96% 0.01 175;
  --b1: 100% 0 0;
  --b2: 97.6% 0.005 175;
  --b3: 93.5% 0.008 175;
  --bc: 27% 0.03 175;
  --in: 77.8611% 0.105438 201.419646;  --inc: 15.5722% 0.021088 201.419646;
  --su: 72.2746% 0.192007 149.57933;   --suc: 30.8627% 0.011563 264.391386;
  --wa: 79.5243% 0.161668 86.046788;   --wac: 30.8627% 0.011563 264.391386;
  --er: 69.1473% 0.191138 23.880962;   --erc: 30.8627% 0.011563 264.391386;
  --rounded-box: 1rem;
  --rounded-btn: 0.6rem;
  --rounded-badge: 1.9rem;
}
