:root {
  --primary: #0a0f1d;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  --star: #f59e0b;
}

[data-bs-theme="dark"] {
  --primary: #030712;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --bg: #0b0f19;
  --card-bg: #111827;
  --text: #f9fafb;
  --text-muted: #9ca3af;
  --border: #1f2937;
  --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --star: #fbbf24;
}

body {
  background-color: var(--bg);
  font-family: 'Cairo', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.top-live-bar { background: linear-gradient(90deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%); color: #e0e7ff; font-size: 0.8rem; padding: 0.45rem 0; font-weight: 600; }
.navbar-iar { background-color: var(--primary); border-bottom: 2px solid var(--border); padding: 1rem 0; position: sticky; top: 0; z-index: 1020; }

.brand-logo-icon { width: 44px; height: 44px; background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%); color: #ffffff; border-radius: 12px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35); }
.brand-title { font-weight: 900; font-size: 1.45rem; color: #ffffff; }
.brand-subtitle { color: #94a3b8; font-size: 0.8rem; font-weight: 600; }

.hero-stats-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 1.25rem 1.5rem; box-shadow: var(--card-shadow); position: relative; }
.hero-stats-card::before { content: ''; position: absolute; top: 0; right: 0; width: 4px; height: 100%; background: var(--accent); }
html[dir="ltr"] .hero-stats-card::before { right: auto; left: 0; }
.stat-box { padding: 0.4rem 0.8rem; border-left: 1px solid var(--border); }
html[dir="ltr"] .stat-box { border-left: none; border-right: 1px solid var(--border); }

.bundle-bar { background: var(--accent); color: #ffffff; border-radius: 12px; padding: 0.75rem 1.25rem; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3); margin-bottom: 1.5rem; }

.chips-wrapper { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; scrollbar-width: none; }
.chips-wrapper::-webkit-scrollbar { display: none; }
.chip-item { background: var(--card-bg); border: 1px solid var(--border); color: var(--text-muted); padding: 0.45rem 1rem; border-radius: 30px; font-size: 0.85rem; font-weight: 700; white-space: nowrap; cursor: pointer; transition: all 0.2s ease; }
.chip-item:hover, .chip-item.active { background: var(--accent); color: #ffffff; border-color: var(--accent); }

.book-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 1.25rem; transition: transform 0.25s ease, box-shadow 0.25s ease; position: relative; overflow: visible !important; z-index: 1; }
.book-card:hover { z-index: 20; transform: translateY(-4px); box-shadow: 0 16px 30px -10px rgba(15, 23, 42, 0.12); }

.cover-container { width: 110px; height: 155px; flex-shrink: 0; border-radius: 10px; position: relative; background: var(--bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; box-shadow: -5px 8px 16px rgba(0, 0, 0, 0.12); }
.cover-img-wrapper { width: 100%; height: 100%; border-radius: 10px; position: relative; cursor: pointer; }
.cover-img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.cover-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--text-muted); background-color: var(--bg); }

@media (hover: hover) and (pointer: fine) {
  .cover-container:hover .cover-img { position: absolute; top: 0; inset-inline-start: 0; width: 250px; height: 350px; z-index: 9999; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45); border: 3px solid var(--card-bg); border-radius: 12px; }
}

.badge-tag { background: rgba(37, 99, 235, 0.1); color: var(--accent); font-size: 0.75rem; font-weight: 700; padding: 0.3rem 0.65rem; border-radius: 20px; }
.badge-type { background: rgba(16, 185, 129, 0.1); color: #10b981; font-size: 0.72rem; font-weight: 700; padding: 0.25rem 0.55rem; border-radius: 6px; }
.book-title { font-weight: 800; font-size: 1.08rem; color: var(--text); line-height: 1.4; margin-top: 0.3rem; }
.book-author { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.book-desc { font-size: 0.84rem; color: var(--text-muted); line-height: 1.55; }
.meta-spec-chip { font-size: 0.73rem; font-weight: 600; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); padding: 0.2rem 0.5rem; border-radius: 6px; display: inline-flex; align-items: center; gap: 0.25rem; }

.btn-iar-action { background: var(--bg); color: var(--text); font-weight: 700; font-size: 0.82rem; border: 1px solid var(--border); border-radius: 8px; padding: 0.45rem; transition: all 0.2s ease; }
.btn-iar-action:hover { background: rgba(37, 99, 235, 0.1); color: var(--accent); border-color: var(--accent); }
.btn-iar-primary { background: var(--accent); color: #ffffff; font-weight: 700; font-size: 0.82rem; border-radius: 8px; padding: 0.45rem; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn-iar-primary:hover { background: var(--accent-hover); color: #ffffff; }

.rating-stars { display: inline-flex; gap: 0.2rem; cursor: pointer; font-size: 1rem; }
.rating-stars i { color: var(--text-muted); transition: color 0.2s; }
.rating-stars i.active { color: var(--star); }
.rating-stars i:hover { transform: scale(1.2); }

.footer-iar {
  background-color: var(--primary);
  border-top: 1px solid var(--border);
  color: #e2e8f0;
  padding: 2rem 0;
  margin-top: auto;
}

.footer-iar .brand-title {
  color: #ffffff !important;
  font-weight: 900;
  font-size: 1.45rem;
}

.footer-iar .social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-iar .social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 1.4rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.footer-iar .social-icon:hover {
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.footer-iar .copyright {
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

#singleBookView {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
}
.single-cover {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.single-cover img {
  width: 100%;
  height: auto;
  object-fit: cover;
}
.single-book-title {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text);
}
.single-book-author {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}
.single-detail-section {
  background: var(--bg);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.single-detail-section h6 {
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.single-detail-section p,
.single-detail-section li {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-back:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }
