.tender-container {
  padding: 30px 5.56%;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.page-header {
  margin-top: 100px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.page-title {
  font-size: 48px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 18px;
  color: #666;
}

.search-bar {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-on-surface-08);
  border-radius: 100px;
  /* background: #fff; */
  /* width: 700px; */
  padding: 20px 32px 20px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  /* margin-bottom: 2rem; */
}

.search-bar input {
  border: none;
  outline: none;
  flex: 1;
  /* font-size: 16px; */
  background: transparent;
  color: var(--color-on-surface-variant);
}

.search-bar .icon {
  font-size: 18px;
  color: #888;
}

.ltr .search-bar .icon {
  margin-left: 0px;
  margin-right: 10px;
}
.rtl .search-bar .icon {
  margin-left: 10px;
  margin-right: 0px;
}

.search-bar .filters {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--color-on-surface);
  cursor: pointer;
  font-weight: bold;
  transition: color 0.3s ease;
}
.search-bar .filters:hover {
  color: var(--color-accent);
}

.ltr .filters i {
  margin-left: 0px;
  margin-right: 5px;
}

.rtl .filters i {
  margin-left: 5px;
  margin-right: 0px;
}

.filter-options {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  margin-bottom: 50px;
}

.filter-btn {
  border: 1px solid var(--color-outline);
  border-radius: 20px;
  padding: 4px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-btn:hover {
  background-color: var(--color-on-surface-08);
}

.filter-btn.active {
  background-color: var(--color-on-surface-16);
}

.filter-btn.active .body-lg-regular {
  font-weight: 700 !important;
}

/* Tender Grid */
.tender-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 32px;
  /* margin-bottom: 48px; */
}

/* Load More Section */
.load-more-section {
  display: flex;
  justify-content: center;
}

.load-more-btn {
  padding: 12px 24px;
}

/* Card Styles Start*/
.tender-card {
  display: flex;
  flex-direction: column;

  background: var(--color-surface);
  border-radius: 16px;
  /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); */
  /* overflow: hidden; */
  width: 100%;
  /* max-width: 400px; */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tender-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

.card-header {
  padding: 20px 20px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* .badge-success {
  background-color: #d1f2eb;
  color: #00875a;
}

.badge-secondary {
  background-color: #e9ecef;
  color: #6c757d;
}

.badge-info {
  background-color: #cce7ff;
  color: #0066cc;
} */

.action-btn {
  width: 40px;
  height: 40px;
  border-radius: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  right: -10px;
  background-color: none;
  color: var(--color-on-surface);
  transition: background-color 0.3s ease, color 0.3s ease;
}
.action-btn:hover {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}
.action-btn:hover .more-icon {
  color: var(--color-on-primary);
}

.menu-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.menu-button:hover {
  background-color: #f8f9fa;
}

.menu-dots {
  width: 4px;
  height: 4px;
  background-color: #6c757d;
  border-radius: 50%;
  position: relative;
}

.menu-dots::before,
.menu-dots::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  background-color: #6c757d;
  border-radius: 50%;
  top: 0;
}

.menu-dots::before {
  left: -8px;
}

.menu-dots::after {
  left: 8px;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* flex-grow: 1; */
  padding: 0 20px 20px 20px;
  margin-top: 8px;
  border-bottom: 1px solid var(--color-outline-16);
}

.tender-title {
  color: var(--color-on-surface);
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 68px;
  /* margin-bottom: 12px; */
}

.tender-entity {
  /* color: #6c757d; */
  /* font-size: 14px; */
  /* margin-bottom: 20px; */
  color: var(--color-on-surface-variant);
}

.tender-description {
  color: var(--color-on-surface);
  padding: 20px;
  height: 100%;
}

.card-footer {
  background-color: #e8e5f3;
  padding: 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  border-radius: 0 0 16px 16px;
}

.view-details-btn {
  background: none;
  border: none;
  color: #0066cc;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.view-details-btn:hover {
  background-color: #e7f3ff;
}

.participate-btn {
  background-color: #1a5490;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s ease;
}

.participate-btn:hover {
  background-color: #144066;
}

.participate-btn::after {
  content: "✋";
  font-size: 16px;
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .tender-card {
    max-width: 100%;
  }

  .card-header {
    /* padding: 16px 16px 0 16px; */
  }

  .card-body {
    padding: 0 16px 16px 16px;
  }

  .card-footer {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
  }

  .participate-btn {
    justify-content: center;
  }
}

/* Card Style End*/

/* ------------Filter Window Start------------ */
:root {
  --primary: #0d6efd;
  --primary-hover: #0b5ed7;
  --secondary: #6c757d;
  --secondary-25: rgba(108, 117, 125, 0.25);
  --border: #dee2e6;
  --bg: #fff;
  --text: #212529;
  --muted: #6c757d;
  --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --radius: 14px;
  --pill: 50rem;
}

