:root {
  --zaher-teal: #149db3;
  --zaher-teal-light: #35b8c9;
  --zaher-orange: #f47721;
  --zaher-slate: #243447;
  --zaher-mist: #f7fafc;
}

body.content-library-page {
  background:
    radial-gradient(circle at 92% 12%, rgba(20, 157, 179, 0.09), transparent 28rem),
    radial-gradient(circle at 8% 88%, rgba(53, 184, 201, 0.06), transparent 25rem),
    var(--zaher-mist);
  color: var(--zaher-slate);
}

body.content-library-page .inner-page {
  min-height: calc(100vh - 180px);
  padding: 116px 0 64px;
}

body.content-library-page .bg-counter,
body.content-library-page #container_view {
  display: none !important;
}

.content-library {
  padding: 0;
  direction: rtl;
}

.content-library > .container {
  width: min(1440px, calc(100% - 40px));
  max-width: none;
  padding: 32px;
  border: 1px solid rgba(36, 52, 71, 0.09);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 70px rgba(36, 52, 71, 0.1);
  backdrop-filter: blur(18px);
}

.content-library__header {
  margin: 0 0 28px;
  padding-inline: 8px;
  text-align: right;
}

.content-library__eyebrow {
  display: block;
  width: 46px;
  height: 4px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--zaher-orange);
}

.content-library__header h1 {
  margin: 0;
  color: var(--zaher-slate);
  font-size: clamp(34px, 4.6vw, 62px);
  font-weight: 900;
  letter-spacing: -0.035em;
}

.content-library__header p {
  margin: 10px 0 0;
  color: #65758a;
  font-size: clamp(16px, 1.5vw, 21px);
  font-weight: 500;
}

.content-library__layout {
  display: grid;
  direction: ltr;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas: "content sidebar";
  gap: 34px;
  align-items: start;
}

.content-library__sidebar {
  grid-area: sidebar;
  position: sticky;
  top: 106px;
  direction: rtl;
}

.content-library #tabs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.content-library #tabs .nav-item {
  width: 100%;
  list-style: none;
}

.content-library #tabs .nav-link {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 58px;
  padding: 10px 30px;
  overflow: hidden;
  border: 1px solid rgba(36, 52, 71, 0.08);
  border-radius: 0;
  clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(36, 52, 71, 0.07);
  color: var(--zaher-slate);
  transition: transform 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.content-library #tabs .nav-link::before,
.content-library #tabs .nav-link::after {
  position: absolute;
  z-index: 2;
  top: -8%;
  width: 3px;
  height: 116%;
  border-radius: 999px;
  background: var(--zaher-orange);
  content: "";
  transform: skewX(-14deg);
}

.content-library #tabs .nav-link::before {
  right: 14px;
  box-shadow: 5px 0 0 var(--zaher-orange);
}

.content-library #tabs .nav-link::after {
  left: 14px;
  box-shadow: -5px 0 0 var(--zaher-orange);
}

.content-library #tabs .nav-link h4 {
  position: relative;
  z-index: 3;
  margin: 0;
  color: inherit;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.35;
}

.content-library #tabs .nav-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(36, 52, 71, 0.11);
}

.content-library #tabs .nav-link.active {
  border-color: rgba(20, 157, 179, 0.2);
  background: linear-gradient(145deg, var(--zaher-teal-light), #058ba4);
  box-shadow:
    0 12px 28px rgba(20, 157, 179, 0.22),
    0 0 24px rgba(244, 119, 33, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #fff;
}

.content-library #tab_content {
  grid-area: content;
  min-width: 0;
  margin: 0;
  direction: rtl;
}

.content-library .tab-pane {
  margin: 0;
}

.content-library .tab-pane.active {
  animation: libraryFadeIn 260ms ease-out;
}

.content-library__category-title {
  margin: 0 0 18px;
  color: var(--zaher-slate);
  font-size: 20px;
  font-weight: 850;
}

