﻿:root {
  --primary-green: #25652c;
  --accent-orange: #f99d27;
  --light-green-bg: #dee8df;
  --filter-gray: #b6c7b9;
  --search-btn-green: #2d6a31;
}

.page-wrapper {
  margin-top: 35px;
  position: relative;
}

.custom-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 30px;
}

.opp-info-row {
  display: flex;
  justify-content: space-between; /* يبقي المسافة ثابتة بين اللّيبل والزر */
  align-items: center;
  margin-top: 1rem; /* مسافة من الوصف */
}

.opp-status {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 0.25rem;
  white-space: nowrap; /* يمنع التفاف النص */
}

.status-available {
  color: #155724;
  background-color: #d4edda;
}

.status-expired {
  color: #721c24;
  background-color: #f8d7da;
}

.btn-details {
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 0.25rem;
  background-color: #2a9d8f;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px; /* Restored your gap */
}

.header-logo {
  background-color: var(--accent-orange);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
}

html[dir="ltr"] .header-logo img {
  transform: scaleX(-1);
}
.header-title {
  color: var(--primary-green);
  font-weight: 700;
  font-size: 2rem;
  margin: 0;
}

.filter-btn {
  background-color: var(--light-green-bg);
  border: 1px solid #bbcfbe;
  border-radius: 6px;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--primary-green);
}

/* --- Filter Windows --- */
.filter-window {
  position: absolute;
  top: 75px;
  left: 0;
  width: 320px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  display: none;
}
html[dir="ltr"] .filter-window {
  left: auto;
  right: 0;
}

/* This positions the sub-menu relative to the main filter window */
.sub-filter-menu {
  position: absolute;
  top: 0;
  left: 102%; /* Pops out to the right side of the main window */
  width: 280px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  z-index: 1060;
  display: none;
  padding: 15px;
}

html[dir="ltr"] .sub-filter-menu {
  left: auto;
  right: 102%; /* Pops out to the left side for LTR */
}

.filter-window-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 2px solid #3b82f6;
}

.filter-option-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}

.filter-option-item.active {
  background-color: var(--filter-gray);
  color: var(--primary-green);
}

.reset-link {
  color: var(--primary-green);
  text-decoration: underline;
  font-size: 0.9rem;
}
/* Sub-menu checkbox list styles */
/* Ensure the list is scrollable */
.checkbox-list {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 5px; /* Space for the scrollbar */
  direction: rtl; /* Keeps scrollbar on the correct side for Arabic */
}

/* 1. Define the overall width of the scrollbar */
.checkbox-list::-webkit-scrollbar {
  width: 6px;
  display: block; /* Ensures it stays visible */
}

/* 2. Style the draggable handle (the "thumb") */
.checkbox-list::-webkit-scrollbar-thumb {
  background: #ddd; /* Matches the grey color in your screenshot */
  border-radius: 10px;
}

/* 3. Style the background track */
.checkbox-list::-webkit-scrollbar-track {
  background: transparent;
}

/* 4. HIDE THE ARROWS (The buttons at the top and bottom) */
.checkbox-list::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.9rem;
}

.sub-menu-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.btn-search-sub {
  background-color: var(--search-btn-green);
  color: white;
  border: none;
  padding: 5px 20px;
  border-radius: 6px;
}

.btn-cancel-sub {
  background: none;
  border: none;
  color: var(--search-btn-green);
  cursor: pointer;
}

/* --- Card Grid --- */
.opp-card {
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  padding: 15px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.opp-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  margin-bottom: 12px;
}

.opp-category-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.type-tag,
.category-tag {
  color: #f99d27;
}

.opp-title {
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #000;
}

.opp-description {
  font-size: 1.2rem;
  font-weight: 300;
  color: #000;
  margin-bottom: 20px;
  flex-grow: 2;
}

.btn-details {
  background-color: var(--accent-orange);
  color: white;
  border: none;
  width: 100%;
  padding: 12px;
  border-radius: 16px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  margin-top: auto;
}

/* --- Pagination Styling --- */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-top: 20px;
  /*border-top: 1px solid #eee; /* Subtle top separator */
  direction: rtl;
}

/* Text Link Styling */
.next-page-prompt a {
  color: var(--primary-green);
  text-decoration: underline;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Page Numbers Container */
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Individual Boxes */
.page-link-num,
.pagination-arrow {
  width: 38px;
  height: 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #dde2e5;
  border-radius: 4px;
  background-color: white;
  text-decoration: none;
  color: #212b36;
  font-weight: 600;
  font-size: 0.95rem;
}

/* The Active Page (Green Border) */
.page-link-num.active {
  border: 2px solid var(--primary-green);
  color: var(--primary-green);
}

/* Grey Arrow Styling */
.prev-arrow {
  background-color: #919eab;
  border: none;
  color: #c4cdd5;
}

.next-arrow {
  background-color: #919eab;
  border: none;
  color: #c4cdd5;
}

.page-link-dots {
  color: #718096;
  padding: 0 5px;
}

.page-link-num:hover:not(.active) {
  background-color: #f7f9fc;
}

.disabled-link {
  opacity: 0.1;
  pointer-events: none;
  cursor: default;
}

/* Ensure pagination links don't have default underline */
.pagination-controls a {
  text-decoration: none;
}

.page-link-num {
  cursor: pointer;
}

a:hover {
  color: var(--primary-green);
}

.opp-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.opp-info-row {
  margin-top: auto; /* هذا بخلي الزر آخر عنصر */
}

.status-wrapper {
  margin-bottom: 15px;
}
