:root {
  --primary: #1a3a5c;
  --primary-light: #2563a8;
  --accent: #f0a500;
  --accent-soft: #fff3cd;
  --bg: #f4f6fa;
  --card: #ffffff;
  --border: #dde3ee;
  --text: #1e2a3a;
  --secondary: #4a5568;
  --muted: #6b7a92;
  --success: #0d7a55;
  --radius: 4px;
  --shadow: 0 4px 24px rgba(26, 58, 92, 0.1);
  --shadow-hover: 0 8px 32px rgba(26, 58, 92, 0.18);
}

@font-face {
  font-family: iransansxf;
  src: url(../fonts/IRANSansXFaNum-Thin.ttf);
  font-weight: 100;
}

@font-face {
  font-family: iransansxf;
  src: url(../fonts/IRANSansXFaNum-UltraLight.ttf);
  font-weight: 200;
}

@font-face {
  font-family: iransansxf;
  src: url(../fonts/IRANSansXFaNum-Light.ttf);
  font-weight: 300;
}

@font-face {
  font-family: iransansxf;
  src: url(../fonts/IRANSansXFaNum-Regular.ttf);
  font-weight: 400;
}

@font-face {
  font-family: iransansxf;
  src: url(../fonts/IRANSansXFaNum-Medium.ttf);
  font-weight: 500;
}

@font-face {
  font-family: iransansxf;
  src: url(../fonts/IRANSansXFaNum-DemiBold.ttf);
  font-weight: 600;
}

@font-face {
  font-family: iransansxf;
  src: url(../fonts/IRANSansXFaNum-Bold.ttf);
  font-weight: 700;
}

@font-face {
  font-family: iransansxf;
  src: url(../fonts/IRANSansXFaNum-ExtraBold.ttf);
  font-weight: 800;
}

@font-face {
  font-family: iransansxf;
  src: url(../fonts/IRANSansXFaNum-Black.ttf);
  font-weight: 900;
}

* {
  box-sizing: border-box;
}

button,
input,
select,
option {
  font-family: iransansxf;
}

body {
  margin: 0;
  font-family: iransansxf;
  background: #fbfbfb66;
  color: #222;
  direction: rtl;
}

.pageWrapper {
  width: 100%;
  min-height: 100vh;
}

.topHeader {
  border-top: 6px solid #0a5ecf;
  background: #fff;
  box-shadow: 0 1px 0 #e9eef6;
}

.headerInner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rightHeaderGroup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brandBox {
  text-decoration: none;
  color: #0c2d5b;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 110px;
}

.brandGlobe {
  width: 31px;
  height: 31px;
  display: inline-flex;
  background-color: #0a5ecf;
  border-radius: 19px;
  color: white;
  padding: 5px;
}

.brandGlobe svg {
  width: 100%;
  height: 100%;
}

.brandText {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.mainNav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.navItem {
  text-decoration: none;
  color: #1f3b63;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 14px;
}

.navItem:hover {
  background: #f2f7ff;
}

.leftHeaderGroup {
  display: flex;
  align-items: center;
  gap: 8px;
}

.iconBtn {
  width: 30px;
  height: 30px;
  border: 1px solid #e0e8f4;
  background: #fff;
  border-radius: 50%;
  color: #2d4d7a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.iconBtn svg {
  width: 16px;
  height: 16px;
}

.loginBtn {
  border: 1px solid #d8dfec;
  background: #f5f8fd;
  border-radius: 4px;
  padding: 7px 12px;
  cursor: pointer;
}

.searchBarSection {
  background: #fff;
  border-bottom: 1px solid #e5edf8;
}

.searchBarInner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.searchControl {
  flex: 1;
  border: 1px solid #cfdcf0;
  border-radius: 2px;
  display: flex;
  align-items: center;
  min-height: 44px;
}

.subjectSelect {
  border: 0;
  background: #fff;
  min-width: 105px;
  border-left: 1px solid #e7eef8 !important;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #4a6284;
  cursor: pointer;
  padding-right: 7px;
}

.subjectSelect svg {
  width: 14px;
  height: 14px;
}

.searchInput {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 0 12px;
  color: #2a3f5c;
}

.smallIconBtn {
  width: 40px;
  height: 42px;
  border: 0;
  border-right: 1px solid #eef3fa;
  background: #fff;
  cursor: pointer;
  color: #0a5ecf;
  display: flex;
  align-items: center;
  justify-content: center;
}

.smallIconBtn svg {
  width: 18px;
  height: 18px;
}

.aiBtn {
  border: 0;
  background: #fff;
  border-right: 1px solid #eef3fa;
  height: 42px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7d4dff;
  font-weight: 700;
  cursor: pointer;
}

.aiBtn svg {
  width: 20px;
  height: 20px;
}

.ghostActionBtn {
  border: 1px solid #d5e1f4;
  background: #f9fbff;
  color: #35557f;
  border-radius: 2px;
  padding: 11px 12px;
  white-space: nowrap;
  cursor: pointer;
}

.categoryBlueBar {
  background: #0868d8;

  /* height: 75px; */
  padding: 10px 0;
  clear: both;
  background: url(/img/banner.jpg) top center #0f5de5;
}

.categoryInner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  min-height: 88px;
}

.languageSummaryCard {
  min-width: 230px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
}

.allCount {
  width: 92px;
  color: #fff;
  padding: 14px 10px;
  font-size: 14px;
  line-height: 1.4;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
}

.allCount strong {
  font-size: 18px;
}

.langTabs {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
}

.langTab {
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  background: transparent;
  border-radius: 2px;
  cursor: pointer;
}

.langTab.active {
  background: #fff;
  color: #0b5fcc;
}

.dbTabs {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(9, minmax(100px, 1fr));
}

.dbTab {
  text-decoration: none;
  color: #fff;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  text-align: center;
  font-size: 13px;
}

.dbTab strong {
  font-size: 16px;
  font-weight: 600;
}

.contentLayout {
  max-width: 1280px;
  margin: 8px auto;
  padding: 0 14px 16px;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 14px;
}

.leftFilters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filterPanel {
  border: 1px solid #d9e4f4;
  border-radius: 3px;
  overflow: hidden;
  background: #fff;
}

.panelHeader {
  background: #edf4ff;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-bottom: 1px solid #dbe7f6;
}

.panelHeader h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #364f75;
}

.iconTinyBtn {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #6b83a7;
}

.iconTinyBtn svg {
  width: 18px;
  height: 18px;
}

.filterList {
  list-style: none;
  margin: 0;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  color: #2d486f;
}

.filterList label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.6;
}

.filterList input[type="checkbox"] {
  margin-top: 4px;
}

.scrollable {
  max-height: 380px;
  overflow: auto;
}

.filterInputHolder .d-flex {
  display: flex;
  align-items: center;
  align-content: center;
  gap: 10px;
  padding: 15px;
  justify-content: center;
}

.filterInputHolder input {
  width: 85px;
  height: 30px;
  border-radius: 3px;
  border: 1px solid #0003;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  list-style: none;
  margin: 0;
  padding: 10px 10px;
  gap: 4px;
  font-size: 15px;
  color: #2d486f;
  max-height: 350px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 5px;

  scrollbar-width: thin;
  scrollbar-color: #b0c4de transparent;
}

.filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  border-radius: 4px;
}

.filter-item label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--secondary);
  user-select: none;
  width: 100%;
  padding: 4px 0;
  padding-right: 7px;
}

.filter-item:hover {
  background-color: var(--bg);
}