/* ---------- Backdrop ---------- */
.offcanvas-backdrop {
  position: fixed;
  inset: 0;
  background-color: var(--color-background);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.offcanvas-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Offcanvas Panel ---------- */
.offcanvas {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(550px, 92vw);
  background: var(--color-background);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  /* border-radius: var(--radius) 0 0 var(--radius); */
  z-index: 1045;
}

.offcanvas.show {
  transform: translateX(0);
}

.offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  /* height: 1rem; */
}
.offcanvas-header button {
  color: var(--color-on-surface);
  display: flex;
  align-items: center;
  padding: 0;
}

.offcanvas-title {
  /* font-size: 1.125rem;
  font-weight: 600; */
  color: var(--color-on-surface);
}

.btn-close {
  width: 1em;
  height: 1em;
  border: 0;
  background: transparent;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="black" viewBox="0 0 16 16"><path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"/></svg>')
    center/contain no-repeat;
  background: #000;
  margin-left: 0.3rem;
  opacity: 0.5;
}

.btn-close:hover {
  opacity: 0.75;
}

.offcanvas-body {
  /* padding: 1rem; */
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  overflow: auto;
}

.offcanvas-footer {
  display: flex;
  justify-content: flex-end; /* Aligns content to the right, suitable for buttons */
  align-items: center;
  padding: 1rem;
  border-top: 1px solid var(--border); /* Creates a separator line */
  margin-top: auto; /* Pushes the footer to the bottom */
  gap: 0.5rem; /* Adds spacing between footer items like buttons */
}

.flex-grow-1 {
  flex: 1;
}

.accordion-body input[type="radio" i] {
  margin: 0;
}

/* ---------- Section / Collapse ---------- */

/* ---------- Section / Collapse ---------- */
.filter-section {
  height: 40px; /* smaller minimum height */
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  background: #fff;
}

.filter-section .mb-2 {
  margin-bottom: 0.25rem; /* smaller gap */
}

.rotate-icon {
  display: inline-block;
  transition: transform 0.3s ease; /* smooth rotation */
  font-size: 0.8rem; /* slightly smaller arrow */
}

.justify-content-between {
  justify-content: space-between;
}

.align-items-center {
  align-items: center;
}

.collapse {
  display: none;
}

.collapse.show {
  display: block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
}

.btn:focus-visible {
  outline: 2px solid var(--primary-hover);
  outline-offset: 2px;
}

.btn-link {
  border: 0;
  padding: 0 0.25rem;
  text-decoration: none;
  color: inherit;
}

.text-dark {
  color: var(--text);
}

.btn-outline-secondary {
  border-color: var(--secondary);
  color: var(--secondary);
  background: #fff;
}

.btn-outline-secondary:hover {
  background: var(--secondary);
  color: #fff;
}

