/* ============================================================
   MOTORX — Global CSS (Reset + Base + Utilities)
   global.css
   ============================================================ */

/* ─── FONTS ──────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Cairo:wght@300;400;500;600;700;800&display=swap');

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--clr-text-primary);
  background-color: var(--clr-bg-base);
  transition: background-color var(--transition-slow),
              color var(--transition-slow);
  min-height: 100vh;
  overflow-x: hidden;
}

/* RTL — Arabic */
html[dir="rtl"] body,
[dir="rtl"] body {
  font-family: var(--font-arabic);
}

/* ─── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
  transition: background var(--transition-base);
}
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* ─── TYPOGRAPHY ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--clr-text-primary);
}
h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); }
h2 { font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl)); }
h3 { font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p { color: var(--clr-text-secondary); line-height: var(--leading-relaxed); }

a {
  color: var(--clr-brand);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--clr-brand-light); }

img, video { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea {
  font-family: inherit;
  font-size: var(--text-base);
}
ul, ol { list-style: none; }

/* ─── LAYOUT ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--navbar-height);
}

.page-content {
  flex: 1;
  padding: var(--space-8) 0;
}

/* ─── SECTION HEADING ────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--clr-text-primary);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 1.2em;
  background: var(--clr-brand);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.section-view-all {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--clr-brand);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  transition: gap var(--transition-fast);
}
.section-view-all:hover { gap: var(--space-2); }

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: 1;
  border: 1.5px solid transparent;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}
.btn:hover::after { background: rgba(255,255,255,0.06); }

.btn-primary {
  background: var(--clr-brand);
  color: var(--clr-text-on-brand);
  border-color: var(--clr-brand);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  background: var(--clr-brand-light);
  border-color: var(--clr-brand-light);
  box-shadow: var(--shadow-brand-strong);
  transform: translateY(-1px);
  color: var(--clr-text-on-brand);
}

.btn-outline {
  background: transparent;
  color: var(--clr-brand);
  border-color: var(--clr-brand);
}
.btn-outline:hover {
  background: var(--clr-brand-glow);
  transform: translateY(-1px);
  color: var(--clr-brand-light);
}

.btn-ghost {
  background: transparent;
  color: var(--clr-text-secondary);
  border-color: var(--clr-border);
}
.btn-ghost:hover {
  background: var(--clr-bg-card-hover);
  color: var(--clr-text-primary);
  border-color: var(--clr-border-strong);
}

.btn-danger {
  background: var(--clr-danger);
  color: #fff;
  border-color: var(--clr-danger);
}
.btn-danger:hover {
  background: #c0392b;
  transform: translateY(-1px);
  color: #fff;
}

.btn-success {
  background: var(--clr-success);
  color: #fff;
  border-color: var(--clr-success);
}
.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
  color: #fff;
}

.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }
.btn-lg { padding: var(--space-4) var(--space-8); font-size: var(--text-base); }
.btn-block { width: 100%; }
.btn-icon { padding: var(--space-2); width: 36px; height: 36px; border-radius: var(--radius-md); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* ─── FORM ELEMENTS ──────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--clr-text-secondary);
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--clr-bg-input);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-text-primary);
  font-size: var(--text-sm);
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast),
              background var(--transition-fast);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--clr-brand);
  box-shadow: 0 0 0 3px var(--clr-brand-glow);
}

.form-control::placeholder { color: var(--clr-text-muted); }

.form-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238B9CC8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

[dir="rtl"] select.form-control {
  background-position: left 12px center;
  padding-right: var(--space-4);
  padding-left: 36px;
}

/* Custom Select Dropdown UI */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238B9CC8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  user-select: none;
}

[dir="rtl"] .custom-select-trigger {
  background-position: left 12px center;
  padding-right: var(--space-4);
  padding-left: 36px;
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 250px;
  overflow-y: auto;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all var(--transition-fast) ease;
  padding: 4px;
}

.custom-select-wrapper.open .custom-select-trigger {
  border-color: var(--clr-brand);
  box-shadow: 0 0 0 3px var(--clr-brand-glow);
}

