/* =========================
   Base / Utilities
========================= */
.cursor-pointer { cursor: pointer; }

html,
body {
  block-size: 100%;
  min-block-size: 100%;
  overflow: hidden;
}

app-root {
  display: block;
  block-size: 100%;
  overflow: hidden;
}

.app-shell {
  block-size: 100dvh;
  overflow: hidden;
}

body { font-family: 'CoconFont'; }

body.lang-rtl {
  direction: rtl;
}

body.lang-ltr {
  direction: ltr;
}

/* ── RTL: align form inputs & placeholders to the right ── */
[dir="rtl"] .form-control,
[dir="rtl"] .form-select {
  text-align: right;
}
[dir="rtl"] .form-control::placeholder,
[dir="rtl"] .form-select::placeholder {
  text-align: right;
}


/* Prevent annoying scroll when dropdowns are open */
body.dropdown-open { overflow-anchor: none; }

.page-item { cursor: pointer; }

.header-title,
.nav-tabs .nav-overflow { white-space: nowrap; }

.black-menu {
  color: #00000080;
  padding: 7px;
  font-size: 20px;
  border-radius: 50%;
}
.black-menu:hover {
  cursor: pointer;
  color: #000;
  transition: background-color 0.5s ease;
  background-color: rgba(0, 0, 0, 0.2);
}

ul { list-style-type: none; padding-left: 0; margin: 0; }

.dropdown-menu {
  padding: 8px;
  border-radius: 0.5rem;
  border: none;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1050 !important;
  max-width: 100%;
  word-wrap: break-word;
}
.dropdown-item { border-radius: 6px; margin-top: 2px; margin-bottom: 2px; }
.dropdown-item:focus,
.dropdown-item:hover { background-color: rgba(62, 164, 228, 0.2); border-radius: 6px; }

