/* MyEbook - Editorial Custom Theme */
:root {
  --bg-body: #faf8f5;
  --surface: #ffffff;
  --border-color: #ede8e1;
  --accent-gold: #9e731e;
  --accent-gold-hover: #7e5a14;
  --text-main: #1c1917;
  --text-muted-custom: #78716c;
  --telebirr-blue: #0077c8;
  --cbe-purple: #74177b;
  --success-green: #15803d;
  --danger-red: #b91c1c;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.82rem;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.font-serif {
  font-family: 'Playfair Display', Georgia, serif;
}

.tracking-wide {
  letter-spacing: 0.08em;
}

/* Minimal Top Navigation */
.top-header {
  background-color: rgba(250, 248, 245, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1030;
}

.brand-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand-link:hover {
  color: var(--accent-gold);
}

/* Editorial Card Style */
.editorial-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  position: relative;
}

.editorial-card:hover {
  border-color: #dfd7cc;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.book-cover-frame {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.09);
  background: #e7e5e4;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.book-cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.editorial-card:hover .book-cover-frame img {
  transform: scale(1.03);
}

.book-badge-purchased {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(21, 128, 61, 0.92);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  z-index: 2;
}

/* Buttons */
.btn-buy {
  background: var(--text-main);
  color: #faf8f5;
  border: none;
  font-weight: 600;
  font-size: 0.74rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
}

.btn-buy:hover, .btn-buy:active {
  background: var(--accent-gold);
  color: #ffffff;
}

.btn-read {
  background: #1c1917;
  color: #faf8f5;
  border: none;
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-read:hover {
  background: #44403c;
  color: #fff;
}

.btn-download {
  background: #f5f5f4;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-download:hover {
  background: #e7e5e4;
  color: var(--text-main);
}

.btn-gold {
  background: var(--accent-gold);
  color: #ffffff;
  border: none;
  font-weight: 600;
  transition: background 0.2s ease;
}

.btn-gold:hover, .btn-gold:focus {
  background: var(--accent-gold-hover);
  color: #ffffff;
}

/* Category Filter Chips */
.category-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.category-pill {
  white-space: nowrap;
  font-size: 0.73rem;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted-custom);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s ease;
}

.category-pill:hover {
  border-color: var(--accent-gold);
  color: var(--text-main);
}

.category-pill.active {
  background: var(--text-main);
  color: #fff;
  border-color: var(--text-main);
}

/* Customer Phone Pill Bar */
.customer-bar {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 4px 12px;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Payment Method Cards */
.payment-option-card {
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}

.payment-option-card:hover {
  border-color: #d1c7b7;
}

.payment-option-card.selected {
  border-color: var(--accent-gold);
  background: #fdfbf7;
}

.payment-badge-telebirr {
  background: #e1f0ff;
  color: #0066b2;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
}

.payment-badge-cbe {
  background: #f6e8f8;
  color: #74177b;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
}

/* Reader View */
.pdf-reader-container {
  height: calc(100vh - 65px);
  width: 100%;
  background: #2b2b2b;
  position: relative;
  display: flex;
  flex-direction: column;
}

.pdf-toolbar {
  background: #1e1e1e;
  color: #e5e5e5;
  padding: 8px 16px;
  border-bottom: 1px solid #333;
}

.pdf-viewport-frame {
  flex: 1;
  width: 100%;
  border: none;
}

/* Modal styling */
.modal-content {
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
}

/* Loading Pulse Animation */
@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}

.pulse-spinner {
  animation: pulseGlow 1.8s infinite ease-in-out;
}

/* Admin Sidebar & Responsive Drawer */
.admin-sidebar,
.admin-sidebar.offcanvas-md,
.offcanvas-md.admin-sidebar {
  background-color: #1c1917 !important;
  color: #d6d3d1 !important;
  --bs-offcanvas-bg: #1c1917 !important;
  --bs-offcanvas-color: #d6d3d1 !important;
  --bs-offcanvas-border-color: rgba(255, 255, 255, 0.1) !important;
}

@media (min-width: 768px) {
  .admin-sidebar,
  .admin-sidebar.offcanvas-md {
    min-height: 100vh !important;
    background-color: #1c1917 !important;
    color: #d6d3d1 !important;
    position: sticky;
    top: 0;
    z-index: 100;
  }
}

@media (max-width: 767.98px) {
  .admin-sidebar.offcanvas-md {
    max-width: 285px;
    background-color: #1c1917 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.7);
  }
}

.admin-nav-link {
  color: #a8a29e !important;
  padding: 9px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  transition: all 0.15s ease;
}

.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

.admin-nav-link.active {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
  font-weight: 600;
}

.admin-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
