:root {
  --primary-color: #073291;
  /* لون الزر الأساسي */
  --secondary-color: #e5f1ff;
  --accent-color: #F9A62C;
  /* لون الخلفيات الفاتحة */
  --text-color-dark: #333;
  --text-color-light: #555;
  --border-color: #ddd;
  --card-bg-color: #fff;
  --badge-bg-color: #e8f9ee;
  --badge-text-color: #007934;
}

/* التنسيقات الأساسية */
body {
  font-family: "IBM Plex Sans Arabic", serif;
  background-color: #F5F5F5;
  margin: 0;
  /* padding: 20px; */
  direction: rtl;
  text-align: right;
  color: var(--text-color-dark);
}

/* طبقة التغطية الكاملة للشاشة */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  /* خلفية بيضاء شفافة قليلاً */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  /* تأكد من أنه يظهر فوق كل شيء آخر */
  opacity: 0;
  /* مخفي في البداية */
  visibility: hidden;
  /* مخفي في البداية */
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

/* لإظهار الـ Loader */
.loader-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* الصورة داخل الـ Loader */
.loader-image {
  width: 120px;
  /* حجم الصورة، يمكنك تعديله */
  height: 120px;
  /* حجم الصورة، يمكنك تعديله */
  animation: fadeInOut 2s infinite ease-in-out;
  /* تطبيق الرسوم المتحركة */
}

/* تعريف الرسوم المتحركة */
@keyframes fadeInOut {
  0% {
    opacity: 0;
    /* يبدأ مخفيًا */
  }

  50% {
    opacity: 1;
    /* يصل إلى أقصى وضوح في منتصف الأنميشن */
  }

  100% {
    opacity: 0;
    /* يعود إلى الاختفاء في النهاية */
  }
}

button {
  font-family: "IBM Plex Sans Arabic", serif;
}

/* تنسيق رأس الصفحة العام */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    /* border-radius: 20px; */
    position: sticky;
    top: 0;
    z-index: 50; /* تأكد من أنه يظهر فوق المحتوى الآخر */
}

/* تنسيق الشعار */
.logo {
    height: 30px; /* يمكنك تعديل الحجم */
    display: block;
}

/* تنسيق زر التحميل */
.download-btn {
    display: flex;
    align-items: center;
    background-color: #F9A62C; /* لون أزرق جذاب لمتجر جوجل بلاي */
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 50px; /* شكل بيضاوي جذاب */
    font-weight: bold;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

/* تنسيق أيقونة جوجل بلاي */
.download-btn i {
    margin-left: 10px; /* مسافة بين الأيقونة والنص */
    font-size: 20px;
}

/* تأثير عند المرور بالماوس */
.download-btn:hover {
    background-color: #f97e2c;
}

/* للتأكد من المظهر الجيد على الشاشات الأصغر */
@media (max-width: 768px) {
    .main-header {
        padding: 10px 15px;
    }
    .download-btn {
        font-size: 14px;
        padding: 8px 15px;
    }
    .download-btn i {
        font-size: 18px;
    }
    .logo {
        height: 40px;
    }
}

.container {
  display: flex;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  margin-top: 24px;
}

.sidebar {
  flex-basis: 350px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background-color: var(--card-bg-color);
  /* border: 1px solid var(--border-color); */
  border-radius: 12px;
  padding: 20px;
  /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); */
}

/* تنسيقات الشريط الجانبي */
.company-info {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
}

.company-logo {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  background-color: #f0f0f0;
  object-fit: cover;
}

.map-card h4,
.required-items h4,
.attached-files h4 {
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--text-color-dark);
}

.map-container {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 15px;
}

#map {
  width: 100%;
  height: 200px;
  display: block;
}

.btn {
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  display: block;
  text-align: center;
}

.btn-map {
  background-color: var(--secondary-color);
  color: var(--primary-color);
}

/* تنسيقات المحتوى الرئيسي */
.project-header {
  background-color: var(--card-bg-color);
  /* border: 1px solid var(--border-color); */
  border-radius: 12px;
  padding: 25px;
  /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); */
}

.badges {
  display: flex;
  gap: 10px;
  font-size: 14px;
  margin-bottom: 15px;
}

.badge {
  background-color: #f0f0f0;
  padding: 5px 10px;
  border-radius: 20px;
  color: var(--text-color-light);
}

.badge.active {
  background-color: var(--badge-bg-color);
  color: var(--badge-text-color);
  font-weight: bold;
}

.project-header h1 {
  font-size: 28px;
  margin: 0 0 10px 0;
}

.location,
.price {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-color-light);
  font-size: 14px;
  margin-bottom: 10px;
}

.price {
  color: var(--badge-text-color);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-share {
  background-color: var(--card-bg-color);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
}

/* تنسيقات قسم الوصف */
.project-description ul {
  list-style-type: none;
  padding: 0;
  margin: 15px 0;
}

.project-description li {
  margin-bottom: 10px;
}

.contact-info {
  font-weight: bold;
}

/* تنسيقات البنود المطلوبة */
.item-list {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.item {
  background-color: var(--secondary-color);
  padding: 15px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  color: var(--primary-color);
  font-weight: bold;
  flex-grow: 1;
}

.item i {
  font-size: 20px;
  margin-bottom: 5px;
}

.item p {
  font-weight: normal;
  color: var(--text-color-light);
  font-size: 14px;
  margin: 0;
}

/* تنسيقات الملفات المرفقة */
/* تنسيقات الملفات المرفقة */
.file-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.file-item {
  background-color: var(--secondary-color);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--text-color-dark);
  text-decoration: none;
  transition: background-color 0.3s ease;
  flex-wrap: wrap;
  /* السماح للعناصر بالالتفاف */
  justify-content: flex-start;
  /* لضمان أن العناصر تبدأ من اليمين */
}

.file-item:hover {
  background-color: #e0e9f1;
}

.file-item i {
  font-size: 24px;
  color: var(--primary-color);
  flex-shrink: 0;
  /* منع الأيقونة من التقلص */
}

.file-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* لمنع المحتوى من التجاوز */
}

.file-info span {
  font-weight: bold;
  display: block;
  white-space: normal;
  /* السماح للنص بالنزول إلى سطر جديد */
  word-break: break-word;
  /* كسر الكلمات الطويلة لمنع تجاوز الحاوية */
}

.file-info small {
  display: block;
  color: var(--text-color-light);
  font-size: 12px;
}

.download-icon {
  font-size: 18px;
  color: var(--text-color-light) !important;
  flex-shrink: 0;
  /* منع أيقونة التحميل من التقلص */
}

/* Popup Overlay */
#auth-popup-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  /* لون أسود شفاف */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  /* للتأكد من أنها تظهر فوق جميع العناصر */
  visibility: hidden;
  /* مخفية بشكل افتراضي */
  opacity: 0;
  transition: visibility 0s, opacity 0.3s;
}

#auth-popup-overlay.show {
  visibility: visible;
  opacity: 1;
}

/* Popup Container */
#auth-popup-container {
  background-color: var(--card-bg-color);
  /* أبيض، يطابق لون البطاقات */
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 400px;
  position: relative;
  text-align: center;
}

/* Close Button */
#close-popup-btn {
  position: absolute;
  top: 15px;
  left: 15px;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-color-light);
  cursor: pointer;
}

/* Popup Content */
.auth-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.auth-title {
  font-size: 24px;
  margin: 0;
  color: var(--text-color-dark);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-color-light);
  margin: 0 0 10px 0;
}

/* Google Sign-in Button */
.btn-google {
  background-color: #4285f4;
  /* لون Google الأزرق */
  color: #fff;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
  width: 100%;
}

.btn-google:hover {
  background-color: #357ae8;
}

.google-icon {
  width: 20px;
  height: 20px;
}

/* Sidebar and Panel Styles */
#company-form-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  /* Align to the left for a side panel effect */
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  /* Semi-transparent overlay */
  display: flex;
  justify-content: flex-start;
  /* Align panel to the left */
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s, opacity 0.3s;
}

#company-form-panel-overlay.show {
  visibility: visible;
  opacity: 1;
}

#company-form-panel {
  background-color: var(--card-bg-color);
  /* Matches the main cards */
  width: 90%;
  max-width: 450px;
  height: 100%;
  padding: 25px;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* Enable scrolling for long forms */
  transform: translateX(-100%);
  /* Start off-screen */
  transition: transform 0.3s ease-in-out;
  border-left: 1px solid var(--border-color);
  /* Adds a subtle separator */
}

#company-form-panel-overlay.show #company-form-panel {
  transform: translateX(0);
  /* Slide in from the left */
}

/* Close Button */
#close-panel-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 32px;
  color: var(--text-color-light);
  cursor: pointer;
  z-index: 1001;
}

/* Form Headings */
.panel-title {
  font-size: 28px;
  color: var(--text-color-dark);
  margin-bottom: 5px;
}

.panel-subtitle {
  font-size: 14px;
  color: var(--text-color-light);
  margin-bottom: 25px;
}

/* Form Groups and Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: bold;
  color: var(--text-color-dark);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-color-dark);
  background-color: #fcfcfc;
  box-sizing: border-box;
  /* Ensures padding doesn't affect total width */
}

.form-group textarea {
  resize: vertical;
  /* Allow vertical resizing only */
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--secondary-color);
}

/* Button Styling */
.btn-primary {
  /* width: 100%; */
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  padding: 16px 32px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

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

/* RTL Support */
[dir="rtl"] #company-form-panel-overlay {
  justify-content: flex-end;
  /* Align to the right for RTL */
}

[dir="rtl"] #company-form-panel {
  transform: translateX(100%);
  /* Start off-screen to the right */
}

[dir="rtl"] #company-form-panel-overlay.show #company-form-panel {
  transform: translateX(0);
  /* Slide in from the right */
}

/* تنسيقات اللوحة الجانبية الجديدة */
#offer-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  /* أو right: 0; للتصميم العربي */
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: flex-start;
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s, opacity 0.3s;
}

#offer-panel-overlay.show {
  visibility: visible;
  opacity: 1;
}

#offer-panel-container {
  background-color: var(--card-bg-color);
  width: 90%;
  max-width: 450px;
  height: 100%;
  padding: 25px;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  border-left: 1px solid var(--border-color);
}

#offer-panel-overlay.show #offer-panel-container {
  transform: translateX(0);
}

#close-offer-panel-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 32px;
  color: var(--text-color-light);
  cursor: pointer;
  z-index: 1001;
}

.form-section-title {
  font-size: 18px;
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 5px;
  margin-bottom: 20px;
}

/* تنسيقات حقول الأسعار */
.price-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.price-input-group label {
  flex-shrink: 0;
  width: 150px;
}

.price-input-group input {
  flex-grow: 1;
}

/* تنسيقات الـ Chips */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  background-color: var(--primary-color);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chip .close-chip {
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: #fff;
  font-weight: bold;
}

/* تنسيقات مجموعة مربعات الاختيار */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 10px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  /* لإلغاء النمط الغامق من الأنماط الأساسية للـ form-group */
  color: var(--text-color-dark);
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

/* تنسيق مربع الاختيار عند التحقق (checked) */
.checkbox-group input[type="checkbox"]:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-group input[type="checkbox"]:checked::after {
  content: '\2713';
  /* علامة صح (✓) */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
}

.full-width-button {
  width: 100%;
  justify-content: center;
  align-items: center;
}

/* Placeholder container */
.placeholder-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
  /* يضمن أن الـ placeholder يملأ نصف ارتفاع الشاشة على الأقل */
  padding: 20px;
  background-color: #f8f9fa;
  /* لون خلفية فاتح */
  border-radius: 8px;
  margin: 20px auto;
  width: 90%;
  max-width: 800px;
}

/* Placeholder content box */
.placeholder-content {
  text-align: center;
  color: #495057;
}

/* Icon styling */
.placeholder-icon {
  font-size: 60px;
  color: #ced4da;
  margin-bottom: 20px;
}

/* Text styling */
.placeholder-text {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 15px;
}

/* تنسيق طبقة التغطية */
.share-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* تنسيق صندوق الـ Popup */
.share-popup {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 400px;
  padding: 20px;
  text-align: center;
}

/* Header */
.share-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

/* زر الإغلاق */
.close-popup-btn {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #888;
}

.close-popup-btn:hover {
  color: #000;
}

/* تنسيق خيارات المشاركة */
.share-popup-body {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #555;
  font-weight: bold;
  transition: transform 0.2s ease-in-out;
}

.share-option:hover {
  transform: translateY(-5px);
}

/* تنسيق الأيقونات لكل منصة */
.share-option i {
  font-size: 3rem;
  margin-bottom: 5px;
}

.facebook-icon {
  color: #3b5998;
}

.whatsapp-icon {
  color: #25d366;
}

.email-icon {
  color: #888;
}

.link-icon {
  color: #007bff;
}

/* تنسيقات الـ RTL */
[dir="rtl"] #offer-panel-overlay {
  justify-content: flex-end;
}

[dir="rtl"] #offer-panel-container {
  transform: translateX(-100%);
}

[dir="rtl"] #offer-panel-overlay.show #offer-panel-container {
  transform: translateX(0);
}

/* التجاوبية */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    padding: 10px;
  }

  .sidebar {
    flex-basis: auto;
  }

  .actions {
    flex-direction: column;
  }
}