/* Main CSS file */
@font-face {
  font-family: 'BYekan';
  src: url('../assets/fonts/Dana/main.ttf') format('truetype');
  font-style: normal;
  font-weight: 100;
  font-display: swap;
}
/*-------------------------------------------*/
@font-face {
  font-family: 'B Nazanin';
  src: url('../assets/fonts/BNaznnBd.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dirooz';
  src: url('../assets/fonts/Dirooz.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazir';
  src: url('../assets/fonts/Vazir-Medium.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazir';
  src: url('../assets/fonts/Vazir-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Shabnam';
  src: url('../assets/fonts/Shabnam.ttf');
  font-weight: bolder;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'FarYekan';
  src: url('../assets/fonts/Far_Yekan.ttf');
  font-weight: bolder;
  font-style: normal;
  font-display: swap;
}

/* فونت‌های بسته ادیتور استعلام — public-html/assets/fonts/Package-StampEditor */
@font-face {
  font-family: 'Dana';
  src: url('../assets/fonts/Dana/main.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BAseman';
  src: url('../assets/fonts/Package-StampEditor/BAseman.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BAseman';
  src: url('../assets/fonts/Package-StampEditor/BAsemanI.ttf') format('truetype');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'BBadr';
  src: url('../assets/fonts/Package-StampEditor/BBadr.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BBadr';
  src: url('../assets/fonts/Package-StampEditor/BBadrBd.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BBaran';
  src: url('../assets/fonts/Package-StampEditor/BBaran.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BBaran';
  src: url('../assets/fonts/Package-StampEditor/BBaranI.ttf') format('truetype');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'BKarim';
  src: url('../assets/fonts/Package-StampEditor/BKarim.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BKarim';
  src: url('../assets/fonts/Package-StampEditor/BKarimBd.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BMashhad';
  src: url('../assets/fonts/Package-StampEditor/BMashhad.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BMashhad';
  src: url('../assets/fonts/Package-StampEditor/BMashhdI.ttf') format('truetype');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'BMashhad';
  src: url('../assets/fonts/Package-StampEditor/BMashdBd.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BMitra';
  src: url('../assets/fonts/Package-StampEditor/BMitra.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BMitra';
  src: url('../assets/fonts/Package-StampEditor/BMitraBd.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BNasim';
  src: url('../assets/fonts/Package-StampEditor/BNasimBd.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BTehran';
  src: url('../assets/fonts/Package-StampEditor/BTehran.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BTehran';
  src: url('../assets/fonts/Package-StampEditor/BTehranI.ttf') format('truetype');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'BTitr';
  src: url('../assets/fonts/Package-StampEditor/BTitrBd.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BTraffic';
  src: url('../assets/fonts/Package-StampEditor/BTraffic.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BTraffic';
  src: url('../assets/fonts/Package-StampEditor/BTrafcBd.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

/* ══════════════════════════════════════════════════════════════════════════
   Design tokens — Primitive layer (raw palette, theme-agnostic)
   Components must NOT consume these directly — see semantic layer below.
   ══════════════════════════════════════════════════════════════════════════ */
:root {
  /* Slate neutral scale (Tailwind-equivalent) — used for surfaces/borders/text */
  --slate-50:  #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;

  /* Brand teal scale — used ONLY for the 7 allowed interactive roles
     (primary button, links, active menu item, selected tab, input focus,
     progress indicator, toggle/switch active state) */
  --teal-400: #2DD4BF;
  --teal-500: #14B8A6;
  --teal-600: #0F9D8C;
  --teal-700: #0F766E;
  --teal-800: #115E59;
}

/* Main CSS Variables */
:root {
  /* Light theme colors — Flat, Bordered Contrast Palette (no shadows)
     Rationale: shadows are not used for depth in either theme — surfaces are
     separated purely by a visible bg→card→border color step plus a solid
     1px border (see .card below and --card-shadow/--box-shadow = none).
     That makes the color step itself do all the work, so page-bg is pushed
     a full slate step below white cards (not a near-white tint) and the
     border is a real, visible slate-300-ish tone rather than a hairline.
     The brand teal also moves up to teal-600 for a more vivid resting
     accent (previously teal-700, which read muted next to white). Dark
     theme below is unchanged except for also zeroing its shadow tokens. */
  --header-color-light: #FFFFFF;
  /* Pure white */
  --section1-color-light: #E7ECF1;
  /* Slate-200-ish background — a full step below white cards, not a tint */
  --section2-color-light: #FFFFFF;
  --footer-color-light: #DCE3EA;
  --text-light: #111827;
  /* Dark gray text */

  --accent-light: #0F9D8C;
  /* Teal brand accent — reserved for interactive roles only */

  /* Additional palette for light theme */
  --primary-light: #0F9D8C;
  --primary-lighter: #14B8A6;
  --gray: #475569;
  --neutral-900: #111827;
  --neutral-700: #374151;
  --neutral-300: #D1D5DB;
  --neutral-100: #F9FAFB;

  /* Modular assignments */
  --page-bg: #E7ECF1;
  --surface: #FFFFFF;
  --surface-rgb: 255, 255, 255;
  --surface-elevated: #FFFFFF;
  --text-primary: #111827;
  --accent-color: #0F9D8C;
  --accent-rgb: 15, 157, 140;
  --success-base: #10B981;
  --success-rgb: 16, 185, 129;
  --warning-rgb: 245, 158, 11;
  --error-base: #EF4444;
  --card-bg: #FFFFFF;
  --card-header-bg: rgba(231, 236, 241, 0.98);
  --card-backdrop: transparent;
  /* No shadows in either theme — surfaces are separated by color + a solid
     1px border only (see .card below). Kept as a token (rather than deleted)
     so the ~40 call sites across the CSS stay valid with zero visual output. */
  --card-shadow: none;
  --input-bg: #FFFFFF;
  --input-bg-focus: #FFFFFF;
  --input-border: #C3CEDA;
  --border-color: #C3CEDA;
  --border-color-light: #D7E0E8;
  --text-secondary: #475569;
  --hover-bg: rgba(15, 157, 140, 0.08);
  --primary-rgb: 15, 157, 140;
  --text-secondary-rgb: 71, 85, 105;
  --warning-bg: rgba(245, 158, 11, 0.10);
  --warning-border: rgba(245, 158, 11, 0.25);
  --warning-text: #D97706;
  --link-color: #0F9D8C;

  --bg-primary: #E7ECF1;
  --bg-secondary: #FFFFFF;
  --bg-elevated: #EDF1F5;
  --bg-card: #FFFFFF;
  --border-default: #C3CEDA;
  --border-subtle: #D7E0E8;
  --text-muted: #64748B;
  --text-disabled: #D1D5DB;
  --accent-primary: #0F9D8C;
  --accent-hover: #14B8A6;
  --accent-active: #0F766E;
  --success: #10B981;
  --success-color: #10B981;
  --warning: #F59E0B;
  --warning-color: #F59E0B;
  --error: #EF4444;
  --danger-color: #EF4444;
  --danger-rgb: 239, 68, 68;
  --info: #3B82F6;
  --info-color: #3B82F6;
  --info-rgb: 59, 130, 246;

  /* ── Semantic role tokens (light) — components should prefer these names
     going forward; existing --surface/--accent-color/etc above remain the
     underlying source of truth so no component needs to change today ── */
  --color-bg-page: var(--page-bg);
  --color-surface-default: var(--surface);
  --color-surface-sidebar: var(--color-surface-default);
  --color-surface-header: var(--color-surface-default);
  --color-surface-card: var(--bg-card);
  --color-border-default: var(--border-color);
  --color-text-primary: var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-interactive-primary: var(--accent-color);
  --color-interactive-primary-hover: var(--accent-hover);
  --color-interactive-primary-active: var(--accent-active);

  /* Chart categorical palette — distinct from brand accent, for data series only */
  --chart-1: var(--teal-700);
  --chart-2: #6366F1;
  --chart-3: #F59E0B;
  --chart-4: #EC4899;
  --chart-5: #64748B;
  --chart-6: #06B6D4;

  /* Procurement urgency-rail spectrum (distinct from generic semantic colors) */
  --proc-rail-danger: #C81E3A;
  --proc-rail-warning: #F97316;
  --proc-rail-success: #00C853;

    /* Fonts & general */
  --font-primary: 'BYekan';
  --font-size-small: 12px;
  --font-size-medium: 13px;
  --font-size-large: 14px;
  --border-radius: 8px;
  --box-shadow: none;
  --transition: all 0.3s ease;

  /* Support Chat UI (aligned with dashboard accent / surface) */
  --chat-bg: rgba(var(--accent-rgb), 0.04);
  --user-message-bg: rgba(var(--accent-rgb), 0.12);
  --user-message-text: var(--text-primary);
  --user-message-sender: var(--accent-color);
  --admin-message-bg: var(--surface);
  --admin-message-text: var(--text-primary);
  --admin-message-sender: var(--text-secondary);
  --original-ticket-bg: rgba(var(--accent-rgb), 0.08);
  --original-ticket-text: var(--text-primary);
  --attachment-bg: rgba(var(--accent-rgb), 0.06);
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --header-color-dark: #1E293B;
  /* surface */
  --section1-color-dark: #273449;
  --section2-color-dark: #273449;
  --footer-color-dark: #0F172A;
  --text-dark: #F8FAFC;
  /* text primary */
  --accent-dark: #2DD4BF;
  /* accent bright */

  /* Additional palette for dark theme */
  --accent-darker: #14B8A6;
  --neutral-100: #F8FAFC;
  --neutral-300: #94A3B8;
  --neutral-700: #1E293B;

  /* Modular assignments */
  --page-bg: #0F172A;
  --surface: #1E293B;
  --surface-rgb: 30, 41, 59;
  --text-primary: #F8FAFC;
  --accent-color: #2DD4BF;
  --accent-rgb: 45, 212, 191;
  --success-base: #34D399;
  --success-rgb: 52, 211, 153;
  --warning-rgb: 251, 191, 36;
  --error-base: #F87171;
  --card-bg: #273449;
  --card-header-bg: rgba(39, 52, 73, 0.9);
  --card-backdrop: none;
  /* No shadows in either theme — see the light-theme comment above .card for why. */
  --card-shadow: none;
  --input-bg: #1E293B;
  --input-bg-focus: #273449;
  --input-border: #334155;
  --border-color: #334155;
  --border-color-light: #3F4E68;
  /* Text Secondary (dark) — not specified by the task; derived from the Slate
     scale (slate-400, #94A3B8) to sit between slate-300/slate-400 per the
     documented derivation rule, verified ≥ WCAG AA against Background/Surface */
  --text-secondary: #94A3B8;
  --hover-bg: rgba(45, 212, 191, 0.1);
  --primary-rgb: 45, 212, 191;
  --text-secondary-rgb: 148, 163, 184;
  --warning-bg: rgba(251, 191, 36, 0.14);
  --warning-border: rgba(251, 191, 36, 0.35);
  --warning-text: #FBBF24;
  --link-color: #2DD4BF;

  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-elevated: #273449;
  --bg-card: #273449;
  --border-default: #334155;
  --border-subtle: #3F4E68;
  --text-muted: #64748B;
  --text-disabled: #475569;
  --accent-primary: #2DD4BF;
  --accent-hover: #5EEAD4;
  /* Primary Active (dark) — not specified by the task; derived as a darker,
     more saturated step of Primary (#2DD4BF → teal-500 #14B8A6), mirroring
     the light theme's pattern where Active is darker than Primary */
  --accent-active: #14B8A6;
  --success: #34D399;
  --warning: #FBBF24;
  --error: #F87171;
  --info: #7DD3FC;

  /* Procurement urgency-rail spectrum (distinct from generic semantic colors) */
  --proc-rail-danger: #E23A55;
  --proc-rail-warning: #FB923C;
  --proc-rail-success: #12D66F;

  /* Support Chat UI (dark — same tokens, theme-aware) */
  --chat-bg: rgba(15, 23, 42, 0.6);
  --user-message-bg: rgba(45, 212, 191, 0.15);
  --user-message-text: #f8fafc;
  --user-message-sender: #2DD4BF;
  --admin-message-bg: #334155;
  --admin-message-text: #f8fafc;
  --admin-message-sender: #94a3b8;
  --original-ticket-bg: rgba(45, 212, 191, 0.1);
  --original-ticket-text: #f8fafc;
  --attachment-bg: rgba(45, 212, 191, 0.08);

  /* ── Semantic role tokens (dark) — same names as light, values differ ── */
  --color-bg-page: var(--page-bg);
  --color-surface-default: var(--surface);
  --color-surface-sidebar: var(--color-surface-default);
  --color-surface-header: var(--color-surface-default);
  --color-surface-card: var(--bg-card);
  --color-border-default: var(--border-color);
  --color-text-primary: var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-interactive-primary: var(--accent-color);
  --color-interactive-primary-hover: var(--accent-hover);
  --color-interactive-primary-active: var(--accent-active);

  /* Chart categorical palette (dark) — brighter variants for dark backgrounds */
  --chart-1: #2DD4BF;
  --chart-2: #818CF8;
  --chart-3: #FBBF24;
  --chart-4: #F472B6;
  --chart-5: #94A3B8;
  --chart-6: #22D3EE;
}

/* Current theme variables (default = light) */
:root {
  --primary-color: var(--header-color-light);
  --secondary-color: var(--section1-color-light);
  --accent-color: var(--accent-light);
  --background-color: var(--footer-color-light);
  --text-color: var(--text-light);

  --success-color: var(--success-base);
  --warning-color: var(--warning);
  --danger-color: var(--error-base);
}

/* Override for dark mode */
[data-theme="dark"] {
  --primary-color: var(--header-color-dark);
  --secondary-color: var(--section1-color-dark);
  --accent-color: var(--accent-dark);
  --background-color: var(--page-bg);
  --text-color: var(--text-dark);
  --success-color: var(--success-base);
  --danger-color: var(--error-base);
}

/* ================================
   Light Theme
================================ */
[data-theme="light"] {
  --toast-bg: rgba(255, 255, 255, 0.78);
  --toast-text: #2D2A26;
  --toast-border: rgba(45, 42, 38, 0.08);
  --toast-shadow: rgba(0, 0, 0, 0.12);
}

/* ================================
   Dark Theme
================================ */
[data-theme="dark"] {
  --toast-bg: rgba(22, 22, 22, 0.65);
  --toast-text: #f5f5f5;
  --toast-border: rgba(255, 255, 255, 0.08);
  --toast-shadow: rgba(0, 0, 0, 0.4);
}

/* ── iOS-style smooth theme transition ──────────────────────────────────────
   فقط در لحظه سوییچ تم فعال می‌شه (کلاس theme-transitioning روی html)
   تا performance صفحه در حالت عادی تحت تأثیر قرار نگیره
   ─────────────────────────────────────────────────────────────────────────── */
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition:
    background-color 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    background     0.45s cubic-bezier(0.4, 0, 0.2, 1),
    color          0.35s cubic-bezier(0.4, 0, 0.2, 1),
    border-color   0.45s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow     0.45s cubic-bezier(0.4, 0, 0.2, 1),
    fill           0.35s cubic-bezier(0.4, 0, 0.2, 1),
    stroke         0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* المان‌هایی که نباید transition داشته باشن (انیمیشن‌های موجود خراب نشن) */
.theme-transitioning .auth-side-img,
.theme-transitioning [class*="fa-spin"],
.theme-transitioning [class*="animate-"],
.theme-transitioning .notification {
  transition: none !important;
}

* {
  padding: 0;
  /*box-sizing: border-box;*/
  max-width: 100%;
  /* Prevent elements from overflowing container */
}

*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-medium);
  background-color: var(--background-color);
  color: var(--text-color);
  direction: rtl;
  transition: var(--transition);
  overflow-x: hidden;
  /* Prevent horizontal scrolling */
  width: 100%;
  /* Ensure body doesn't overflow viewport */
  margin: 0;
  /* Remove default margin */
  padding: 0;
  /* Remove default padding */
  max-width: 100vw;
  /* Prevent overflow beyond viewport */
  box-sizing: border-box;
  /* Include padding in width calculation */
  min-width: 0;
  /* Allow content to shrink if needed */
}

button,
input,
select,
textarea {
  font: inherit;
}

[data-theme="dark"] body {
  background-color: var(--background-color);
  color: var(--text-color);
}

.container {
  width: 100%;
  max-width: 95%;
  margin: 0 auto;
  padding: 0 max(5px, 0.35vw);
  text-align: right;
  box-sizing: border-box;
  /* Prevent horizontal overflow */
  min-width: 0;
  /* Allow content to shrink if needed */
}

/* Desktop and tablet optimization */
@media (min-width: 769px) {
  .container {
    max-width: 95%;
    padding: 0 max(5px, 0.35vw);
  }
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--primary-color);
  color: black;
  border: none;
  border-radius: var(--border-radius);
  font-family: var(--font-primary);
  font-size: var(--font-size-medium);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  vertical-align: middle;
  line-height: 1.2;
}

.btn:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
  color: white;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: var(--text-color);
}

.btn-success {
  background-color: var(--success-color);
}

.btn-success:hover {
  background-color: var(--success-color);
  /* Keep base, or darken if needed */
}

.btn-warning {
  background-color: var(--warning-color);
}

.btn-warning:hover {
  background-color: var(--warning-color);
  /* Keep base, or darken if needed */
}

.btn-danger {
  background-color: var(--danger-color);
}

.btn-danger:hover {
  background-color: var(--danger-color);
  /* Keep base, or darken if needed */
}

.form-group {
  margin-bottom: 20px;
  gap: 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  text-align: right;
  /* Ensure proper RTL alignment */
}

.form-input {
  padding: 12px 16px;
  border: 2px solid var(--input-border);
  border-radius: var(--border-radius);
  font-family: var(--font-primary);
  font-size: var(--font-size-medium);
  transition: var(--transition);
  background-color: var(--input-bg);
  color: var(--text-color);
  caret-color: var(--accent-color);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: none;
  background-color: var(--input-bg-focus);
}

[data-theme="dark"] .form-input {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .form-input:focus {
  box-shadow: none;
}

/* Unified Card Styles */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  padding: 24px;
  margin-bottom: 24px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  color: var(--text-color);
  width: 100%;
  /* Ensure card fits within container */
  max-width: 100%;
  /* Prevent card from overflowing */
  box-sizing: border-box;
  /* Include padding in width calculation */
  overflow-x: hidden;
  /* Prevent horizontal overflow */
}

/* ================================
   Modern Toast Notification
================================ */
#notificationContainer {
  position: fixed;
  font-size: 0.9rem;
  top: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 99999;
  pointer-events: none;
  max-width: min(92vw, 430px);
}

.notification {
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  padding: 14px 18px;
  border-radius: 16px;
  font-weight: 700;
  opacity: 0;
  transform: translateX(24px) scale(0.98);
  transition: transform 0.28s ease, opacity 0.28s ease;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  box-shadow: none;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  background:
    radial-gradient(circle at 8% 10%, rgba(var(--accent-rgb), 0.22), transparent 36%),
    linear-gradient(120deg, rgba(var(--accent-rgb), 0.16), rgba(var(--surface-rgb), 0.68));
  color: var(--text-primary);
  min-width: 280px;
  max-width: 100%;
  line-height: 1.55;
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 0 10px 10px 0;
  background: var(--accent-color);
  z-index: 2;
}

.notif-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: rgba(var(--accent-rgb), 0.5);
  width: 100%;
  transform-origin: left;
  z-index: 5;
  box-shadow: none;
}

/* Color variations for progress bar with glow */
.notification.success .notif-progress { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.notification.error .notif-progress { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
.notification.warning .notif-progress { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }
.notification.info .notif-progress { background: #3b82f6; box-shadow: 0 0 8px rgba(59, 130, 246, 0.5); }

/* Add a track for the progress bar to make it more visible */
.notification::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.05);
  z-index: 4;
}

.notif-content {
  flex: 1;
  padding: 0 10px;
}

.notif-close {
  cursor: pointer;
  opacity: 0.7;
  transition: var(--transition);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: 2px;
}

.notif-close i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.85rem;
}

.notif-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

/* Show Animation */
.notification.show {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.notification.fade-out {
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.4s ease;
  margin-bottom: -60px; /* Smooth collapse */
}

/* ================================
   Notification Types
================================ */
.notification.success {
  border-color: rgba(16, 185, 129, 0.35);
}

.notification.success::before {
  background: var(--success-color);
}

.notification.error {
  border-color: rgba(239, 68, 68, 0.35);
}

.notification.error::before {
  background: var(--danger-color);
}

.notification.warning {
  border-color: rgba(245, 158, 11, 0.35);
}

.notification.warning::before {
  background: var(--warning-color);
}

.notification.info {
  border-color: rgba(var(--accent-rgb), 0.35);
}

.notification.info::before {
  background: var(--accent-color);
}

[data-theme="dark"] .notification {
  background:
    radial-gradient(circle at 8% 10%, rgba(var(--accent-rgb), 0.28), transparent 40%),
    linear-gradient(130deg, rgba(18, 26, 37, 0.86), rgba(26, 35, 48, 0.72));
  color: #e8edf6;
  border-color: rgba(var(--accent-rgb), 0.32);
  box-shadow: none;
}

@media (max-width: 768px) {
  #notificationContainer {
    right: 0;
    left: 0;
    top: 10px;
    align-items: center;
    padding: 0 10px;
    max-width: 100vw;
  }

  .notification {
    min-width: 0;
    width: min(100%, 420px);
  }
}

/* ================================
   Theme Toggle
================================ */

.theme-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  /* Changed from right to left */
  background-color: var(--primary-color);
  color: var(--text-color);
  border: 2px solid var(--text-color);
  border-radius: 30px;
  width: 60px;
  height: 30px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--box-shadow);
  z-index: 999;
  transition: var(--transition);
  padding: 0;
}

.theme-toggle:hover {
  background-color: var(--secondary-color);
  transform: scale(1.05);
  color: var(--text-color);
}

.theme-toggle i {
  transition: var(--transition);
}

/* Theme Toggle Button inside card */
.theme-toggle-card {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  border: 2px solid var(--text-color);
  border-radius: 30px;
  width: 40px;
  height: 25px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--box-shadow);
  z-index: 10;
  transition: var(--transition);
  padding: 0;
}

.theme-toggle-card i {
  transition: var(--transition);
}

/* Back Button Styles */
.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  /* Positioned on the left side */
  background-color: var(--primary-color);
  color: var(--text-color);
  border: 2px solid var(--text-color);
  border-radius: 30px;
  width: 60px;
  height: 30px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--box-shadow);
  z-index: 999;
  transition: var(--transition);
  padding: 0;
}


/* Action Tooltip Popup Styles */
#action-tooltip-popup {
  position: fixed;
  background-color: var(--toast-bg);
  color: var(--toast-text);
  padding: 12px 16px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  font-size: 1rem;
  box-shadow: 0 8px 24px var(--toast-shadow);
  border: 1px solid var(--toast-border);
  min-width: 200px;
  text-align: center;
  pointer-events: none;
  /* So it doesn't interfere with mouse events */
}

@keyframes copyPulse {
  0% {
    transform: translate(10px, -30px) scale(1);
  }

  50% {
    transform: translate(10px, -30px) scale(1.1);
  }

  100% {
    transform: translate(10px, -30px) scale(1);
  }
}

@keyframes copyAnimation {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

.back-button:hover {
  background-color: var(--secondary-color);
  transform: scale(1.05);
  color: var(--text-color);
}

.back-button i {
  transition: var(--transition);
}

/* Responsive adjustments for theme toggle */
@media (max-width: 1303px) {
  .theme-toggle {
    top: 15px;
    left: 15px;
    /* Changed from right to left */
    width: 50px;
    height: 25px;
    font-size: 14px;
  }

  .theme-toggle-card {
    top: 15px;
    right: 15px;
    width: 35px;
    height: 22px;
    font-size: 12px;
  }

  .back-button {
    top: 15px;
    left: 15px;
    width: 50px;
    height: 25px;
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .theme-toggle {
    top: 10px;
    left: 10px;
    /* Changed from right to left */
    width: 45px;
    height: 22px;
    font-size: 12px;
  }

  .theme-toggle-card {
    top: 10px;
    right: 10px;
    width: 30px;
    height: 20px;
    font-size: 10px;
  }

  .back-button {
    top: 10px;
    left: 10px;
    width: 45px;
    height: 22px;
    font-size: 12px;
  }
}

/* Simplified Animation classes */
.fade-in {
  animation: fadeIn 0.2s ease-in;
}

.slide-in-right {
  animation: slideInRight 0.2s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

/* subtle pulse for modern feel */
@keyframes toastPulse {
  0% {
    transform: translateX(0) scale(1);
  }

  50% {
    transform: translateX(0) scale(1.015);
  }

  100% {
    transform: translateX(0) scale(1);
  }
}

/* Text utility classes */
.text-success {
  color: var(--success-color);
  margin-top: 15px;
  font-size: 45px;
}

.text-warning {
  color: var(--warning-color);
}

.text-danger {
  color: var(--danger-color);
}

.text-center {
  text-align: center;
}

/* Responsive utilities */
.hidden {
  display: none;
}

/* Version Type Banner Styles */
.version-type-banner {
  position: absolute;
  top: 10px;
  left: 10px;
  /* Changed from right to left */
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  z-index: 1;
  box-shadow: none;
  min-width: 60px;
  text-align: center;
}

.version-type-warning {
  background-color: var(--warning-color);
  color: white;
}

.version-type-success {
  background-color: var(--success-color);
  color: white;
}

.version-type-danger {
  background-color: var(--danger-color);
  color: white;
}

.version-type-info {
  background-color: #0899ba;
  color: #ffffff;
}

.stat-card {
  position: relative;
  /* Needed for absolute positioning of the banner */
}

@media (max-width: 768px) {
  .version-type-banner {
    top: 5px;
    left: 5px;
    /* Changed from right to left */
    padding: 3px 8px;
    font-size: 11px;
    min-width: 50px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }

  .btn {
    padding: 10px 20px;
    font-size: var(--font-size-small);
  }
}

/* Dashboard Button Styles */
#dashboardButton {
  background-color: var(--success-color);
  /* Updated to use success color */
  color: var(--text-color);
  border-radius: var(--border-radius);
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  transition: var(--transition);
}

/* Center align table cell content */
td {
  vertical-align: middle;
  text-align: center;
}

th {
  vertical-align: middle;
  text-align: center;
}

/* Email column text overflow handling */
.email-cell {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
  text-align: right;
  box-sizing: border-box;
  /* Include padding in width calculation */
}

/* Data table responsive improvements */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Standard scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) var(--surface);
  overscroll-behavior: contain;
  scroll-padding: 10px;
  max-width: 100%;
  /* Prevent table from overflowing container */
  width: 100%;
  /* Ensure it takes full width of container */
  box-sizing: border-box;
  /* Include padding in width calculation */
}

/* Webkit browsers (Chrome, Safari, Edge) */
.table-responsive::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
  table-layout: fixed;
  /* Fixed table layout for better control */
  word-wrap: break-word;
  /* Break long words to prevent overflow */
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
  /* Prevent content overflow */
  text-overflow: ellipsis;
  /* Show ellipsis for overflowed text */
  white-space: nowrap;
  /* Prevent text wrapping that might cause overflow */
  max-width: 200px;
  /* Limit maximum width of cells */
}

[data-theme="dark"] .data-table th,
[data-theme="dark"] .data-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th {
  font-weight: bold;
  background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .data-table th {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Autocomplete styles for base options */
.autocomplete-items {
  position: absolute;
  border: 1px solid #d4d4d4;
  border-top: none;
  z-index: 99;
  background-color: #fff;
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
  box-shadow: none;
  border-radius: 4px;
}

.autocomplete-items div {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.autocomplete-items div:hover {
  background-color: #f0f0f0;
}

.autocomplete-items div:last-child {
  border-bottom: none;
}

.autocomplete-active {
  background-color: #4f46e5 !important;
  color: #ffffff;
}

/* Base options indicator */
.base-options-indicator {
  font-size: 0.8em;
  color: var(--primary-color);
  margin-left: 5px;
}

/* Compact Base Options Grid Styles */
.base-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.base-option-card {
  border-radius: var(--border-radius);
  padding: 15px;
  background-color: white;
  transition: var(--transition);
}

[data-theme="dark"] .base-option-card {
  background-color: #212529;
}

.base-option-card:hover {
  border-color: var(--accent-color);
}

.base-option-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.base-option-actions {
  display: flex;
  gap: 8px;
}

.base-option-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-color);
}

.base-power-button {
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(var(--surface-rgb), 0.5);
  transition: var(--transition);
}

.base-power-button:hover {
  background-color: var(--accent-color);
}

.base-power-button i {
  font-size: 14px;
  color: #ff0000;
  /* Red for inactive */
  transition: var(--transition);
}

.base-power-button[data-active="true"] i {
  color: #2db87d;
  /* Green for active */
}

.base-preset-button {
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(var(--surface-rgb), 0.5);
  transition: var(--transition);
}

.base-preset-button:hover {
  background-color: rgba(var(--accent-rgb), 0.1);
}

.base-preset-button i {
  font-size: 14px;
  color: #6B7280;
  /* Gray color */
  transition: var(--transition);
}

.base-option-card-body {
  opacity: 0.5;
  pointer-events: none;
  transition: var(--transition);
}

.base-option-card[data-active="true"] .base-option-card-body {
  opacity: 1;
  pointer-events: auto;
}

.base-option-input-container {
  display: flex;
  align-items: center;
}

.base-option-input-container .form-input {
  padding: 8px 12px;
  font-size: 0.9rem;
  border-radius: 6px;
  background-color: var(--input-bg);
}

/* Base Options Review Styles */
.base-options-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.base-option-review-card {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 12px;
  background-color: #ffffff;
  transition: var(--transition);
}

[data-theme="dark"] .base-option-review-card {
  background-color: #212529;
}

.base-option-review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.base-option-review-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-color);
}

.base-option-review-status {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 10px;
  background-color: #EF4444;
  color: white;
}

.base-option-review-status.active {
  background-color: #10B981;
}

.base-option-review-value {
  font-size: 0.85rem;
  color: var(--text-secondary);
  word-break: break-word;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: none;
  max-width: 90%;
  max-height: 90%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
}

.modal-close {
  width: 36px !important;
  height: 36px !important;
  background: rgba(0, 0, 0, 0.05) !important;
  border: none !important;
  border-radius: 12px !important;
  font-size: 1.1rem !important;
  cursor: pointer !important;
  color: var(--text-secondary, #666) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
  line-height: 1 !important;
  margin-bottom: 15px !important;
}

[data-theme="dark"] .modal-close {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ccc !important;
}

.modal-close:hover {
  background: #fee2e2 !important;
  color: #ef4444 !important;
  transform: rotate(90deg) !important;
}

.modal-close i {
  display: block !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.modal-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Button styles for select option */
.select-option-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* Loading Spinner Styles */
.base-options-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

[data-theme="dark"] .spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--accent-color);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.base-options-loading p {
  margin: 0;
  color: var(--text-color);
  font-size: 0.9rem;
}