@font-face {
  font-family: 'CoconFont';
  src: url('../fonts/cocon_next_arabic_light.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

/* =========================
   Layout Vars (Desktop)
========================= */
:root{
  --sidebar-expanded: 250px;
  --sidebar-collapsed: 80px;
  --brand-primary: #9f39d3;
  --brand-primary-soft: #f4e8fb;
  --brand-primary-muted: #c769e6;
  --brand-primary-deep: #7429b6;
  --brand-primary-rgb: 159, 57, 211;
  --bs-primary: var(--brand-primary);
  --bs-primary-rgb: var(--brand-primary-rgb);
  --surface-bg: #f6f7fb;
  --surface-card: #ffffff;
  --surface-border: #e7eaf2;
  --text-strong: #26364a;
  --text-muted: #7b8798;
  --shadow-soft: 0 8px 24px rgba(39, 48, 67, 0.07);
  --shadow-hover: 0 14px 32px rgba(39, 48, 67, 0.11);
}

/* =========================
   Main Layout
========================= */
.main-layout {
  height: 100%;
  min-height: 0;
  display: flex;
  overflow: hidden;
  background: var(--surface-bg);
}

.sidebar {
  height: 100%;
  flex-shrink: 0;
}

/* Wrapper holds content + footer */
.main-content-wrapper {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  inline-size: 100%;
  margin-inline-start: var(--sidebar-expanded);
  transition: margin-inline-start 0.3s ease, inline-size 0.3s ease;
}

/* Scroll only the content area */
.main-content {
  flex: 1 1 auto;
  min-height: 0;
  block-size: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface-bg);
  scroll-behavior: smooth;
  padding-block-start: 0 !important;
}

/* Slim, subtle scrollbar for the content area (overrides the chunky global one) */
.main-content {
  scrollbar-width: thin;
  scrollbar-color: var(--brand-primary-muted) transparent;
}
.main-content::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.main-content::-webkit-scrollbar-track {
  background: transparent;
}
.main-content::-webkit-scrollbar-thumb {
  background: var(--brand-primary-muted);
  border: none;
  border-radius: 999px;
}
.main-content::-webkit-scrollbar-thumb:hover {
  background: var(--brand-primary-deep);
}

body.lang-rtl .main-content {
  direction: rtl;
}

body.lang-rtl .main-scroll-inner {
  direction: rtl;
  min-height: 100%;
}

body.lang-ltr .main-content {
  direction: ltr;
}

body.lang-ltr .main-scroll-inner {
  direction: ltr;
  min-height: 100%;
}

/* ===== Desktop widths (use logical props for RTL/LTR) ===== */
.main-content {
  inline-size: 100%;
  margin-inline-start: 0;
  transition: inline-size 0.3s ease;
}

/* when sidebar is expanded (default) */
body:not(.collapsed) .main-content-wrapper {
  margin-inline-start: var(--sidebar-expanded);
  inline-size: calc(100% - var(--sidebar-expanded));
}

/* when sidebar is collapsed */
body.collapsed .main-content-wrapper {
  margin-inline-start: var(--sidebar-collapsed);
  inline-size: calc(100% - var(--sidebar-collapsed));
}

/* smoother equal-height transitions while sidebar animates */
body.sidebar-transition .equal-height-col,
body.sidebar-transition .equal-height-card { transition: all 0.4s ease-in-out; }

/* =========================
   Footer (logical props)
========================= */
.main-footer {
  position: static;
  flex: 0 0 auto;
  background-color: rgba(255, 255, 255, 0.82);
  color: var(--text-muted);
  padding: 10px 20px;
  font-size: 13px;
  box-shadow: 0 -1px 0 rgba(231, 234, 242, 0.9);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

/* desktop widths for footer */
body:not(.collapsed) .main-footer {
  margin-inline-start: 0;
  inline-size: 100%;
}
body.collapsed .main-footer {
  margin-inline-start: 0;
  inline-size: 100%;
}

/* =========================
   Mobile behaviour (kept intact)
========================= */
@media (max-width: 768px) {
  nav.sidebar {
    height: 100vh;
    transition: all 0.3s ease;
  }

  /* Keep sidebar embedded when collapsed (no transform) */
  body.collapsed nav.sidebar {
    position: relative;
    transform: none !important;
    height: 100%;
  }

  /* Sidebar slides in from the inline-start side (auto flips with dir) */
  body:not(.collapsed) nav.sidebar {
    position: fixed;
    inset-block-start: 0;         /* top */
    inset-inline-start: 0;        /* left in LTR, right in RTL */
    inline-size: var(--sidebar-expanded);
    z-index: 1050;
    transform: translateX(0);
    background-color: #fff;
    overflow-y: auto;
  }

  /* Content should always take full width on mobile */
  .main-content {
    margin-inline-start: 0 !important;
    inline-size: 100% !important;
    overflow: scroll;
    padding-bottom: 27px !important;
  }

  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
  }

  .main-layout {
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
  }

  .main-content-wrapper {
    height: 100vh;
    margin-inline-start: 0 !important;
    inline-size: 100% !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .main-footer {
    inline-size: 100% !important;
    font-size: 12px;
    padding: 10px;
    margin-inline-start: 0 !important;
  }
}

/* =========================
   Spacing / Forms / Effects
========================= */
/* .main-content { padding-bottom: 32px !important; } */

/* Smooth transitions for form steps */
.card {
  scroll-behavior: smooth;
  border-color: var(--surface-border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.btn-custom {
  --bs-btn-bg: var(--brand-primary) !important;
  --bs-btn-border-color: var(--brand-primary) !important;
  --bs-btn-hover-bg: var(--brand-primary-deep) !important;
  --bs-btn-hover-border-color: var(--brand-primary-deep) !important;
  --bs-btn-active-bg: var(--brand-primary-deep) !important;
  --bs-btn-active-border-color: var(--brand-primary-deep) !important;
  box-shadow: 0 8px 18px rgba(159, 57, 211, 0.18);
}

.btn-outline-custom {
  --bs-btn-color: var(--brand-primary) !important;
  --bs-btn-border-color: var(--brand-primary) !important;
  --bs-btn-hover-bg: var(--brand-primary) !important;
  --bs-btn-hover-border-color: var(--brand-primary) !important;
  --bs-btn-hover-color: #fff !important;
  --bs-btn-active-bg: var(--brand-primary-deep) !important;
  --bs-btn-active-border-color: var(--brand-primary-deep) !important;
  --bs-btn-active-color: #fff !important;
}

/* Better form field spacing to prevent jumpiness */
.form-control, .form-select, .searchable-select {
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-primary, #9f39d3);
  box-shadow: 0 0 0 0.15rem rgba(var(--brand-primary-rgb, 159, 57, 211), 0.18);
}

.form-control::placeholder,
.search-input::placeholder {
  color: #9aa6b8;
}

/* Unified table actions menu */
.actions-dropdown-menu,
.btn-group:has(.fe-more-vertical) > .dropdown-menu {
  z-index: 1095;
  min-width: 150px;
  padding: 0.35rem 0;
  border: 1px solid rgba(159, 57, 211, 0.08);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(38, 54, 74, 0.14);
  overflow: hidden;
}

.actions-dropdown-menu .dropdown-item,
.btn-group:has(.fe-more-vertical) > .dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 38px;
  padding: 0.55rem 0.9rem;
  color: var(--text-strong, #26364a);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.actions-dropdown-menu .dropdown-item:hover,
.btn-group:has(.fe-more-vertical) > .dropdown-menu .dropdown-item:hover {
  background: var(--brand-primary-soft, #f4e8fb);
  color: var(--brand-primary-deep, #7429b6);
}

.actions-dropdown-menu .dropdown-item.text-danger:hover,
.btn-group:has(.fe-more-vertical) > .dropdown-menu .dropdown-item.text-danger:hover {
  background: rgba(220, 53, 69, 0.08);
  color: #dc3545 !important;
}

.actions-dropdown-menu .dropdown-item i,
.btn-group:has(.fe-more-vertical) > .dropdown-menu .dropdown-item i {
  flex: 0 0 auto;
  width: 16px;
  margin: 0 !important;
  text-align: center;
}

body.lang-ltr .actions-dropdown-menu,
body.lang-ltr .btn-group:has(.fe-more-vertical) > .dropdown-menu {
  direction: ltr !important;
  text-align: left !important;
}

body.lang-rtl .actions-dropdown-menu,
body.lang-rtl .btn-group:has(.fe-more-vertical) > .dropdown-menu {
  direction: rtl !important;
  text-align: right !important;
}

body.lang-ltr .actions-dropdown-menu .dropdown-item,
body.lang-ltr .btn-group:has(.fe-more-vertical) > .dropdown-menu .dropdown-item {
  direction: ltr !important;
  flex-direction: row !important;
  justify-content: flex-start;
  text-align: left !important;
}

body.lang-rtl .actions-dropdown-menu .dropdown-item,
body.lang-rtl .btn-group:has(.fe-more-vertical) > .dropdown-menu .dropdown-item {
  direction: rtl !important;
  flex-direction: row !important;
  justify-content: flex-start;
  text-align: right !important;
}

/* Prevent layout shift when validation messages appear */
.invalid-feedback {
  min-height: 1.25rem;
  margin-top: 0.25rem;
  display: block;
}

/* app.component.css */
.main-wrapper { position: relative; overflow-x: hidden; }

@keyframes fadeSlideIn {
  0%   { opacity: 0; transform: translateY(10px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0)   scale(1); }
}

.custom-switch-pink .form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}


html {
  scrollbar-width: thin;
  scrollbar-color: var(--brand-primary-muted) transparent;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--brand-primary-muted);
  border-radius: 999px;
  border: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-primary-deep);
}

.table-responsive,
.modal-body,
.dropdown-menu,
.dropdown-menu-portal,
.options-container,
ngb-modal-window,
.modal {
  scrollbar-width: thin;
  scrollbar-color: var(--brand-primary-muted) transparent;
}

.table-responsive::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.dropdown-menu::-webkit-scrollbar,
.dropdown-menu-portal::-webkit-scrollbar,
.options-container::-webkit-scrollbar,
ngb-modal-window::-webkit-scrollbar,
.modal::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.table-responsive::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.dropdown-menu::-webkit-scrollbar-track,
.dropdown-menu-portal::-webkit-scrollbar-track,
.options-container::-webkit-scrollbar-track,
ngb-modal-window::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track {
  background: transparent;
}

.table-responsive::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.dropdown-menu::-webkit-scrollbar-thumb,
.dropdown-menu-portal::-webkit-scrollbar-thumb,
.options-container::-webkit-scrollbar-thumb,
ngb-modal-window::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
  background: var(--brand-primary-muted);
  border-radius: 999px;
  border: 0;
}

[data-aos] {
  pointer-events: auto;
}

/* Ensure dropdown selects always appear above Google Maps and other content */
.searchable-select .dropdown-menu.show,
.location-select-container .dropdown-menu.show {
  z-index: 10000 !important;
  position: absolute !important;
}

/* Additional mobile support for dropdowns */
@media (max-width: 768px) {
  .searchable-select .dropdown-menu.show,
  .location-select-container .dropdown-menu.show {
    z-index: 10001 !important;
  }
}
