/* =========================
   Base / Utilities
========================= */
.cursor-pointer { cursor: pointer; }

body { font-family: 'CoconFont'; }

/* 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;
  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;
}

/* =========================
   Main Layout
========================= */
.main-layout {
  height: 100vh;            /* أو 100dvh للأجهزة الحديثة */
  display: flex;
  overflow: hidden;
}

.sidebar {
  height: 100%;
  flex-shrink: 0;
}

/* Wrapper holds content + footer */
.main-content-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Scroll only the content area */
.main-content {
  flex-grow: 1;
  overflow-y: auto;
  overflow: hidden;
}

/* ===== Desktop widths (use logical props for RTL/LTR) ===== */
.main-content {
  inline-size: 100%;
  margin-inline-start: var(--sidebar-expanded);
  transition: margin-inline-start 0.3s ease, inline-size 0.3s ease;
}

/* when sidebar is expanded (default) */
body:not(.collapsed) .main-content {
  margin-inline-start: var(--sidebar-expanded);
  inline-size: calc(100% - var(--sidebar-expanded));
}

/* when sidebar is collapsed */
body.collapsed .main-content {
  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: fixed;
  inset-block-end: 0;            /* bottom */
  inset-inline-start: 0;         /* left in LTR, right in RTL */
  background-color: rgba(255, 255, 255, 0.6);
  color: #999595;
  padding: 12px 20px;
  font-size: 14px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(8px);
  z-index: 999;
  transition: all 0.3s ease;
}

/* desktop widths for footer */
body:not(.collapsed) .main-footer {
  margin-inline-start: var(--sidebar-expanded);
  inline-size: calc(100% - var(--sidebar-expanded));
}
body.collapsed .main-footer {
  margin-inline-start: var(--sidebar-collapsed);
  inline-size: calc(100% - var(--sidebar-collapsed));
}

/* =========================
   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;
    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; }

/* 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;
}

/* 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 .form-check-input:checked {
  background-color: #e03131; /* أحمر نظيف ومرتب */
  border-color: #e03131;
}

.custom-switch .form-check-input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* RTL Support for Switch */
[dir="rtl"] .form-check.form-switch,
html[dir="rtl"] .form-check.form-switch,
body[dir="rtl"] .form-check.form-switch {
  padding-right: 1.rem !important;
  padding-left: 0 !important;
}

[dir="rtl"] .form-check.form-switch .form-check-input,
html[dir="rtl"] .form-check.form-switch .form-check-input,
body[dir="rtl"] .form-check.form-switch .form-check-input {
  margin-right: -2.5rem !important;
  margin-left: 0 !important;
  float: right !important;
}

html[dir="rtl"] .dropdown-item {
  text-align: right !important;
}


/* 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;
  }
}


/* لما تكون اللغة RTL */
:root:dir(rtl) input[type=email],
:root:dir(rtl) input[type=number],
:root:dir(rtl) input[type=tel],
:root:dir(rtl) input[type=url] {
    direction: rtl;
    text-align: right;
}

/* لما تكون اللغة LTR (الوضع الطبيعي) */
:root:dir(ltr) input[type=email],
:root:dir(ltr) input[type=number],
:root:dir(ltr) input[type=tel],
:root:dir(ltr) input[type=url] {
    direction: ltr;
    text-align: left;
}