.btn-outline-secondary.active {
  background: var(--secondary);
  color: #fff;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* ---------- Layout helpers ---------- */
.d-flex.flex-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.p-3 {
  padding: 1rem;
}

.border-top {
  border-top: 1px solid var(--border);
}

.me-2 {
  margin-right: 0.5rem;
}

/* ---------- Form / Inputs ---------- */
.input-group {
  display: flex;
  width: 100%;
}

.input-group-text {
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 0.5rem 0 0 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.6rem;
  /* background: #f8f9fa */
}

.form-control {
  flex: 1;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 0.5rem 0.75rem;
  font: inherit;
  width: inherit;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.form-check-input {
  width: 1rem;
  height: 1rem;
}

.form-check-label {
  cursor: pointer;
}

/* ---------- Badge Pill ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--pill);
  background: #f8f9fa;
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.875rem;
}

/* ---------- Footer ---------- */
.drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* ---------- Demo open button (optional) ---------- */
.demo-open {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.6rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid var(--secondary);
  background: #fff;
  color: var(--secondary);
  box-shadow: var(--shadow);
  z-index: 1;
}

.demo-open:hover {
  background: var(--secondary);
  color: #fff;
}

/* ------------Filter Window End------------ */

/* Dropdown container */

/* This class is crucial for dynamic positioning */
.relative {
  position: relative;
}

/* Use inline-block to contain the dropdown and button */
.inline-block {
  display: inline-block;
}

/* Button styling */
.dropdown-btn {
  /* background-color: #6c757d; */
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Arrow icon */
.arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}

.arrow.rotate {
  transform: rotate(180deg);
}

/* Dropdown menu styling */
.action-menu {
  position: absolute;
  top: 100%; /* Positions the top of the menu at the bottom of the parent */
  left: 0; /* Aligns the left edge of the menu with the left edge of the parent */
  margin-top: 4px;
  min-width: 200px;
  background: var(--color-surface);
  /* border: 1px solid #ddd; */
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  z-index: 1000;
}

/* Items */
.action-item {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  color: var(--color-on-surface);
  text-decoration: none;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  background-color: none;
  transition: background-color 0.3s ease;
}

.action-item:hover {
  background-color: var(--color-accent-08);
}

/* Icon styling */
.action-item i {
  width: 20px; /* Consistent width for all icons */
  text-align: center;
  margin-right: 12px; /* Space between icon and text */
}

.filter-checkbox-btn {
  border: 1px solid var(--color-outline);
  padding: 4px 16px;
  border-radius: 20px;
}
.filter-checkbox-btn.active {
  border: 1px solid red;
}

.filter-btn.active {
  background-color: var(--color-primary-16);
}

.btn-sm {
  height: 32px; /* reduced height */
  font-size: 0.85rem; /* smaller text */
  gap: var(--padding-04); /* smaller gap */
  font-size: var(--font-body-sm-size);
}

.badge-secondary {
  display: flex;
  align-items: center;
  /* background-color: var(--color-outline); */
  padding: 0 var(--padding-10);
  border-radius: var(--border-radius-08);
  width: fit-content;
  height: 24px;
}
.badge-secondary p {
  margin: 0;
  color: var(--color-outline);
  font-size: var(--font-body-sm-size);
}

.mt-sm {
  margin-top: 5px;
}

.category-list {
  overflow-y: scroll;
  height: 300px;
}

.entity-list {
  overflow-y: scroll;
  height: 300px;
}

.offcanvas-footer-action {
  display: flex;
  flex-grow: 1;
  align-items: end;
  align-self: end;
  justify-content: end;
}

/* Dark Mode Start */

body.dark-theme .search-bar {
  background: transparent; /* or remove entirely */
  border-color: #555; /* optional darker border */
  box-shadow: none; /* optional */
}

/* body.dark-theme .search-bar input {
  color:var(--color-on-surface);
} */

body.dark-theme .search-bar input::placeholder {
  color: #aaa; /* lighter placeholder for dark mode */
}

body.dark-theme .search-bar .icon {
  color: var(--color-on-surface);
}

body.dark-theme .search-bar .filters {
  color: var(--color-on-surface);
}

body.dark-theme .filter-btn {
  background: #222;
  /* border-color: #444; */
  color: var(--color-on-surface);
}

body.dark-theme .filter-btn:hover {
  background-color: #333;
}

body.dark-theme .filter-btn.active-filter {
  background-color: #444;
  border-color: #666;
}

body.dark-theme .tender-card {
  /* background: #1e1e1e; */
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

body.dark-theme .tender-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

body.dark-theme .card-header,
body.dark-theme .badges,
body.dark-theme .badge {
  color: var(--color-on-surface);
}

/* Optional: darkened badges for dark theme */
body.dark-theme .badge-success {
  background-color: #004d33; /* dark green */
  color: var(--color-on-surface);
}

body.dark-theme .badge-secondary {
  background-color: #333;
  color: var(--color-on-surface);
}

body.dark-theme .badge-info {
  background-color: #004080; /* dark blue */
  color: var(--color-on-surface);
}

body.dark-theme .menu-button:hover {
  background-color: #333; /* subtle hover for dark mode */
}

body.dark-theme .menu-dots,
body.dark-theme .menu-dots::before,
body.dark-theme .menu-dots::after {
  background-color: #bbb;
}

/* body.dark-theme .card-body {
    color:var(--color-on-surface);
} */

/* body.dark-theme .event-title {
  color:var(--color-on-surface);
} */

/* body.dark-theme .tender-entity {
  color:var(--color-on-surface);
} */

/* body.dark-theme .event-description {
  color:var(--color-on-surface);
} */

body.dark-theme .card-footer {
  background-color: rgba(197, 192, 255, 0.08);
}

body.dark-theme .view-details-btn {
  color: var(--color-on-surface);
}

body.dark-theme .view-details-btn:hover {
  background-color: #1a3b5c;
}

body.dark-theme .participate-btn {
  background-color: #144066;
  color: var(--color-on-surface);
}

body.dark-theme .participate-btn:hover {
  background-color: #0f2a44;
}
/* Dark Mode Ends */

.accordion-body input[type="radio" i] {
  margin: 0;
  appearance: none;
}

@media (width >= 1920px) {
  main .tender-container {
    padding: 30px 11%;
  }
}

@media (max-width: 640px) {
  .ltr .action-menu {
    left: -150px;
  }

  .tender-grid {
    margin: 0 -15px;
  }
}
