.nv-library,
.nv-library * {
  box-sizing: border-box;
}

.nv-library {
  --nv-navy: #0d2b50;
  --nv-navy-2: #173f70;
  --nv-blue: #1d62d7;
  --nv-yellow: #f5c542;
  --nv-ink: #14243b;
  --nv-muted: #64748b;
  --nv-line: #dfe7f0;
  --nv-bg: #f5f8fc;
  width: 100%;
  margin: 0;
  color: var(--nv-ink);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

.nv-library__container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.nv-library__hero {
  position: relative;
  overflow: hidden;
  padding: 74px 0 68px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 20%, rgba(38, 112, 214, .62), transparent 32%),
    linear-gradient(135deg, #0a2546 0%, #133b69 58%, #0c2c54 100%);
}

.nv-library__hero::before,
.nv-library__hero::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
}

.nv-library__hero::before {
  width: 420px;
  height: 420px;
  right: -120px;
  top: -210px;
}

.nv-library__hero::after {
  width: 260px;
  height: 260px;
  right: 12%;
  bottom: -200px;
}

.nv-library__hero-glow {
  position: absolute;
  width: 9px;
  height: 66px;
  left: max(20px, calc((100% - 1180px) / 2 - 28px));
  top: 78px;
  border-radius: 999px;
  background: var(--nv-yellow);
  box-shadow: 0 0 30px rgba(245, 197, 66, .35);
}

.nv-library__hero .nv-library__container {
  position: relative;
  z-index: 1;
}

.nv-library__eyebrow {
  margin: 0 0 14px;
  color: var(--nv-yellow);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .19em;
}

.nv-library__hero h1 {
  max-width: 780px;
  margin: 0;
  color: #fff;
  font-size: clamp(38px, 5vw, 68px);
  font-weight: 760;
  line-height: 1.03;
  letter-spacing: -.04em;
}

.nv-library__hero h1 em {
  color: var(--nv-yellow);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.nv-library__lead {
  max-width: 700px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, .78);
  font-size: 17px;
  line-height: 1.7;
}

.nv-library__body {
  min-height: 620px;
  padding: 30px 0 76px;
}

.nv-library__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 22px;
  font-size: 13px;
}

.nv-library__crumbs button,
.nv-library__crumbs span {
  appearance: none;
  border: 0;
  padding: 0;
  color: var(--nv-muted);
  background: transparent;
  font: inherit;
}

.nv-library__crumbs button {
  cursor: pointer;
}

.nv-library__crumbs [data-crumb]::before {
  content: "›";
  margin-right: 8px;
  color: #a9b7c8;
}

.nv-library__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--nv-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(24, 51, 83, .07);
}

.nv-library__levels {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border-radius: 13px;
  background: #edf2f8;
}

.nv-library__levels button {
  appearance: none;
  border: 0;
  min-width: 108px;
  padding: 11px 18px;
  border-radius: 10px;
  color: #52647a;
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: .2s ease;
}

.nv-library__levels button.is-active {
  color: #fff;
  background: var(--nv-navy);
  box-shadow: 0 7px 16px rgba(13, 43, 80, .22);
}

.nv-library__search {
  position: relative;
  flex: 0 1 340px;
}

.nv-library__search::before {
  content: "⌕";
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-52%);
  color: #7b8da4;
  font-size: 23px;
}

.nv-library__search input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--nv-line);
  border-radius: 12px;
  padding: 0 15px 0 43px;
  color: var(--nv-ink);
  background: #f9fbfd;
  font-size: 14px;
  outline: none;
}

.nv-library__search input:focus {
  border-color: var(--nv-blue);
  box-shadow: 0 0 0 3px rgba(29, 98, 215, .12);
}

.nv-library__status {
  margin: 32px 0 16px;
  color: var(--nv-muted);
  font-size: 14px;
}

.nv-library__subjects {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.nv-subject {
  position: relative;
  overflow: hidden;
  min-height: 170px;
  border: 1px solid var(--nv-line);
  border-radius: 20px;
  padding: 24px;
  color: var(--nv-ink);
  text-align: left;
  background: #fff;
  box-shadow: 0 12px 28px rgba(30, 55, 88, .06);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.nv-subject::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -34px;
  bottom: -34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--subject-color, var(--nv-blue)) 13%, transparent);
}

.nv-subject:hover,
.nv-subject:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--subject-color, var(--nv-blue)) 45%, #fff);
  box-shadow: 0 18px 38px rgba(25, 55, 91, .13);
}

.nv-subject__icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 14px;
  color: #fff;
  background: var(--subject-color, var(--nv-blue));
  font-size: 18px;
  font-weight: 850;
}

.nv-subject strong {
  display: block;
  margin-bottom: 7px;
  font-size: 19px;
}

.nv-subject small {
  color: var(--nv-muted);
  font-size: 13px;
}

.nv-library__grades {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.nv-grade {
  position: relative;
  overflow: hidden;
  min-height: 160px;
  border: 0;
  border-radius: 20px;
  padding: 26px;
  color: #fff;
  text-align: left;
  background: linear-gradient(135deg, var(--nv-navy), var(--nv-navy-2));
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(13, 43, 80, .18);
  transition: transform .2s ease;
}

.nv-grade:hover,
.nv-grade:focus-visible {
  transform: translateY(-4px);
}

.nv-grade.is-coming {
  cursor: default;
  background: linear-gradient(135deg, #53677f, #7a899b);
  box-shadow: 0 10px 24px rgba(13, 43, 80, .12);
}

.nv-grade.is-coming:hover,
.nv-grade.is-coming:focus-visible {
  transform: none;
}

.nv-grade.is-coming span {
  color: #ffe08a;
}

.nv-grade::after {
  content: attr(data-grade);
  position: absolute;
  right: -4px;
  bottom: -27px;
  color: rgba(255, 255, 255, .09);
  font-size: 122px;
  font-weight: 900;
  line-height: 1;
}

.nv-grade span {
  display: block;
  margin-bottom: 18px;
  color: var(--nv-yellow);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
}

.nv-grade strong {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 25px;
}

.nv-grade small {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, .72);
}

.nv-library__books {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.nv-book {
  overflow: hidden;
  border: 1px solid var(--nv-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(30, 55, 88, .07);
  transition: transform .2s ease, box-shadow .2s ease;
}

.nv-book:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 42px rgba(30, 55, 88, .14);
}

.nv-book__cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  padding: 22px;
  background: linear-gradient(145deg, #edf3fa, #dce8f5);
}

.nv-book__cover::after {
  content: "Z-KİTAP";
  position: absolute;
  left: 13px;
  top: 13px;
  border-radius: 999px;
  padding: 6px 9px;
  color: #fff;
  background: var(--nv-navy);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
}

.nv-book__cover img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: 270px;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 10px 13px 24px rgba(16, 37, 63, .23);
}

.nv-book__content {
  padding: 19px;
}

.nv-book__meta {
  margin: 0 0 7px;
  color: var(--nv-blue);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.nv-book h3 {
  min-height: 46px;
  margin: 0 0 17px;
  color: var(--nv-ink);
  font-size: 17px;
  line-height: 1.35;
}

.nv-book__actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.nv-book__open,
.nv-book__share {
  appearance: none;
  border: 0;
  min-height: 42px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 780;
  cursor: pointer;
}

.nv-book__open {
  color: #fff;
  background: var(--nv-blue);
}

.nv-book__share {
  width: 42px;
  color: var(--nv-navy);
  background: #edf2f8;
  font-size: 16px;
}

.nv-library__empty {
  grid-column: 1 / -1;
  padding: 58px 24px;
  border: 1px dashed #bdc9d8;
  border-radius: 18px;
  color: var(--nv-muted);
  text-align: center;
  background: #fff;
}

.nv-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100000;
  transform: translate(-50%, 18px);
  border-radius: 999px;
  padding: 12px 18px;
  color: #fff;
  background: #112a4a;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  box-shadow: 0 12px 35px rgba(0, 0, 0, .24);
}

.nv-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.nv-viewer[hidden] {
  display: none !important;
}

.nv-viewer {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 24px;
}

.nv-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 17, 33, .82);
  backdrop-filter: blur(5px);
}

