@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";

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

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-sans);
  --font-serif: var(--font-serif);
  --font-mono: var(--font-geist-mono);
  --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);
  --radius-2xl: calc(var(--radius) + 8px);
  --radius-3xl: calc(var(--radius) + 12px);
  --radius-4xl: calc(var(--radius) + 16px);
}

:root {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: 'Lora', Georgia, Cambria, "Times New Roman", Times, serif;
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --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: #2c1469;
  --primary-foreground: #ffffff;
  --secondary: oklch(0.97 0 0);
  --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);
}

.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: #5a3ba8;
  /* Lighter purple for dark mode */
  --primary-foreground: #ffffff;
  --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);
}

.admin-theme {
  --background: transparent;
  --foreground: #F4F1EC;
  --card: rgba(11, 31, 58, 0.4);
  --card-foreground: #FFFFFF;
  --popover: rgba(11, 31, 58, 0.85);
  --popover-foreground: #FFFFFF;
  --primary: #E63946;
  --primary-foreground: #FFFFFF;
  --secondary: rgba(201, 162, 77, 0.2);
  --secondary-foreground: #C9A24D;
  --muted: rgba(255, 255, 255, 0.05);
  --muted-foreground: rgba(255, 255, 255, 0.6);
  --accent: rgba(230, 57, 70, 0.15);
  --accent-foreground: #E63946;
  --destructive: #EF4444;
  --destructive-foreground: #FFFFFF;
  --border: rgba(255, 255, 255, 0.15);
  --input: rgba(255, 255, 255, 0.1);
  --ring: #C9A24D;
}

.admin-theme .bg-card,
.admin-theme .bg-popover,
.admin-theme [data-radix-popper-content-wrapper]>div {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }

  body {
    @apply bg-background text-foreground;
  }
}

@layer utilities {
  .container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  @media (min-width: 1400px) {
    .container {
      max-width: 1280px;
    }
  }

  /* Hilangkan Scrollbar Native yang jelek */
  .scrollbar-hide::-webkit-scrollbar {
    display: none;
  }

  .scrollbar-hide {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
  }
}

/* Enhanced Form Overrides untuk .admin-theme (Input, Textarea, dsb) */
.admin-theme input,
.admin-theme textarea,
.admin-theme select,
.admin-theme [role="combobox"] {
  background-color: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #FFFFFF !important;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.admin-theme input:hover,
.admin-theme textarea:hover,
.admin-theme select:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

.admin-theme input:focus,
.admin-theme textarea:focus,
.admin-theme select:focus {
  background-color: rgba(11, 31, 58, 0.6) !important;
  border-color: #C9A24D !important;
  box-shadow: 0 0 0 2px rgba(201, 162, 77, 0.3), 0 0 15px rgba(230, 57, 70, 0.1) !important;
  outline: none !important;
}

/* Mempercantik Table Shadcn / Panel Dalam */
.admin-theme table th {
  background-color: rgba(11, 31, 58, 0.6) !important;
  color: #C9A24D !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-theme table tr:hover td {
  background-color: rgba(255, 255, 255, 0.03) !important;
}

/* Premium Button Hover FX untuk Admin Form */
.admin-theme button[type="submit"],
.admin-theme .bg-primary,
.admin-theme button:not(.bg-transparent):not(.bg-secondary) {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-theme button[type="submit"]:not(:disabled):hover,
.admin-theme .bg-primary:hover {
  box-shadow: 0 0 20px rgba(230, 57, 70, 0.5) !important;
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.admin-theme button:active {
  transform: translateY(1px);
}

/* ============================================================
   BEAUTIFUL DIALOG / MODAL FORM untuk semua Admin Form
   ============================================================ */

/* Overlay backdrop yang premium */
.admin-theme [role="dialog"],
.admin-theme [data-radix-dialog-content] {
  background: #0b1f3a !important;
  border: 1px solid rgba(201, 162, 77, 0.25) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(230, 57, 70, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  color: #F4F1EC !important;
}

/* Dialog Title — Emas Solid */
.admin-theme [data-radix-dialog-content] h2,
.admin-theme [role="dialog"] h2 {
  color: #C9A24D !important;
  font-weight: 800;
  letter-spacing: -0.02em;
}


/* Label yang cantik di dalam form */
.admin-theme [role="dialog"] label,
.admin-theme [data-radix-dialog-content] label {
  color: rgba(255, 255, 255, 0.75) !important;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Placeholder text */
.admin-theme [role="dialog"] input::placeholder,
.admin-theme [role="dialog"] textarea::placeholder {
  color: rgba(255, 255, 255, 0.25) !important;
}

/* Garis separator bawah DialogHeader */
.admin-theme [role="dialog"] [data-radix-dialog-header] {
  border-bottom: 1px solid rgba(201, 162, 77, 0.2);
  padding-bottom: 1rem;
  margin-bottom: 0.5rem;
}

/* Tombol submit di dalam Dialog — merah berkilau */
.admin-theme [role="dialog"] button[type="submit"] {
  background: #E63946 !important;
  border: none !important;
  color: white !important;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 20px rgba(230, 57, 70, 0.4) !important;
}

.admin-theme [role="dialog"] button[type="submit"]:hover:not(:disabled) {
  box-shadow: 0 6px 30px rgba(230, 57, 70, 0.6) !important;
  transform: translateY(-2px);
}

/* Deskripsi / hint text */
.admin-theme [role="dialog"] p.text-muted-foreground,
.admin-theme [role="dialog"] .text-xs {
  color: rgba(255, 255, 255, 0.45) !important;
}

/* Close button (X) di pojok kanan */
.admin-theme [role="dialog"] button[aria-label="Close"] {
  color: rgba(255, 255, 255, 0.5) !important;
  opacity: 0.7;
}

.admin-theme [role="dialog"] button[aria-label="Close"]:hover {
  color: #E63946 !important;
  opacity: 1;
  background: rgba(230, 57, 70, 0.1) !important;
  border-radius: 50%;
}