/**
* 
*/

/* Variables */
:root {
  --mishnis-primary: #065f5e;
  --mishnis-text: #1d1d1f;
  --mishnis-light: #EDF1F7;
  --mishnis-danger: #991B1B;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --sidebar-width: 260px;
  --header-height: 70px;
  --primary-light: #003d7a;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --border-color: rgba(0, 0, 0, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.7);
}

body {
  font-family: 'Noto Kufi Arabic', sans-serif;
  background-color: var(--mishnis-light);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/*
* Buttons
*/
.btn {
  border-radius: 50px;
}
.btn-primary {
  background-color: var(--mishnis-primary);
  border-color: var(--mishnis-primary);
}

/*
* Tooltips
*/
.tooltip {
  font-family: 'Noto Kufi Arabic', sans-serif;
}

/*
* Cards
*/
.card {
  border-radius: 18px;
  overflow: hidden;
}

/*
* Form Controls
*/
.form-control,
.form-select {
  border-radius: 12px;
}

/*
* Dropdowns
*/
.dropdown-menu {
  border-radius: 16px;
}

/*
* Tables
*/
.table-responsive {
  font-size: 14px;
}

/*
* Modals
*/
.modal {
  backdrop-filter: saturate(180%) blur(4px);
  -webkit-backdrop-filter: saturate(180%) blur(4px);
}
.modal-content {
  border-radius: 18px;
}

/*
* Accordions
*/
.accordion {
  border-radius: 18px!important;
  overflow: hidden;
  border: 1px solid var(--bs-border-color-translucent);
}
.accordion-item {
  border: none;
}

/* 
* Image Picker 
*/
.image-picker-container,
#sortableImages {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 15px;
}
.image-picker {
  width: 150px;
  height: 150px;
  border: 2px dashed #ccc;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background-color: #f9f9f9;
  transition: all 0.3s ease;
}
.image-picker:hover {
  border-color: #3498db;
  background-color: #f0f8ff;
}
.image-picker svg {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  color: #777;
}
.image-picker p {
  margin: 0;
  font-size: 14px;
  color: #777;
  text-align: center;
}
.image-picker input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}
.image-preview {
  width: 150px;
  height: 150px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.remove-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(255,255,255,0.8);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.remove-btn:hover {
  background-color: rgba(255,0,0,0.2);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0);
  backdrop-filter: saturate(180%) blur(4px);
  -webkit-backdrop-filter: saturate(180%) blur(4px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: opacity 0.2s;
}

.menu-toggle:hover {
  opacity: 0.6;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-dropdown {
  position: relative;
}

.header-icon {
  position: relative;
  width: 38px;
  height: 38px;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  font-size: 0.95rem;
  border: none;
  line-height: 12px;
}

.header-icon:hover {
  background: #e8e8ed;
  color: var(--text-primary);
  transform: scale(1.05);
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  background: #ff3b30;
  border: 2px solid white;
  border-radius: 10px;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  padding: 0 4px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mishnis-primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 500;
  color: white;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.user-avatar:hover {
  transform: scale(1.05);
}

/* Dropdown Menu */
.dropdown-menu-custom {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 280px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1001;
  overflow: hidden;
}

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

.dropdown-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.dropdown-item-custom {
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.2s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item-custom:hover {
  background: rgba(0, 36, 82, 0.06);
}

.dropdown-item-custom i {
  width: 20px;
  color: var(--text-secondary);
  font-size: 1rem;
}

.dropdown-item-custom span {
  font-size: 0.9rem;
}

.dropdown-item-custom .badge {
  background: #ff3b30;
  color: white;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
}

.notification-item {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s ease;
}

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

.notification-item:hover {
  background: rgba(0, 36, 82, 0.04);
}

.notification-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.notification-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.15);
}
.sidebar-toggler-small {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  background: rgba(0, 36, 82, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
  z-index: 2;
}
.sidebar.small {
  transition: .4s;
}
.sidebar.small:not(:hover) .nav-link span,
.sidebar.small:not(:hover) .nav-section-title,
.sidebar.small:not(:hover) .nav-submenu-item,
.sidebar.small:not(:hover) .bi-chevron-left {
  display: none;
}
.sidebar.small:not(:hover) {
  width: 80px;
}
body:has(.sidebar.small:not(:hover)) .main-content {
  margin-right: 80px;
}

.nav-menu {
  padding: 1.5rem 0;
  position: relative;
}

.nav-section {
  margin-bottom: 1rem;
}

.nav-section-title {
  padding: 0 1.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
}

.nav-item {
  position: relative;
  margin: 0.25rem 1rem;
  border-radius: 12px;
  overflow: visible;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  z-index: 2;
  gap: 0.85rem;
  border-radius: 12px;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-link span {
  font-weight: 500;
  letter-spacing: -0.2px;
}

.nav-arrow {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
  color: var(--text-secondary);
}

.nav-item.expanded .nav-arrow {
  transform: rotate(90deg);
}

/* Apple-style Liquid Glass Effect */
.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
      rgba(0, 36, 82, 0.08) 0%,
      rgba(0, 36, 82, 0.05) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
  box-shadow: 0 4px 16px rgba(0, 36, 82, 0);
}

.nav-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(135deg, 
      rgba(0, 36, 82, 0.15),
      rgba(0, 36, 82, 0.05));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 0;
}

.nav-item:hover::before {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 8px 24px rgba(0, 36, 82, 0.08);
}

.nav-item:hover::after {
  opacity: 1;
}

.nav-item.active::before {
  opacity: 1;
  transform: scale(1);
  background: linear-gradient(135deg, 
      rgba(0, 36, 82, 0.12) 0%,
      rgba(0, 36, 82, 0.08) 100%);
  box-shadow: 0 8px 32px rgba(0, 36, 82, 0.12),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-item.active::after {
  opacity: 1;
  background: linear-gradient(135deg, 
      rgba(0, 36, 82, 0.3),
      rgba(0, 36, 82, 0.1));
}

.nav-item.active .nav-link {
  color: var(--mishnis-primary);
  font-weight: 600;
}

.nav-item.active .nav-link i {
  transform: scale(1.05);
}

/* Submenu */
.nav-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0.25rem;
}

.nav-item.expanded .nav-submenu {
  max-height: 500px;
  position: relative;
  z-index: 2;
}

.nav-submenu-item {
  position: relative;
  margin: 0.25rem 0.5rem 0.25rem 2.5rem;
  border-radius: 10px;
}

.nav-submenu-link {
  display: flex;
  align-items: center;
  padding: 0.55rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  border-radius: 10px;
  font-size: 0.9rem;
}

.nav-submenu-link:hover {
  color: var(--text-primary);
  background: rgba(0, 36, 82, 0.05);
}

.nav-submenu-item.active .nav-submenu-link {
  color: var(--mishnis-primary);
  font-weight: 500;
  background: rgba(0, 36, 82, 0.08);
}

/* Main Content */
.main-content {
  margin-right: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 1rem 0rem 1rem 1rem;
  min-height: calc(100vh - var(--header-height));
  transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .sidebar {
    transform: translateX(100%);
    background: rgba(255, 255, 255, 0.95);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-right: 0;
    padding: 1rem 0rem;
  }

  .header {
    padding: 0 1rem;
  }

  .header-right {
    gap: 0.5rem;
  }

  .dropdown-menu-custom {
    left: -0.5rem;
    min-width: 260px;
  }
}

/* Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  height: calc(100vh - var(--header-height));
  background: rgba(0, 0, 0, 0.3);
  z-index: 998;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/*
* properties
*/
.property-create-fixed-actions {
  background-color: #fff;
  padding: 10px;
  position: fixed;
  bottom: 0px;
  left: 0px;
  width: calc(100% - var(--sidebar-width));
  z-index: 1050;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}
@media (max-width: 768px) {
  .property-create-fixed-actions {
    width: 100%;
  }
}
.property-card-badge {
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 12px;
}
.property-card-badge.warning {
  background-color: #FFF1BD;
  color: #805300;
}
.property-card-badge.danger {
  color: #6D1322;
  background-color: #F8D3DA;
}
.property-card-badge.purple {
  color: #420F70;
  background-color: #E7CCFF;
}
.property-card-badge.info {
  color: #002B66;
  background-color: #CCE3FF;
}
.property-card-badge.success {
  color: #0C5A4A;
  background-color: #BCF6EA;
}