/* ============================================================
   JZAGI.TOP — Vintage Paper Theme
   Source: tweakcn.com/editor/theme?theme=vintage-paper
   Fonts: Libre Baskerville (sans) / Lora (serif) / IBM Plex Mono (mono)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Lora:ital,wght@0,400;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ─── Light Variables ─────────────────────────────────────── */
:root,
html:not(.dark) {
  --background:        oklch(0.9582 0.0152 90.2357);
  --foreground:        oklch(0.3760 0.0225 64.3434);
  --card:              oklch(0.9914 0.0098 87.4695);
  --card-foreground:   oklch(0.3760 0.0225 64.3434);
  --popover:           oklch(0.9914 0.0098 87.4695);
  --popover-foreground: oklch(0.3760 0.0225 64.3434);
  --primary:           oklch(0.6180 0.0778 65.5444);
  --primary-foreground: oklch(1.0000 0 0);
  --secondary:          oklch(0.8846 0.0302 85.5655);
  --secondary-foreground: oklch(0.4313 0.0300 64.9288);
  --muted:             oklch(0.9239 0.0190 83.0636);
  --muted-foreground:  oklch(0.5391 0.0387 71.1655);
  --accent:            oklch(0.8348 0.0426 88.8064);
  --accent-foreground:  oklch(0.3760 0.0225 64.3434);
  --destructive:        oklch(0.5471 0.1438 32.9149);
  --destructive-foreground: oklch(1.0000 0 0);
  --border:            oklch(0.8606 0.0321 84.5881);
  --input:             oklch(0.8606 0.0321 84.5881);
  --ring:              oklch(0.6180 0.0778 65.5444);
  --chart-1:           oklch(0.6180 0.0778 65.5444);
  --chart-2:           oklch(0.5604 0.0624 68.5805);
  --chart-3:           oklch(0.4851 0.0570 72.6827);
  --chart-4:           oklch(0.6777 0.0624 64.7755);
  --chart-5:           oklch(0.7264 0.0581 66.6967);
  --radius:            0.25rem;

  /* Sidebar */
  --sidebar-bg:         oklch(0.9239 0.0190 83.0636);
  --sidebar-fg:         oklch(0.3760 0.0225 64.3434);
  --sidebar-accent:     oklch(0.8348 0.0426 88.8064);
  --sidebar-accent-fg:  oklch(0.3760 0.0225 64.3434);
  --sidebar-border:     oklch(0.8606 0.0321 84.5881);

  /* Fonts */
  --font-sans: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  /* Shadow */
  --shadow-color: hsl(28 13% 20%);
  --shadow-opacity: 0.12;
  --shadow: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 1px 2px -1px hsl(28 13% 20% / 0.12);
  --shadow-sm: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 1px 2px -1px hsl(28 13% 20% / 0.12);
  --shadow-md: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 2px 4px -1px hsl(28 13% 20% / 0.12);
  --shadow-lg: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 4px 6px -1px hsl(28 13% 20% / 0.12);
  --shadow-xl: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 8px 10px -1px hsl(28 13% 20% / 0.12);
}