.custom-select-wrapper.open .custom-select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-select-option {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--clr-text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.custom-select-option:hover {
  background: var(--clr-bg-card-hover);
}

.custom-select-option.selected {
  background: var(--clr-brand-glow);
  color: var(--clr-brand-light);
  font-weight: 500;
}

.custom-select-option.disabled {
  color: var(--clr-text-muted);
  cursor: not-allowed;
  pointer-events: none;
}

/* Custom scrollbar for options */
.custom-select-options::-webkit-scrollbar {
  width: 6px;
}
.custom-select-options::-webkit-scrollbar-track {
  background: transparent;
}
.custom-select-options::-webkit-scrollbar-thumb {
  background: var(--clr-border);
  border-radius: 4px;
}
.custom-select-options::-webkit-scrollbar-thumb:hover {
  background: var(--clr-text-muted);
}

textarea.form-control { resize: vertical; min-height: 120px; max-height: 250px; }

.form-error {
  font-size: var(--text-xs);
  color: var(--clr-danger);
  display: none;
}
.form-error.visible { display: block; }

.form-hint {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 768px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

/* ─── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-brand);
  border-color: var(--clr-border-strong);
}

.card-body { padding: var(--space-5); }
.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--clr-border-subtle);
}

.car-card-badge {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2;
  pointer-events: none;
}

.badge-ai {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Light Mode Overrides for badges on images */
[data-theme="light"] .car-card-badge .badge-ai {
  background-color: rgba(255, 255, 255, 0.85);
  color: #1a1a1a;
  border-color: rgba(0,0,0,0.12);
}

/* Dark Mode Overrides for badges on images */
[data-theme="dark"] .car-card-badge .badge-ai,
:root .car-card-badge .badge-ai {
  background-color: rgba(0, 0, 0, 0.75);
  color: #f0f0f0;
  border-color: rgba(255,255,255,0.15);
}

.badge-good-deal { color: #10B981; }
.badge-fair-price { color: #3B82F6; }
.badge-overpriced { color: #EF4444; }

/* ─── STATUS BADGES ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
}
.badge-success { background: var(--clr-success-bg); color: var(--clr-success); }
.badge-warning { background: var(--clr-warning-bg); color: var(--clr-warning); }
.badge-danger  { background: var(--clr-danger-bg);  color: var(--clr-danger);  }
.badge-info    { background: var(--clr-info-bg);    color: var(--clr-info);    }

/* ─── MODALS ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: var(--navbar-height);
  right: 0;
  bottom: 0;
  left: 0;
  background: var(--clr-bg-overlay);
  backdrop-filter: blur(6px);
  z-index: calc(var(--z-navbar) - 100);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-spring);
}

.modal-overlay.active .modal-box {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--clr-border);
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--clr-text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--clr-bg-input);
  border-radius: var(--radius-md);
  color: var(--clr-text-muted);
  font-size: var(--text-lg);
  transition: all var(--transition-fast);
}
.modal-close:hover {
  background: var(--clr-danger-bg);
  color: var(--clr-danger);
}

.modal-body { padding: var(--space-6); }
.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--clr-border);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* ─── TOAST NOTIFICATIONS ────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  inset-inline-end: var(--space-6);
  z-index: 99999 !important;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--clr-text-primary);
  min-width: 280px;
  max-width: 380px;
  pointer-events: auto;
  animation: toastIn 0.3s var(--transition-spring) forwards;
}

.toast.removing { animation: toastOut 0.25s ease forwards; }

.toast-success { border-left: 3px solid var(--clr-success); }
.toast-error   { border-left: 3px solid var(--clr-danger);  }
.toast-info    { border-left: 3px solid var(--clr-info);    }
.toast-warning { border-left: 3px solid var(--clr-warning); }

[dir="rtl"] .toast-success { border-left: none; border-right: 3px solid var(--clr-success); }
[dir="rtl"] .toast-error   { border-left: none; border-right: 3px solid var(--clr-danger);  }
[dir="rtl"] .toast-info    { border-left: none; border-right: 3px solid var(--clr-info);    }
[dir="rtl"] .toast-warning { border-left: none; border-right: 3px solid var(--clr-warning); }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}
[dir="rtl"] {
  & .toastIn {
    animation-name: toastInRtl;
  }
}
@keyframes toastInRtl {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ─── PAGINATION ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-8);
}

.pagination-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--clr-border);
  background: var(--clr-bg-card);
  color: var(--clr-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.pagination-btn:hover {
  border-color: var(--clr-brand);
  color: var(--clr-brand);
  background: var(--clr-brand-glow);
}

.pagination-btn.active {
  background: var(--clr-brand);
  border-color: var(--clr-brand);
  color: #fff;
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ─── SKELETON LOADER ────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--clr-bg-card) 25%,
    var(--clr-bg-card-hover) 50%,
    var(--clr-bg-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

@keyframes motorx-fade-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── UTILITIES ──────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0,0,0,0);
  overflow: hidden;
}

.text-center  { text-align: center; }
.text-start   { text-align: start; }
.text-end     { text-align: end; }
.text-muted   { color: var(--clr-text-muted); }
.text-brand   { color: var(--clr-brand); }
.text-success { color: var(--clr-success); }
.text-danger  { color: var(--clr-danger); }
.text-warning { color: var(--clr-warning); }

.d-flex         { display: flex; }
.d-grid         { display: grid; }
.d-none         { display: none; }
.d-block        { display: block; }

.align-center   { align-items: center; }
.justify-center { justify-content: center; }
.justify-between{ justify-content: space-between; }
.gap-2          { gap: var(--space-2); }
.gap-3          { gap: var(--space-3); }
.gap-4          { gap: var(--space-4); }

.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.w-full    { width: 100%; }
.h-full    { height: 100%; }
.rounded   { border-radius: var(--radius-md); }
.rounded-lg{ border-radius: var(--radius-lg); }

.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ─── STARS RATING ───────────────────────────────────────────── */
.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--clr-warning);
  font-size: var(--text-sm);
}
.star-empty { color: var(--clr-text-muted); }

/* ─── DIVIDER ────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--clr-border);
  margin: var(--space-6) 0;
}
.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--clr-text-muted);
  font-size: var(--text-sm);
  margin: var(--space-6) 0;
}
.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--clr-border);
}

/* ─── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-16) var(--space-6);
  text-align: center;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  font-size: 2rem;
  color: var(--clr-text-muted);
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--clr-text-primary);
}

.empty-state p {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  max-width: 320px;
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
.footer {
  background: var(--clr-bg-sidebar);
  border-top: 1px solid var(--clr-border);
  padding: var(--space-8) 0 var(--space-6);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  text-align: center;
}

.footer-logo { font-size: var(--text-2xl); font-weight: var(--font-extrabold); }
.footer-logo span { color: var(--clr-brand); }

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: var(--text-base);
  color: var(--clr-text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-copy {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-width: 220px; }
}

@media (max-width: 768px) {
  :root {
    --navbar-height: 60px;
    --container-pad: 16px;
  }
}

@media (max-width: 480px) {
  .modal-box { max-width: 100%; margin: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

/* ─── HYBRID DROPDOWN UI ─────────────────────────────────────────────── */
/* 1. Generic positioning */
.hybrid-dropdown-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.hybrid-dropdown-wrapper.active {
  z-index: 150;
}

/* 2. Custom Button Trigger inheriting form-control */
.hybrid-dropdown-trigger {
  text-align: left;
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  /* Reset some button defaults so it looks exactly like original select */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--input-bg, var(--clr-bg-card));
  color: var(--input-color, var(--clr-text));
}

.hybrid-dropdown-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-dropdown-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--clr-text-secondary);
}

.hybrid-dropdown-wrapper.active .filter-dropdown-chevron {
  transform: rotate(-180deg);
  color: var(--clr-brand);
}

.hybrid-dropdown-wrapper.active .hybrid-dropdown-trigger,
.hybrid-dropdown-trigger:focus {
  border-color: var(--clr-brand);
  box-shadow: 0 0 0 3px var(--clr-brand-glow);
  outline: none;
}

/* Validation visual feedback */
.hybrid-dropdown-trigger.drop-error-border {
  border-color: var(--clr-danger) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2) !important;
}

/* Modern Menu Structure ported from List Car */
.filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  min-width: max-content;
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all 0.2s ease;
}

.hybrid-dropdown-wrapper.active .filter-dropdown-menu,
.filter-dropdown.active .filter-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.filter-dropdown-search {
  padding: 12px;
  border-bottom: 1px solid var(--clr-border);
  background: var(--clr-bg-card);
}

.filter-search-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--clr-bg-input);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  color: var(--clr-text-primary);
  font-size: 14px;
}

.filter-search-input:focus {
  outline: none;
  border-color: var(--clr-brand);
  box-shadow: 0 0 0 2px var(--clr-brand-glow);
}

.filter-dropdown-list {
  max-height: 250px;
  overflow-y: auto;
  list-style: none;
  padding: 8px 0;
  margin: 0;
}

.filter-dropdown-item {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--clr-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-dropdown-item:hover, .keyboard-focus {
  background: var(--clr-bg-card-hover);
  color: var(--clr-text-primary);
}

.filter-dropdown-item.active {
  background: var(--clr-brand-glow);
  color: var(--clr-brand-light);
  font-weight: 500;
}

.filter-dropdown-item.active::after {
  content: "✔";
  margin-left: auto;
  font-size: 12px;
  color: var(--clr-brand-light);
}

/* ─── RTL SUPPORT (Arabic) ─────────────────────────────────────────────── */
[dir="rtl"] .hybrid-dropdown-trigger {
  text-align: right;
  /* Flexbox `justify-content: space-between` naturally flips items in RTL, 
     so the chevron moves to the far left automatically! */
}

[dir="rtl"] .hybrid-dropdown-label {
  text-align: right;
}

[dir="rtl"] .filter-dropdown-item {
  text-align: right;
}

[dir="rtl"] .filter-dropdown-item.active::after {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .filter-search-input {
  text-align: right;
}

/* ── Validation Styles ───────────────────────── */
.input-error {
  border-color: var(--clr-danger) !important;
  background-color: rgba(220, 53, 69, 0.05) !important;
  color: var(--clr-text-primary) !important;
}
.input-error::placeholder {
  color: rgba(220, 53, 69, 0.8) !important;
}

/* ─── NOTIFICATION SYSTEM ────────────────────────────────────────────── */
.notif-container {
  position: relative;
  display: flex;
  align-items: center;
}

.notif-bell-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--clr-text-primary);
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  cursor: pointer;
  z-index: 10;
}

.notif-bell-btn:hover {
  background: rgba(120, 120, 150, 0.1); 
  border: 1px solid var(--clr-border);
  transform: translateY(-1px);
}

.notif-bell-btn svg {
  transition: transform var(--transition-spring);
}

.notif-bell-btn:hover svg {
  transform: rotate(15deg) scale(1.1);
}

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--clr-brand, #ff4c24);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  height: 18px;
  min-width: 18px;
  border-radius: 10px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--clr-bg-base);
  animation: motorx-fade-in 0.3s ease;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: -10px;
  width: 340px;
  max-width: 90vw;
  background: var(--glass-bg, var(--clr-bg-card));
  backdrop-filter: var(--glass-blur, blur(12px));
  -webkit-backdrop-filter: var(--glass-blur, blur(12px));
  border: 1px solid var(--glass-border, var(--clr-border));
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.98);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
  overflow: hidden;
  transform-origin: top right;
}

.notif-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--clr-border);
  background: rgba(0,0,0,0.05);
}

.notif-title {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--clr-text-primary);
}

.notif-mark-all {
  background: none;
  border: none;
  color: var(--clr-brand);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

.notif-mark-all:hover {
  color: var(--clr-brand-light);
  text-decoration: underline;
}

.notif-list {
  max-height: 400px;
  overflow-y: auto;
}

.notif-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--clr-border);
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: var(--clr-bg-input, rgba(255,255,255,0.03));
}

.notif-item.unread {
  background: rgba(255, 76, 36, 0.05); /* very light brand color overlay */
  border-left: 3px solid var(--clr-brand);
}

.notif-item-title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--clr-text-primary);
}

.notif-item-msg {
  font-size: 0.85rem;
  color: var(--clr-text-secondary);
  line-height: 1.5;
}

.notif-item-time {
  font-size: 0.75rem;
  color: var(--clr-text-muted);
  margin-top: 2px;
}

.notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--clr-text-muted);
  font-size: 0.9rem;
}

.notif-loading {
  padding: 40px;
  display: flex;
  justify-content: center;
}

/* RTL Support */
[dir="rtl"] .notif-dropdown {
  right: auto;
  left: -10px;
  transform-origin: top left;
}
[dir="rtl"] .notif-item.unread {
  border-left: none;
  border-right: 3px solid var(--clr-brand);
}

