@import "tailwindcss";
@import "tw-animate-css";

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);
  --font-cormorant: var(--font-cormorant);
  --font-lato: var(--font-lato);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

@custom-variant dark (&:is(.dark *));

:root {
  --background: #ffffff;
  --foreground: #171717;

  --brand-dark: #0c4346;
  --brand-gold: #ddbc5f;
  --radius: 0.625rem;
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  /* --primary: oklch(0.205 0 0); */
  --primary: #0c4346;
  --primary-foreground: oklch(0.985 0 0);
  --secondary: #ddbc5f;
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-brand-dark: var(--brand-dark);
  --color-brand-gold: var(--brand-gold);

  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);
}

/* @media (prefers-color-scheme: dark) {
  :root {
    --background: #000;
    --foreground: #ededed;
    --color-white: #000;
  }
} */

body {
  /* background: var(--background); */
  /* background: url("/images/body.jpg"); */
  background-size: 1200px;
  color: var(--foreground);
  font-family: var(--font-lato), Helvetica, sans-serif;
}

/* .dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
} */

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}

/* 👇 Add standard utility classes */
.font-cormorant {
  font-family: var(--font-cormorant);
}
.font-lato {
  font-family: var(--font-lato);
}
.text-brand-dark {
  color: var(--color-brand-dark);
}
.text-brand-gold {
  color: var(--color-brand-gold);
}
.bg-brand-dark {
  background-color: var(--color-brand-dark);
}
.bg-brand-gold {
  background-color: var(--color-brand-gold);
}
.text-danger,
.border-danger {
  @apply text-red-500;
}

.border-danger {
  @apply border-red-500;
}

@layer base {
  :root {
    --sidebar-background: 0 0% 98%;
    --sidebar-foreground: 240 5.3% 26.1%;
    --sidebar-primary: 240 5.9% 10%;
    --sidebar-primary-foreground: 0 0% 98%;
    --sidebar-accent: 240 4.8% 95.9%;
    --sidebar-accent-foreground: 240 5.9% 10%;
    --sidebar-border: 220 13% 91%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }

  .dark {
    --sidebar-background: 240 5.9% 10%;
    --sidebar-foreground: 240 4.8% 95.9%;
    --sidebar-primary: 224.3 76.3% 48%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 240 3.7% 15.9%;
    --sidebar-accent-foreground: 240 4.8% 95.9%;
    --sidebar-border: 240 3.7% 15.9%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }
}

/* @keyframes shakeX {
  0%,
  100% {
    transform: translateX(0);
  }
  15% {
    transform: translateX(-6px);
  }
  30% {
    transform: translateX(6px);
  }
  45% {
    transform: translateX(-4px);
  }
  60% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
  90% {
    transform: translateX(2px);
  }
} */
@keyframes shakeX {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  50% {
    transform: translateX(6px);
  }
  75% {
    transform: translateX(-4px);
  }
  90% {
    transform: translateX(2px);
  }
}

.animate-shake-x:hover {
  animation: shakeX 0.8s ease-in-out;
}

/* Tree component */
.tree-view {
  --line-width: 1px;
  --line-color: #e5e7eb;
  --node-padding: 16px;
}

.tree-node {
  position: relative;
}

/* Optional: Hover effect for the lines */
.tree-view:hover .tree-line {
  --line-color: #d1d5db;
}

/* ======================================================================================= */
/* ======================================================================================= */
/* ======================================================================================= */
/* ======================================================================================= */
/* ======================================================================================= */
/* ======================================================================================= */

.custom-input-wrapper {
  /* Provide global wrapper context if needed; otherwise remove */
}

.custom-input {
  position: relative;
  width: 100%;
  margin-bottom: 16px;
}

.custom-input.has-error .custom-input-container {
  border-color: #dc3545;
}

.custom-input.disabled {
  opacity: 1; /* Keep text readable */
  cursor: not-allowed;
}

.custom-input.disabled .custom-input-container {
  background-color: #f8f9fa; /* Light gray background */
  border-color: #d1d5db; /* Soft border */
  pointer-events: none;
}

.custom-input.disabled .custom-input-element {
  background-color: transparent;
  color: rgba(33, 37, 41, 0.5); /* Grayish text color */
  cursor: not-allowed;
}

.custom-input.disabled .custom-input-label {
  color: rgba(33, 37, 41, 0.5); /* Grayish label */
}

.custom-input.disabled .custom-input-icon-left,
.custom-input.disabled .custom-input-icon-right {
  color: #9ca3af; /* Dim icons */
  pointer-events: none;
}

.custom-input-container {
  position: relative;
  min-height: 30px;
  background-color: white;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  padding: 4px 6px;
}

/* Focus ring on container */
.custom-input-container:focus-within:not(.disabled) {
  border-color: #0d6efd;
  box-shadow: 0 0 0 1px #0d6efd;
  outline: none;
}

.custom-input-label {
  display: block;
  color: #374151;
}

.custom-input.disabled .custom-input-label-floating,
.custom-input.disabled .custom-input-label {
  color: rgba(33, 37, 41, 0.5);
}

.custom-input-required-asterisk {
  color: red;
  margin-left: 2px;
}

.custom-input-label-floating {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-55%);
  pointer-events: none;
  transition: 0.2s ease all;
  font-size: 0.875rem;
  color: black;
  margin-bottom: 0;
}

.custom-input-label-floating.floated {
  top: 0;
  background-color: white;
  padding: 0 5px;
  border-radius: 5px;
}

.custom-input.disabled .custom-input-label-floating.floated {
  background-color: gray;
}

.custom-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.custom-input-element {
  flex: 1;
  border: none;
  padding: 2px 4px;
  font-size: 0.75rem;
  background: transparent;
  min-height: 24px;
}

.custom-input-element:focus {
  outline: none;
}

.custom-input-icon-left,
.custom-input-icon-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.875rem;
}

.custom-input-icon-left {
  left: 6px;
}

.custom-input-icon-right {
  right: 6px;
  pointer-events: auto;
}

.with-icon-left {
  padding-left: 1.5rem !important;
}
.with-icon-right {
  padding-right: 1.5rem !important;
}

.custom-input-error-text {
  color: #dc3545;
  text-align: end;
  font-size: 12px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.custom-input-helper-text {
  color: #6b7280;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.custom-input.small .custom-input-element {
  font-size: 0.7rem;
  padding: 2px 4px;
}

.custom-input.medium .custom-input-element {
  font-size: 0.75rem;
  padding: 4px 6px;
}

.custom-input.large .custom-input-element {
  font-size: 0.875rem;
  padding: 3px 6px;
}

.custom-input.outlined .custom-input-container {
  /* "outlined" might be the default so no changes needed here. */
}

.custom-input.filled .custom-input-container {
  background-color: #f3f4f6;
  border: none;
}

.custom-input.standard .custom-input-container {
  border: none;
  border-bottom: 1px solid #495057;
  border-radius: 0;
}

.custom-input.has-error .custom-input-label {
  color: #dc3545;
}

/* Animation  */
@layer utilities {
  .animate-marquee {
    animation: marquee 10s linear infinite;
  }

  @keyframes marquee {
    0% {
      transform: translateX(0%);
    }
    100% {
      transform: translateX(-50%);
    }
  }
}

/* Custom Scrollbar Styles */
@layer base {
  ::-webkit-scrollbar {
    width: 6px;
    height: 8px;
    display: none;
  }

  ::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 2px;
    display: none;
  }

  ::-webkit-scrollbar-track {
    background-color: var(--color-background);
    display: none;
  }

  ::-webkit-scrollbar-corner {
    background-color: var(--color-background);
    display: none;
  }
}
