html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(91, 147, 255, 0.5);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
  font-family: 'Vazirmatn', sans-serif;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 147, 255, 0.3) transparent;
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(91, 147, 255, 0.2), rgba(212, 75, 255, 0.2));
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(91, 147, 255, 0.5), rgba(212, 75, 255, 0.5));
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* ---------- Premium Glossy Theme ---------- */

.public-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: rgba(255, 255, 255, 0.95);
  background: 
    radial-gradient(circle at 15% 15%, rgba(91, 147, 255, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(212, 75, 255, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(58, 255, 223, 0.05) 0%, transparent 60%),
    #05070a;
  direction: rtl;
  text-align: right;
}

.public-main {
  flex: 1;
}

.public-navbar {
  margin: 20px 20px 0;
  border-radius: 24px;
  background: rgba(12, 16, 33, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(25px) saturate(200%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
  padding: 12px 0;
  z-index: 1050;
}

.public-navbar.scrolled {
  margin: 0;
  border-radius: 0;
  background: rgba(8, 10, 22, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 0;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
}

.navbar-brand {
  display: flex !important;
  align-items: center;
  gap: 14px;
}

.navbar-brand span {
  font-weight: 900;
  letter-spacing: -0.8px;
  background: linear-gradient(to bottom, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.4rem;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5B93FF, #D44BFF);
  box-shadow: 0 0 20px rgba(91, 147, 255, 0.8);
  position: relative;
}

.brand-dot::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  border: 1.5px solid rgba(91, 147, 255, 0.5);
  animation: pulse-glow 2.5s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

.nav-link {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65) !important;
  padding: 0.7rem 1.4rem !important;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  border-radius: 12px;
}

.nav-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: #fff !important;
  background: rgba(91, 147, 255, 0.1);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #5B93FF, #D44BFF);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  transform: translateX(-50%);
  border-radius: 10px;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 45%;
}

.hero {
  padding: 130px 0 60px;
  text-align: center;
  position: relative;
}

.filter-wrapper {
  width: 100%;
}

.filter-bar {
  border-radius: 28px !important;
  padding: 16px 20px !important;
  box-shadow: 0 40px 100px -10px rgba(0, 0, 0, 0.5) !important;
}

.search-input-wrapper {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-input-wrapper .glossy-input {
  background: transparent !important;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 32px;
  border-radius: 999px;
  background: rgba(91, 147, 255, 0.12);
  border: 1px solid rgba(91, 147, 255, 0.3);
  color: #5B93FF;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 40px;
  backdrop-filter: blur(15px);
  animation: fade-in-down 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes fade-in-down {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero__title {
  font-size: 60px;
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 35px;
  background: linear-gradient(to bottom, #fff 15%, rgba(255, 255, 255, 0.65) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fade-in 1.2s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s both;
}

.hero__subtitle {
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.4rem;
  line-height: 1.75;
  max-width: 900px;
  margin: 0 auto 60px;
  animation: fade-in 1.2s cubic-bezier(0.165, 0.84, 0.44, 1) 0.4s both;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.glass-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 40px;
  box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(35px);
  padding: 55px;
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.glass-panel:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-8px);
}

.book-card {
  height: 100%;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  opacity: 0;
  transform: translateY(30px);
  display: flex;
  flex-direction: column;
}

.book-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.book-card:hover {
  transform: translateY(-12px);
  border-color: rgba(91, 147, 255, 0.4);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.book-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.book-card__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.book-card:hover .book-card__cover {
  transform: scale(1.15) rotate(1deg);
}

.book-card__actions-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8, 10, 22, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.4s ease;
  transform: scale(1.1);
  z-index: 2;
}

.book-card:hover .book-card__actions-overlay {
  opacity: 1;
  transform: scale(1);
}

.book-card__body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: #fff;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.book-card:hover .book-card__title {
  color: #5B93FF;
}

.badge-soft {
  background: rgba(91, 147, 255, 0.1) !important;
  border: 1px solid rgba(91, 147, 255, 0.2);
  color: #5B93FF !important;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  width: fit-content;
}

.book-card__desc {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 35px;
  flex: 1;
}

.btn-glossy {
  background: linear-gradient(135deg, #5B93FF 0%, #D44BFF 100%);
  border: none;
  border-radius: 20px;
  padding: 16px 32px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 15px 30px rgba(91, 147, 255, 0.4);
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-glossy:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 20px 45px rgba(91, 147, 255, 0.6);
  filter: brightness(1.2);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 16px 32px;
  font-weight: 800;
  color: #fff;
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
  transform: translateY(-3px);
}

.public-footer {
  padding: 100px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(4, 6, 12, 0.98);
  backdrop-filter: blur(40px);
  margin-top: 150px;
}

.footer-brand {
  font-weight: 950;
  font-size: 1.65rem;
  margin-bottom: 25px;
  display: block;
  background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0.6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
  font-weight: 700;
}

.footer-link:hover {
  color: #fff;
  padding-right: 12px;
}

.dropdown-menu.glass-panel {
  background: rgba(15, 20, 45, 0.98);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 28px;
  padding: 20px;
  margin-top: 30px !important;
  box-shadow: 0 40px 90px rgba(0,0,0,0.7);
  animation: dropdown-slide 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes dropdown-slide {
  from { opacity: 0; transform: translateY(25px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-item {
  border-radius: 16px;
  padding: 16px 28px;
  color: rgba(255, 255, 255, 0.8) !important;
  transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
  font-weight: 800;
}

.dropdown-item:hover {
  background: rgba(91, 147, 255, 0.22);
  color: #fff !important;
  padding-right: 36px;
  transform: translateX(-8px);
}

.pagination-glass .page-link {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.75);
  border-radius: 20px;
  margin: 0 10px;
  padding: 14px 28px;
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  font-weight: 800;
}

.pagination-glass .page-item.active .page-link {
  background: linear-gradient(135deg, #5B93FF 0%, #D44BFF 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 20px 40px rgba(91, 147, 255, 0.5);
  transform: translateY(-6px);
}

.pagination-glass .page-link:hover:not(.active) {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.4);
}

.scroll-top-btn {
  position: fixed;
  bottom: 50px;
  right: 50px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5B93FF, #D44BFF);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 20px 45px rgba(0,0,0,0.5);
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
  border: 2.5px solid rgba(255, 255, 255, 0.25);
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top-btn:hover {
  transform: translateY(-12px) rotate(360deg);
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Perfect Centered Modal */
.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}

.glass-modal {
  background: rgba(12, 16, 33, 0.85) !important;
  border-radius: 32px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(40px) saturate(150%) !important;
  padding: 10px;
  box-shadow: 0 60px 150px rgba(0, 0, 0, 0.8) !important;
}

.modal-header {
  padding: 20px 30px 10px !important;
  border: 0 !important;
}

.modal-body {
  padding: 10px 30px 30px !important;
}

.modal-footer {
  padding: 15px 30px 30px !important;
  border: 0 !important;
}

.modal-header .btn-close {
  filter: invert(1) grayscale(1) brightness(2.5);
  opacity: 0.6;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-header .btn-close:hover {
  opacity: 1;
  transform: rotate(180deg) scale(1.1);
}

@media (max-width: 991px) {
  .public-navbar {
    margin: 20px;
    border-radius: 24px;
    padding: 12px 0;
  }
  .hero {
    padding: 100px 0 40px;
  }
  .glass-panel {
    padding: 30px;
    border-radius: 28px;
  }
  .filter-bar {
    border-radius: 20px !important;
  }
}