.filter-badge {
  font-size: 0.72rem;
  background: var(--bg);
  color: var(--muted);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

.filter-group::-webkit-scrollbar {
  width: 4px;
}

.filter-group::-webkit-scrollbar-track {
  background: transparent;
}

.filter-group::-webkit-scrollbar-thumb {
  background-color: #b0c4de9d;
  border-radius: 10px;
}

.filter-group::-webkit-scrollbar-thumb:hover {
  background-color: #7a9fc0;
}

.resultArea {
  border: 1px solid #dde7f5;
  background: #fff;
}

.resultTopLine {
  min-height: 48px;
  border-bottom: 1px solid #e8f0fa;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quickFilters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #5a7092;
  font-size: 14px;
}

.tinyAction {
  border: 1px solid #d4e1f3;
  background: #f2f7ff;
  color: #3f5f87;
  padding: 4px 8px;
  border-radius: 2px;
  cursor: pointer;
}

.totalInfo {
  color: #5b7193;
  font-size: 14px;
}

.resultToolbar {
  min-height: 48px;
  border-bottom: 1px solid #edf2f9;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolBtn {
  border: 1px solid #d2deef;
  background: #fff;
  color: #3d5d84;
  padding: 7px 10px;
  border-radius: 2px;
  cursor: pointer;
}

.sortGroup {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #607797;
}

.sortItem {
  border: 0;
  background: transparent;
  color: #4d688d;
  cursor: pointer;
}

.sortItem.active {
  color: #0b62cd;
  font-weight: 700;
}

.tableHeader {
  min-height: 42px;
  display: grid;
  grid-template-columns: 2fr 1.1fr 1fr 1fr 0.8fr 0.7fr 0.7fr 0.9fr;
  align-items: center;
  color: #8aa0be;
  font-size: 14px;
  border-bottom: 1px solid #edf2f9;
  padding: 0 10px;
}

.emptyState {
  height: 420px;
  background: #fff;
}

@media (max-width: 1100px) {
  .dbTabs {
    grid-template-columns: repeat(5, minmax(90px, 1fr));
  }

  .contentLayout {
    grid-template-columns: 250px 1fr;
  }

  .panelHeader h3 {
    font-size: 18px;
  }
}

@media (max-width: 860px) {
  .headerInner,
  .searchBarInner,
  .categoryInner,
  .contentLayout {
    padding-left: 10px;
    padding-right: 10px;
  }

  .mainNav {
    display: none;
  }

  .searchBarInner {
    flex-wrap: wrap;
  }

  .searchControl {
    width: 100%;
  }

  .ghostActionBtn {
    flex: 1;
  }

  .categoryInner {
    flex-direction: column;
  }

  .languageSummaryCard {
    width: 100%;
    border-left: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .dbTabs {
    grid-template-columns: repeat(3, minmax(90px, 1fr));
  }

  .contentLayout {
    grid-template-columns: 1fr;
  }

  .leftFilters {
    order: 2;
  }

  .resultArea {
    order: 1;
  }

  .tableHeader {
    display: none;
  }

  .emptyState {
    height: 300px;
  }
}

@media (max-width: 480px) {
  .dbTabs {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }

  .subjectSelect {
    min-width: 82px;
    font-size: 13px;
  }

  .searchInput {
    font-size: 14px;
  }

  .panelHeader h3 {
    font-size: 16px;
  }

  .filterList {
    font-size: 14px;
  }
}

.results {
  padding: 15px;
}

.result-card {
  background: var(--card);
  border-radius: 0px;
  padding: 1rem 0.9rem;
  /* margin-bottom: 1rem; */
  /* box-shadow: var(--shadow); */
  border-bottom: 1px solid #dde3ee94;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
}

.results-column table tbody tr:nth-child(1) .result-card {
  border-top: 1px solid #e5e7eb;
}

/* .result-card::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0 var(--radius) var(--radius) 0;
  } */

.result-card.ganj::before {
  background: #2da82d;
}

.result-card.civilica::before {
  background: #2563a8;
}

.result-card.scholar::before {
  background: #c53030;
}

.result-card.magiran::before {
  background: #d97706;
}

.result-card.sid::before {
  background: #5b21b6;
}

.result-card:hover {
  /* box-shadow: var(--shadow-hover); */
  border-color: #0002;
  /* transform: translateY(-2px); */
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3rem;
}

.card-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 6px;
  flex-shrink: 0;
}

.badge-ganj {
  background: #e8f4e8;
  color: #1a7a1a;
}

.badge-civilica {
  background: #e8eef8;
  color: #1a3a8a;
}

.badge-scholar {
  background: #fce8e8;
  color: #8a1a1a;
}

.badge-magiran {
  background: #fff0e0;
  color: #8a4a00;
}

.badge-sid {
  background: #e8e8f8;
  color: #3a1a8a;
}

.card-actions {
  display: flex;
  gap: 0.4rem;
}
.badge-sad {
  background: #e8e8f8;
  color: #6c5dd4;
}
.badge-doaji {
  background-color: #e8e8f8;
  color: #6980cb;
}
.icon-btn {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--border);
  background: transparent;
  border-radius: 5px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  transition: all 0.2s;
  color: var(--muted);
}

