
/* SAMA Reach v14.3.1 — Templates Explorer UI Rebuild */

.sama-reach-wrap [class*="template"] input[type="search"],
.sama-reach-wrap [class*="template"] input[type="text"],
.sama-reach-frontend-app [class*="template"] input[type="search"],
.sama-reach-frontend-app [class*="template"] input[type="text"],
.sama-reach-dashboard [class*="template"] input[type="search"],
.sama-reach-dashboard [class*="template"] input[type="text"]{
  min-height:56px!important;
  border-radius:18px!important;
  border:1px solid #dbe3ef!important;
  background:#fff!important;
  box-shadow:0 10px 24px rgba(5,10,36,.04)!important;
  padding:0 18px!important;
  font-size:15px!important;
  color:#050a24!important;
}

.sama-reach-wrap [class*="template"] select,
.sama-reach-frontend-app [class*="template"] select,
.sama-reach-dashboard [class*="template"] select{
  min-height:56px!important;
  border-radius:18px!important;
  border:1px solid #dbe3ef!important;
  background:#fff!important;
  box-shadow:0 10px 24px rgba(5,10,36,.04)!important;
  padding:0 18px!important;
  font-size:15px!important;
  color:#050a24!important;
}

/* Main search/filter container visual cleanup */
.sama-reach-wrap [class*="template"][class*="filter"],
.sama-reach-wrap [class*="template"][class*="search"],
.sama-reach-frontend-app [class*="template"][class*="filter"],
.sama-reach-frontend-app [class*="template"][class*="search"],
.sama-reach-dashboard [class*="template"][class*="filter"],
.sama-reach-dashboard [class*="template"][class*="search"]{
  border-radius:28px!important;
  background:linear-gradient(180deg,#ffffff 0%,#fbfcff 100%)!important;
  border:1px solid #e5e7eb!important;
  box-shadow:0 24px 60px rgba(5,10,36,.08)!important;
  padding:28px!important;
  overflow:hidden!important;
}

/* Common wrapper normalization when exact class names differ */
.sama-reach-wrap .templates-search,
.sama-reach-wrap .templates-filters,
.sama-reach-wrap .templates-explorer,
.sama-reach-wrap .sr-templates-filter,
.sama-reach-wrap .sr-template-filters,
.sama-reach-frontend-app .templates-search,
.sama-reach-frontend-app .templates-filters,
.sama-reach-frontend-app .templates-explorer,
.sama-reach-frontend-app .sr-templates-filter,
.sama-reach-frontend-app .sr-template-filters{
  display:grid!important;
  gap:18px!important;
  border-radius:28px!important;
  background:linear-gradient(180deg,#ffffff 0%,#fbfcff 100%)!important;
  border:1px solid #e5e7eb!important;
  box-shadow:0 24px 60px rgba(5,10,36,.08)!important;
  padding:28px!important;
  max-width:100%!important;
  overflow:hidden!important;
}

/* Make first row more structured */
.sama-reach-wrap .templates-search > *,
.sama-reach-wrap .templates-filters > *,
.sama-reach-wrap .templates-explorer > *,
.sama-reach-frontend-app .templates-search > *,
.sama-reach-frontend-app .templates-filters > *,
.sama-reach-frontend-app .templates-explorer > *{
  max-width:100%!important;
}

/* Header typography */
.sama-reach-wrap [class*="template"] h2,
.sama-reach-wrap [class*="template"] h3,
.sama-reach-frontend-app [class*="template"] h2,
.sama-reach-frontend-app [class*="template"] h3,
.sama-reach-dashboard [class*="template"] h2,
.sama-reach-dashboard [class*="template"] h3{
  color:#050a24!important;
  font-weight:900!important;
  line-height:1.25!important;
  margin-top:0!important;
}

/* Statistic badge like "13 قالب ظاهر" */
.sama-reach-wrap [class*="template"] .count,
.sama-reach-wrap [class*="template"] .badge,
.sama-reach-wrap [class*="template"] [class*="count"],
.sama-reach-frontend-app [class*="template"] .count,
.sama-reach-frontend-app [class*="template"] .badge,
.sama-reach-frontend-app [class*="template"] [class*="count"]{
  border-radius:20px!important;
  background:#f3edff!important;
  border:1px solid #ddd6fe!important;
  color:#5e17eb!important;
  font-weight:900!important;
  box-shadow:none!important;
}

/* Category chips/buttons */
.sama-reach-wrap [class*="template"] button,
.sama-reach-wrap [class*="template"] .chip,
.sama-reach-wrap [class*="template"] [class*="chip"],
.sama-reach-wrap [class*="template"] [class*="category"],
.sama-reach-frontend-app [class*="template"] button,
.sama-reach-frontend-app [class*="template"] .chip,
.sama-reach-frontend-app [class*="template"] [class*="chip"],
.sama-reach-frontend-app [class*="template"] [class*="category"]{
  min-height:48px!important;
  border-radius:16px!important;
  padding:10px 18px!important;
  background:#5e17eb!important;
  color:#fff!important;
  border:1px solid #5e17eb!important;
  font-weight:800!important;
  box-shadow:0 12px 24px rgba(94,23,235,.16)!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
}

/* Filter row and chips row if flex exists */
.sama-reach-wrap [class*="filter"],
.sama-reach-wrap [class*="chips"],
.sama-reach-wrap [class*="categories"],
.sama-reach-frontend-app [class*="filter"],
.sama-reach-frontend-app [class*="chips"],
.sama-reach-frontend-app [class*="categories"]{
  gap:14px!important;
}

/* Better visual grouping for selects/search inputs */
.sama-reach-wrap [class*="template"] form,
.sama-reach-frontend-app [class*="template"] form{
  display:grid!important;
  grid-template-columns:1.4fr repeat(3,minmax(160px,.6fr))!important;
  gap:14px!important;
  align-items:center!important;
  width:100%!important;
}

/* Prevent overflow in any template filter row */
.sama-reach-wrap [class*="template"] *,
.sama-reach-frontend-app [class*="template"] *,
.sama-reach-dashboard [class*="template"] *{
  max-width:100%!important;
}

/* Mobile */
@media(max-width:980px){
  .sama-reach-wrap [class*="template"] form,
  .sama-reach-frontend-app [class*="template"] form{
    grid-template-columns:1fr 1fr!important;
  }
}

@media(max-width:680px){
  .sama-reach-wrap .templates-search,
  .sama-reach-wrap .templates-filters,
  .sama-reach-wrap .templates-explorer,
  .sama-reach-wrap .sr-templates-filter,
  .sama-reach-wrap .sr-template-filters,
  .sama-reach-frontend-app .templates-search,
  .sama-reach-frontend-app .templates-filters,
  .sama-reach-frontend-app .templates-explorer,
  .sama-reach-frontend-app .sr-templates-filter,
  .sama-reach-frontend-app .sr-template-filters{
    padding:18px!important;
    border-radius:22px!important;
  }

  .sama-reach-wrap [class*="template"] form,
  .sama-reach-frontend-app [class*="template"] form{
    grid-template-columns:1fr!important;
  }

  .sama-reach-wrap [class*="template"] button,
  .sama-reach-frontend-app [class*="template"] button{
    width:100%!important;
  }
}