.content-library__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.library-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(36, 52, 71, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(36, 52, 71, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.library-card:hover {
  transform: translateY(-4px);
  border-color: rgba(20, 157, 179, 0.24);
  box-shadow: 0 22px 48px rgba(20, 157, 179, 0.14);
}

.library-card__body {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 18px;
}

.library-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.library-card__icon {
  display: inline-grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(20, 157, 179, 0.16);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(53, 184, 201, 0.12), rgba(20, 157, 179, 0.05));
  color: var(--zaher-teal);
  font-size: 24px;
}

.library-card__format {
  border-radius: 999px;
  background: rgba(244, 119, 33, 0.1);
  color: #c9580b;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.library-card h3 {
  margin: 0;
  color: var(--zaher-slate);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.35;
}

.library-card__description {
  min-height: 44px;
  margin: 9px 0 0;
  color: #6a788b;
  font-size: 14px;
  line-height: 1.6;
}

.library-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 14px 0 0;
  padding-top: 13px;
  border-top: 1px solid rgba(36, 52, 71, 0.08);
  color: #718096;
  font-size: 12px;
  font-weight: 700;
}

.library-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.library-card__action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--zaher-teal-light), #058ba4);
  box-shadow: 0 9px 20px rgba(20, 157, 179, 0.2);
  color: #fff;
  padding: 9px 17px;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.library-card__action:hover {
  color: #fff;
  box-shadow: 0 13px 26px rgba(20, 157, 179, 0.28);
}

.library-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.library-card__actions .library-card__action {
  flex: 1 1 118px;
  align-self: stretch;
  margin-top: 0;
}

.library-card__action--secondary {
  border: 1px solid rgba(20, 157, 179, 0.3);
  background: #fff;
  box-shadow: none;
  color: var(--zaher-teal);
}

.library-card__action--secondary:hover {
  border-color: var(--zaher-orange);
  background: rgba(244, 119, 33, 0.08);
  box-shadow: none;
  color: #d95d0d;
}

.code-card__preview {
  min-height: 116px;
  margin: 16px 0 0;
  overflow: hidden;
  border: 1px solid rgba(36, 52, 71, 0.08);
  border-radius: 12px;
  background: #f7f9fb;
  direction: ltr;
}

.code-card__preview pre {
  min-height: 116px;
  max-height: 116px;
  margin: 0;
  overflow: hidden;
  padding: 14px;
  background: transparent;
  color: #334155;
  font-size: 12px;
  line-height: 1.55;
  text-align: left;
  white-space: pre-wrap;
  direction: ltr !important;
  unicode-bidi: isolate;
}

.code-card__preview code,
#ModalBody pre,
#ModalBody code {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate;
}

#ModalBody pre,
#ModalBody code {
  display: block;
  width: 100%;
}

.file-card__preview {
  position: relative;
  height: 156px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid rgba(36, 52, 71, 0.08);
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(53, 184, 201, 0.08), rgba(255, 255, 255, 0.98)),
    #fff;
}

.file-card__preview iframe {
  width: 100%;
  height: 235px;
  border: 0;
  pointer-events: none;
  transform-origin: top center;
}

.file-card__placeholder {
  display: grid;
  height: 100%;
  place-items: center;
  color: #ef5a3c;
  font-size: 58px;
}

.content-library__empty {
  grid-column: 1 / -1;
  padding: 52px 24px;
  border: 1px dashed rgba(20, 157, 179, 0.28);
  border-radius: 18px;
  background: rgba(53, 184, 201, 0.05);
  color: #718096;
  text-align: center;
  font-weight: 750;
}

@keyframes libraryFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1199px) {
  .content-library__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .content-library > .container {
    padding: 24px;
  }

  .content-library__layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "sidebar"
      "content";
    gap: 24px;
  }

  .content-library__sidebar {
    position: static;
    min-width: 0;
  }

  .content-library #tabs {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }

  .content-library #tabs .nav-item {
    min-width: 210px;
    scroll-snap-align: start;
  }
}

@media (max-width: 640px) {
  body.content-library-page .inner-page {
    padding-top: 92px;
  }

  .content-library > .container {
    width: min(100% - 20px, 1440px);
    padding: 18px;
    border-radius: 20px;
  }

  .content-library__header {
    margin-bottom: 22px;
  }

  .content-library__grid {
    grid-template-columns: 1fr;
  }

  .library-card__description {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .content-library *,
  .content-library *::before,
  .content-library *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