.icon-btn:hover {
  background: var(--bg);
  color: var(--primary);
  border-color: var(--primary-light);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  line-height: 1.5;
  cursor: pointer;
  display: inline-block;
}

.card-title:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

.card-authors {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.card-abstract {
  font-size: 0.84rem;
  color: #4a5568;
  line-height: 1.75;
  margin-bottom: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.7rem;
  border-top: 1px solid #dde3ee82;
  justify-content: space-between;
}

.metas {
  display: flex;
  gap: 14px;
  align-items: center;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.78rem;
  color: var(--muted);
}

.meta-item.highlight {
  color: var(--success);
  font-weight: 600;
}

.meta-item svg {
  width: 15px;
  height: 15px;
}

.keyword-chip {
  background: rgba(37, 99, 168, 0.08);
  color: var(--primary-light);
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.73rem;
  font-weight: 500;
  cursor: pointer;
  margin-right: 5px;
  display: inline-block;
}

.keyword-chip:hover {
  background: rgba(37, 99, 168, 0.16);
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-info strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-info span {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
  display: block;
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 36px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

.stat-num {
  font-size: 22px;
  font-weight: 800;
  color: #ffffffd1;
  display: block;
}

.stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2rem;
}

.page-btn {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--border);
  background: var(--card);
  border-radius: 9px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.2s;
}

.page-btn:hover {
  background: var(--bg);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}

.searchSource {
  height: 42px;
  border: 0;
  border-left: 1px solid #0002;
  cursor: pointer;
}

.searchSource:focus {
  outline: none;
  box-shadow: none;
}

.searchSource:hover {
  outline: none;
  box-shadow: none;
}

.filter-card-footer {
  display: flex;
  gap: 10px;
  margin-top: 0px;
  border-top: 1px solid #dde3eea1;
  padding-top: 10px;
  display: flex;
  gap: 10px;
  padding: 10px;
  background-color: #edf4ff;
}

.applyFilter,
.resetFilter {
  width: 100%;
  background-color: #0a5ecfc9;
  border-radius: 3px;
  border: 1px solid #3271c7;
  color: white;
  padding: 5px;
  cursor: pointer;
  transition: 0.1s;
}

.applyFilter:hover,
.resetFilter:hover {
  background-color: #0a5fcfe1;
}

.searchHolder {
  padding: 10px;
}
.filter-search-input {
  transition: 0.1s;
  border: 1px solid rgb(229 231 235);
}
.filter-search-input:focus {
  border-color: var(--primary-light);
  outline: none;
  box-shadow: none;
}
.searchHolder .clearBtn {
  position: absolute;
  left: 16px;
  top: 53%;
  transform: translateY(-50%);
  background: none;
  border-width: medium;
  border-style: none;
  border-color: currentcolor;
  border-image: initial;
  cursor: pointer;
  font-size: 16px;
  color: rgb(50 95 92);
  padding: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f4f6fa;
  /* padding: 5px; */
  display: flex;
  height: 24px;
  width: 24px;
  border-radius: 20px;
}