/* ─── Dark Variables ────────────────────────────────────────── */
.dark {
  --background:        oklch(0.2747 0.0139 57.6523);
  --foreground:        oklch(0.9239 0.0190 83.0636);
  --card:              oklch(0.3237 0.0155 59.0603);
  --card-foreground:   oklch(0.9239 0.0190 83.0636);
  --popover:           oklch(0.3237 0.0155 59.0603);
  --popover-foreground: oklch(0.9239 0.0190 83.0636);
  --primary:           oklch(0.7264 0.0581 66.6967);
  --primary-foreground: oklch(0.2747 0.0139 57.6523);
  --secondary:         oklch(0.3795 0.0181 57.1280);
  --secondary-foreground: oklch(0.9239 0.0190 83.0636);
  --muted:             oklch(0.2939 0.0125 62.1298);
  --muted-foreground:  oklch(0.7982 0.0243 82.1078);
  --accent:            oklch(0.4186 0.0281 56.3404);
  --accent-foreground: oklch(0.9239 0.0190 83.0636);
  --destructive:        oklch(0.5471 0.1438 32.9149);
  --destructive-foreground: oklch(1.0000 0 0);
  --border:            oklch(0.3795 0.0181 57.1280);
  --input:             oklch(0.3795 0.0181 57.1280);
  --ring:              oklch(0.7264 0.0581 66.6967);
  --chart-1:           oklch(0.7264 0.0581 66.6967);
  --chart-2:           oklch(0.6777 0.0624 64.7755);
  --chart-3:           oklch(0.6180 0.0778 65.5444);
  --chart-4:           oklch(0.5604 0.0624 68.5805);
  --chart-5:           oklch(0.4851 0.0570 72.6827);
  --radius:            0.25rem;

  /* Sidebar */
  --sidebar-bg:         oklch(0.2747 0.0139 57.6523);
  --sidebar-fg:         oklch(0.9239 0.0190 83.0636);
  --sidebar-accent:     oklch(0.4186 0.0281 56.3404);
  --sidebar-accent-fg:  oklch(0.9239 0.0190 83.0636);
  --sidebar-border:     oklch(0.3795 0.0181 57.1280);

  /* Fonts */
  --font-sans: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  /* Shadow */
  --shadow-color: hsl(28 13% 20%);
  --shadow-opacity: 0.12;
  --shadow: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 1px 2px -1px hsl(28 13% 20% / 0.12);
  --shadow-sm: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 1px 2px -1px hsl(28 13% 20% / 0.12);
  --shadow-md: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 2px 4px -1px hsl(28 13% 20% / 0.12);
  --shadow-lg: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 4px 6px -1px hsl(28 13% 20% / 0.12);
  --shadow-xl: 2px 3px 5px 0px hsl(28 13% 20% / 0.12), 2px 8px 10px -1px hsl(28 13% 20% / 0.12);
}

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.6;
  transition: background 0.2s, color 0.2s;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

code, pre, .mono {
  font-family: var(--font-mono);
}

/* ─── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-foreground); }

/* ─── Text Selection ───────────────────────────────────────── */
::selection { background: oklch(0.6180 0.0778 65.5444 / 0.25); color: var(--foreground); }

/* ─── Focus Visible ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: calc(var(--radius) * 0.8);
}

/* ─── Utility Classes ──────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─── SPA View Transition ───────────────────────────────────── */
.tab-view {
  display: none !important;
}
.tab-view.active {
  display: block !important;
  animation: fadeInSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Unified Line Icons Styling ───────────────────────────── */
svg.hugeicon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ─── Premium Custom Dialog & Alert System ─────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  min-width: 280px;
  max-width: 380px;
  animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast-item.hide {
  animation: toastOut 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.toast-success .toast-icon { color: oklch(0.65 0.2 145); }
.toast-error .toast-icon { color: oklch(0.60 0.18 25); }
.toast-info .toast-icon { color: oklch(0.70 0.18 200); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.9); }
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 16px;
}
.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
  box-shadow: var(--shadow-xl);
  padding: 24px;
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-overlay.show .modal-card {
  transform: scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in oklch, var(--foreground) 6%, transparent);
  display: grid;
  place-items: center;
  color: var(--foreground);
  flex-shrink: 0;
}
.modal-icon.warning {
  background: color-mix(in oklch, oklch(0.75 0.18 85) 12%, transparent);
  color: oklch(0.75 0.18 85);
}
.modal-icon.error {
  background: color-mix(in oklch, oklch(0.60 0.18 25) 12%, transparent);
  color: oklch(0.60 0.18 25);
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}
.modal-body {
  font-size: 13.5px;
  color: var(--muted-foreground);
  line-height: 1.6;
  white-space: pre-line;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}