.nv-viewer__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1440px, 96vw);
  height: min(920px, 94vh);
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .42);
}

.nv-viewer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 18px 13px 22px;
  color: #fff;
  background: var(--nv-navy);
}

.nv-viewer__header p {
  margin: 0 0 2px;
  color: var(--nv-yellow);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .13em;
}

.nv-viewer__header h2 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.3;
}

.nv-viewer__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nv-viewer__actions button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 10px;
  padding: 9px 13px;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.nv-viewer__actions .nv-viewer__close {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.nv-viewer__frame-wrap {
  flex: 1;
  min-height: 0;
  background: #dfe8f2;
}

.nv-viewer__frame-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.nv-viewer__notice {
  margin: 0;
  padding: 8px 15px;
  color: #64748b;
  background: #f8fafc;
  font-size: 10px;
  text-align: center;
}

body.nv-viewer-open {
  overflow: hidden !important;
}

.nv-library__grades.is-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.nv-library__grades.is-compact .nv-grade {
  flex: 0 1 180px;
  min-height: 0;
  padding: 14px 17px;
  border-radius: 13px;
}

.nv-library__grades.is-compact .nv-grade::after,
.nv-library__grades.is-compact .nv-grade > span {
  display: none;
}

.nv-library__grades.is-compact .nv-grade strong {
  font-size: 17px;
}

.nv-library__grades.is-compact .nv-grade small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}

.nv-library__grades.is-compact .nv-grade.is-active {
  outline: 3px solid rgba(244, 197, 66, .7);
  box-shadow: 0 10px 25px rgba(13, 43, 80, .22);
}

@media (max-width: 980px) {
  .nv-library__subjects,
  .nv-library__books {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nv-library__grades {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nv-library__container {
    width: min(100% - 28px, 1180px);
  }

  .nv-library__hero {
    padding: 56px 0 50px;
  }

  .nv-library__hero-glow {
    display: none;
  }

  .nv-library__lead {
    font-size: 15px;
  }

  .nv-library__toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
  }

  .nv-library__levels,
  .nv-library__levels button,
  .nv-library__search {
    width: 100%;
  }

  .nv-library__levels button {
    flex: 1;
    min-width: 0;
    min-height: 38px;
    padding: 8px 12px;
    line-height: 1.2;
  }

  .nv-library__levels {
    gap: 4px;
    padding: 4px;
    border-radius: 11px;
  }

  /* Eski temanın mobil arama alanına verdiği büyük ölçüleri sınırla. */
  .nv-library .nv-library__search {
    display: block;
    flex: none;
    width: 100%;
    max-width: 100%;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
  }

  .nv-library .nv-library__search input[type="search"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 10px 14px 10px 40px !important;
    border-radius: 11px !important;
    font-size: 14px !important;
    line-height: 22px !important;
  }

  .nv-library__search::before {
    left: 13px;
    font-size: 20px;
  }

  .nv-library__subjects,
  .nv-library__books {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }

  .nv-subject {
    min-height: 154px;
    padding: 19px;
  }

  .nv-viewer {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 2147483646;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0 !important;
  }

  .nv-viewer__dialog {
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0;
  }

  .nv-viewer__header {
    flex: 0 0 auto;
    padding: 10px 11px 10px 14px;
  }

  .nv-viewer__frame-wrap {
    flex: 1 1 auto;
  }

  .nv-viewer__actions button:not(.nv-viewer__close) {
    display: none;
  }
}

@media (max-width: 480px) {
  .nv-library__body {
    padding-top: 20px;
  }

  .nv-library__crumbs {
    min-height: 28px;
    margin-bottom: 12px;
  }

  .nv-library__subjects,
  .nv-library__books,
  .nv-library__grades {
    grid-template-columns: 1fr;
  }

  .nv-library__hero h1 {
    font-size: 39px;
  }

  .nv-book__cover {
    aspect-ratio: 5 / 4;
  }

  .nv-library__grades.is-compact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nv-library__grades.is-compact .nv-grade {
    width: 100%;
  }
}
