/* ====== الصفحة الرئيسية للبحث ====== */
.page-wrapper {
  background-color: #32353a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #fff7e6;
  font-size: 18px;
  margin-bottom: 0;

}

.arabic-text {
  direction: rtl;
  text-align: center;   /* التوسيط */
  unicode-bidi: plaintext;
  width: 100%;
}

.arabic-text a {
  display: block;
  word-break: break-word;
  text-align: center; /* هذا هو اللي يوسّط الرابط */
  color: #fff7e6;
  text-decoration: none;
}

.arabic-text a:hover {
  color: #c18a32;
  text-decoration: underline;
}

.search-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  padding: 30px;
  min-height: calc(100vh - 120px);

  text-align: center;
}

.search-header {
  width: 100%;
  max-width: 900px;

}

.search-title {
   font-size: 28px;
  font-weight: bold;
  color: #c18a32;
  margin-bottom: 30px;
  margin-top: 0;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

/* ====== مدخلات البحث ====== */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.filters select,
.filters input,
.filters button {
  width: 200px;
  min-width: 180px;
  padding: 10px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #000;
  text-align: center;
  background-color: #000;  /* أسود */
  color: #fff;             /* أبيض */
}

.filters button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 8px;
  border: none;
  background-color: #c18a324a;
  color: #fff7e6;
  cursor: pointer;
  transition: background-color 0.2s;
}

.filters button:hover {
  background-color: #c18a32;
}

/* ====== نتائج البحث ====== */
.card-container {
  display: grid;
  grid-template-columns: repeat(3, 350px); /* 3 بطاقات في الصف على الكمبيوتر */
  gap: 20px;
  width: 100%;
  margin-top: 20px;
}

.card {
  background-color: #fff7e6;
  border-radius: 15px;
  padding: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  text-align: left;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.card-header {
  font-weight: bold;
  color: #fff7e6;
  background-color: #c18a32;
  padding: 10px 15px;
  border-radius: 10px 10px 0 0;
  margin-bottom: 10px;
  text-align: center;
  font-size: 16px;
}

.card-content h3 {
  font-weight: bold;
  color: #1a1207;
  margin-bottom: 8px;
}

.card-content p {
  font-size: 14px;
  color: #2f1f00;
  margin: 4px 0;
}

.card-content a {
  text-decoration: none;
}

.icon-link {
  width: 24px;
  height: 24px;
  margin-right: 5px;
  vertical-align: middle;
  cursor: pointer;
}

#resultsInfo {
    text-align: center;
}

.success-msg {
    color: #ffeb3b;
    font-weight: bold;
    font-size: 16px;
    display: block;
    width: 100%;
}

/* ====== تمييز البحث ====== */
.search-highlight {
  background-color: #ffeb3b; /* أصفر مشع */
  color: red;           /* أحمر واضح */
  font-weight: bold;
  padding: 2px 4px;
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(255, 235, 59, 0.8);
}


/* ====== Pagination ====== */
.pagination-simple {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
}

.pagination-simple button {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background-color: #c18a32;
  color: #fff7e6;
  cursor: pointer;
  transition: background-color 0.2s;
}

.pagination-simple button:disabled {
  background-color: #c18a324a;
  cursor: not-allowed;
}

.pagination-simple span {
  font-weight: bold;
  color: #fff7e6;
}

@media (max-width: 768px) {
    
  .card-container {
    grid-template-columns: 1fr;
  }

  .filters {
    flex-direction: column;
    align-items: center;
  }

  .filters select,
  .filters input,
  .filters button {
    width: 90%;
  }

  .search-title {
    font-size: 24px;
  }
  
  .arabic-text {
    direction: rtl;
    text-align: center;
  }
  
    .search-header {
    padding: 0 10px;
  }
  
}

@media (max-width: 768px) {

  .search-main {
    padding: 20px 10px; /* بدل 30px */
  }

  .search-header {
    width: 100%;
    max-width: 100%;
  }

}

.carte-line{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.request-match-btn{
    background: #c18a32;
    color: #fff7e6;

    border: none;
    padding: 8px 14px;

    border-radius: 6px;

    font-weight: bold;
    cursor: pointer;

    transition: 0.3s;
}

.request-match-btn:hover{
    transform: scale(1.05);
}

.carte-left{
    color: #000;
}

.carte-left strong{
    color: #000;
}

.modal{
    display: none;
    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.6);

    justify-content: center;
    align-items: center;

    z-index: 99999;
}

.modal.show{
    display: flex;
}

.modal-content{
    background: #fff;

    width: 360px;
    max-width: 90%;

    padding: 16px 18px;

    border-radius: 16px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.25);

    text-align: right;
    direction: rtl;

    animation: pop 0.25s ease;

    display: flex;
    flex-direction: column;
    gap: 0px;
}

/* form */
.modal-content form{
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* animation */
@keyframes pop{
    from{
        transform: scale(0.9);
        opacity: 0;
    }
    to{
        transform: scale(1);
        opacity: 1;
    }
}

/* title */
.modal-content h3{
    margin: 0;
    padding: 0;
    color: #c18a32;
    font-size: 20px;
    text-align: center;
}

/* inputs + textarea */
.modal-content input,
.modal-content textarea{
    width: 100%;
    padding: 10px 12px;

    border: 1px solid #ddd;
    border-radius: 10px;

    font-size: 14px;
    outline: none;

    line-height: 1.3;

    box-sizing: border-box;

    margin: 0;
}

/* textarea */
.modal-content textarea{
    min-height: 10px;
    padding: 5px 5px;
    resize: none;
}

/* readonly */
.modal-content input[readonly]{
    background: #f7f7f7;
    color: #222;
}

/* buttons */
.modal-content button[type="submit"]{
    width: 100%;
    padding: 10px;

    background: #1f7a3f;
    color: #fff;

    border: none;
    border-radius: 10px;

    font-weight: bold;
    cursor: pointer;

    transition: 0.3s;
}

.modal-content button[type="submit"]:hover{
    transform: translateY(-2px);
}

.modal-content button[type="button"]{
    width: 100%;
    padding: 8px;

    background: #eee;
    color: #333;

    border: none;
    border-radius: 10px;

    cursor: pointer;
}

/* price note */
.form-price-note{
    background: #f7f3e8;
    border: 1px solid #e6d7a6;

    padding: 12px;
    border-radius: 12px;

    font-size: 14px;
    line-height: 1.35;

    color: #333;

    margin-bottom: 10px;

    text-align: center;
}

.form-price-note strong{
    color: #b08d2a;
    font-size: 15px;
}
/* ===== success toast ===== */
.success-toast{
    position: fixed;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%) scale(0.9);

    background: #1f7a3f;
    color: #fff;

    width: 340px;
    max-width: 90%;

    padding: 10px;

    border-radius: 18px;

    text-align: center;

    font-size: 17px;
    font-weight: bold;
    line-height: 1.6;

    box-shadow: 0 20px 45px rgba(0,0,0,0.3);

    z-index: 999999;

    opacity: 0;

    transition: 0.35s ease;
}

.success-toast.show{
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ===== mobile ===== */
@media (max-width: 480px){
    .modal-content{
        width: 95%;
        padding: 16px;
    }
}
