/* ==========================================================================
   AUTOPIA - AU PLATFORM STYLING
   Colors:
   - Primary Blue: #2563EB / #1D4ED8
   - Clean Backgrounds: #FFFFFF / #F8FAFC
   - Dark Typography: #0F172A / #1E293B
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
}

/* Glassmorphism Navigation & Modals */
.glass-nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-modal {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Wattpad 2:3 Cover Poster Aspect Ratio */
.story-cover-container {
  position: relative;
  width: 100%;
  padding-top: 150%; /* 2:3 Aspect Ratio */
  overflow: hidden;
  border-radius: 0.75rem;
  background-color: #f1f5f9;
}

.story-cover-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.story-card:hover .story-cover-img {
  transform: scale(1.06);
}

/* KaryaKarsa Card Shadow & Hover */
.story-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #ffffff;
  border-radius: 1rem;
}

.story-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.1), 0 8px 10px -6px rgba(37, 99, 235, 0.05);
}

/* Age Rating Badges */
.badge-age-su {
  background-color: #10b981;
  color: #ffffff;
}

.badge-age-13 {
  background-color: #2563eb;
  color: #ffffff;
}

.badge-age-18 {
  background-color: #f97316;
  color: #ffffff;
}

.badge-age-21 {
  background-color: #ef4444;
  color: #ffffff;
}

/* Horizontal Slide Reader Controls & Carousel */
.reader-slide-container {
  display: flex;
  overflow-x: hidden;
  scroll-behavior: smooth;
  width: 100%;
  height: calc(100vh - 120px);
  max-height: 800px;
}

.reader-slide {
  flex: 0 0 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.reader-slide img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}

.scrollbar-none::-webkit-scrollbar {
  display: none;
}
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Dual-Card Role Selection in Login Modal */
.role-choice-card {
  position: relative;
  border: 2px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 1.25rem;
  background-color: #ffffff;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.role-choice-card:hover {
  border-color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.1);
}

.role-choice-card.active {
  border-color: #2563eb;
  background-color: #eff6ff;
  box-shadow: 0 12px 25px -5px rgba(37, 99, 235, 0.2);
}

.role-choice-card.active .role-badge {
  background-color: #2563eb;
  color: #ffffff;
}

.role-choice-card.active-creator {
  border-color: #8b5cf6;
  background-color: #f5f3ff;
  box-shadow: 0 12px 25px -5px rgba(139, 92, 246, 0.2);
}

.role-choice-card.active-creator .role-badge {
  background-color: #8b5cf6;
  color: #ffffff;
}

/* Horizontal Carousel for My Books & New Arrival */
.horizontal-carousel {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  scroll-behavior: smooth;
}

.horizontal-carousel > * {
  scroll-snap-align: start;
  flex: 0 0 180px;
}

@media (min-width: 640px) {
  .horizontal-carousel > * {
    flex: 0 0 200px;
  }
}

/* Book Details Modal Components */
.stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  text-align: center;
}

/* Horizontal Slide Reader Text & Slide Transitions */
.reader-text-container {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  background: #0f172a;
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  color: #f8fafc;
  line-height: 1.8;
  font-size: 1rem;
}

.quote-block {
  border-left: 4px solid #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  padding: 1rem 1.25rem;
  border-radius: 0 0.75rem 0.75rem 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: #93c5fd;
}

.text-tooltip {
  position: absolute;
  top: -45px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 40;
}

/* Animated Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 5rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.875rem 1.25rem;
  border-radius: 0.75rem;
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s ease forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Floating navigation: glass surface, moving hover light and compact tooltips. */
.floating-bottom-nav {
  position: fixed;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: calc(100% - 2rem);
  max-width: 440px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 14px 45px -12px #243a6440, 0 0 0 1px #dfe6f080, inset 0 1px 0 white;
  isolation: isolate;
}
.floating-bottom-nav > form { display: flex; margin: 0; }
.floating-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 18px;
  color: #7b879c;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color .22s ease, background .25s ease, box-shadow .25s ease;
}
.floating-nav-item > svg, .floating-nav-item > img {
  transition: transform .32s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
}
.floating-nav-item.active, .floating-nav-item.active-creator {
  color: white;
  background: linear-gradient(145deg, #4585ff, #5253df);
  box-shadow: 0 7px 16px -5px #4566e878, inset 0 1px 0 #ffffff45;
}
.floating-nav-item.active::after, .floating-nav-item.active-creator::after {
  content: '';
  position: absolute;
  bottom: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffffffb0;
}
.floating-nav-item:focus-visible { outline: 2px solid #5377ea; outline-offset: 4px; }
.floating-nav-item::before {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 18px);
  left: 50%;
  transform: translate(-50%, 6px) scale(.96);
  padding: 7px 11px;
  border-radius: 10px;
  background: #1e293bee;
  color: white;
  box-shadow: 0 5px 15px #0f172a20;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .25s ease, visibility .2s;
}
.floating-nav-item:focus-visible::before { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
.nav-hover-light {
  position: absolute;
  left: 0;
  top: 8px;
  width: 52px;
  height: 52px;
  z-index: -1;
  pointer-events: none;
  border-radius: 18px;
  background: linear-gradient(145deg, #e8f0ff, #eeeaff);
  opacity: 0;
  transition: transform .38s cubic-bezier(.22,1,.36,1), opacity .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .floating-nav-item:hover { color: #4766d9; }
  .floating-nav-item.active:hover, .floating-nav-item.active-creator:hover { color: white; box-shadow: 0 10px 22px -5px #4566e88c; }
  .floating-nav-item:hover > svg, .floating-nav-item:hover > img { transform: translateY(-3px) scale(1.1); }
  .floating-nav-item:hover::before { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
}
.floating-nav-item:active > svg, .floating-nav-item:active > img { transform: scale(.92); }
@media (max-width: 380px) { .floating-nav-item, .nav-hover-light { width: 46px; height: 46px; } }
@media (prefers-reduced-motion: reduce) {
  .floating-nav-item, .floating-nav-item > svg, .floating-nav-item > img, .floating-nav-item::before, .nav-hover-light { transition: none; }
}

/* Book dashboard: a single, calm catalogue surface without a review sidebar. */
.catalog-dashboard { padding-bottom: 7.5rem; }
.catalog-surface { background: rgba(255,255,255,.8); border: 1px solid #e6edf6; border-radius: 28px; padding: 1.25rem; box-shadow: 0 18px 45px -35px #0f172a70; }
.catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.catalog-eyebrow { color: #2563eb; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.catalog-heading h1, .catalog-heading h2 { margin: .2rem 0; font-size: clamp(1.25rem, 2.5vw, 1.65rem); font-weight: 800; letter-spacing: -.045em; }
.catalog-description { color: #778397; font-size: .8rem; font-weight: 600; }
.catalog-see-all { color: #2563eb; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.catalog-filters { display: flex; gap: .55rem; overflow-x: auto; padding: .2rem 0 1rem; }
.catalog-filters a { flex: 0 0 auto; }
.catalog-row + .catalog-row { margin-top: 1.85rem; }
.book-dashboard-carousel { display: flex; gap: .85rem; overflow-x: auto; padding: .15rem .15rem .6rem; scroll-snap-type: x proximity; }
.dashboard-book-card { display: block; flex: 0 0 112px; min-width: 0; border-radius: 13px; overflow: hidden; background: #fff; border: 1px solid #edf1f6; text-decoration: none; scroll-snap-align: start; transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease; }
.dashboard-book-card:hover { transform: translateY(-4px); border-color: #bfdbfe; box-shadow: 0 18px 30px -20px #1e40af70; }
.dashboard-cover { border-radius: 0; }
.dashboard-book-card:hover .story-cover-img { transform: scale(1.05); }
.dashboard-rating { position: absolute; left: .6rem; bottom: .6rem; display: flex; gap: .25rem; align-items: center; padding: .28rem .48rem; border-radius: 999px; background: #0f172ad9; color: white; font-size: .64rem; font-weight: 800; }
.dashboard-book-copy { padding: .7rem .72rem .82rem; }
.dashboard-genre { color: #2563eb; font-size: .6rem; font-weight: 800; text-transform: uppercase; }
.dashboard-book-copy h2, .dashboard-book-copy h3 { overflow: hidden; margin: .22rem 0; color: #15223a; font-size: .72rem; font-weight: 800; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-book-copy p { overflow: hidden; color: #8792a4; font-size: .67rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.catalog-empty { padding: 3rem 1rem; text-align: center; color: #64748b; font-size: .9rem; }
.catalog-empty.compact { padding: .85rem 0; text-align: left; font-size: .75rem; }

/* Library uses the same light-blue catalogue language as the dashboard. */
.library-dashboard { padding-bottom: 7.5rem; }
.library-heading { padding: .35rem 0 .7rem; }
.library-heading h1 { margin-top: .15rem; color: #15223a; font-size: clamp(1.55rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.045em; }
.library-catalog-surface, .tbr-mobile-surface { border: 1px solid #e6edf6; border-radius: 24px; background: rgba(255,255,255,.82); padding: 1.15rem; box-shadow: 0 18px 45px -35px #0f172a70; }
.tbr-mobile-surface > div:first-child h2 { margin: .15rem 0 0; color: #15223a; font-size: 1.25rem; font-weight: 800; letter-spacing: -.035em; }
.tbr-mobile-surface > div:first-child > span { color: #64748b; font-size: .72rem; font-weight: 800; }
.tbr-mobile-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .65rem; }
.tbr-mobile-card { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: .7rem; border: 1px solid #e8eef5; border-radius: 15px; background: #fff; padding: .75rem .8rem; }
.tbr-mobile-copy { min-width: 0; }
.tbr-mobile-copy h3 { overflow: hidden; margin: 0; color: #1e293b; font-size: .76rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.tbr-mobile-copy p { overflow: hidden; margin: .18rem 0 0; color: #94a3b8; font-size: .65rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.tbr-mobile-genre { flex: 0 0 auto; border-radius: 999px; background: #eff6ff; padding: .3rem .45rem; color: #2563eb; font-size: .6rem; font-weight: 800; }
.notification-popover { position: absolute; right: 0; top: calc(100% + .75rem); z-index: 60; display: none; width: min(360px, calc(100vw - 2rem)); overflow: hidden; border: 1px solid #e2e8f0; border-radius: 18px; background: #fff; box-shadow: 0 20px 40px -18px #0f172a55; }
.group:hover .notification-popover, .group:focus-within .notification-popover { display: block; }
.notification-popover-head { display: flex; justify-content: space-between; padding: .9rem 1rem; border-bottom: 1px solid #edf2f7; color: #1e293b; font-size: .78rem; }.notification-popover-head span { color: #2563eb; font-size: .65rem; font-weight: 800; }
.notification-item { display: block; padding: .75rem 1rem; border-bottom: 1px solid #f1f5f9; color: #64748b; text-decoration: none; }.notification-item.unread { background: #eff6ff; }.notification-item b,.notification-item span,.notification-item small { display: block; }.notification-item b { color: #1e293b; font-size: .72rem; }.notification-item span { margin-top: .15rem; font-size: .67rem; line-height: 1.4; }.notification-item small { margin-top: .25rem; color: #94a3b8; font-size: .57rem; }.notification-empty { padding: 1.25rem; color: #94a3b8; font-size: .75rem; }
.author-search-results { margin: .25rem 0 1.4rem; }.author-search-results > div { display: flex; gap: .6rem; overflow-x: auto; padding-top: .45rem; }.author-search-results a { display: flex; flex: 0 0 auto; align-items: center; gap: .55rem; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; padding: .55rem .75rem; color: #1e293b; text-decoration: none; }.author-search-results img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }.author-search-results b,.author-search-results small { display:block; }.author-search-results b { font-size:.7rem; }.author-search-results small { margin-top:.15rem; color:#94a3b8; font-size:.6rem; }
.author-profile-hero { display: flex; align-items: center; gap: 1rem; border: 1px solid #e2e8f0; border-radius: 24px; background: #fff; padding: 1.25rem; box-shadow: 0 18px 45px -35px #0f172a70; }.author-profile-avatar { width: 88px; height: 88px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; }.author-profile-hero h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.04em; }.author-follow-button { margin-left: auto; flex: 0 0 auto; border-radius: 999px; background: #2563eb; padding: .7rem .9rem; color:white; font-size:.72rem; font-weight:800; }.author-follow-button.following { background:#334155; }
.author-comment-row { display: flex; gap: .7rem; border: 1px solid #e8eef5; border-radius: 15px; background: #f8fafc; padding: .8rem; }.author-comment-row > img { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; }.author-comment-row > div { min-width: 0; }.author-comment-row b { color: #1e293b; font-size: .72rem; }.author-comment-row span,.author-comment-row small { color: #94a3b8; font-size: .62rem; }.author-comment-row p { margin-top: .35rem; color: #475569; font-size: .75rem; line-height: 1.5; }
.search-genre-panel { position: absolute; top: calc(100% + .55rem); left: 0; z-index: 70; display: none; width: 100%; min-width: 300px; border: 1px solid #e2e8f0; border-radius: 18px; background: #fff; padding: .85rem; box-shadow: 0 18px 38px -18px #0f172a44; }.search-genre-panel > p { margin-bottom: .55rem; color: #64748b; font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }.search-genre-panel > div { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .45rem; }.search-genre-panel a { overflow: hidden; border-radius: 8px; padding: .5rem .45rem; color: #334155; font-size: .65rem; font-weight: 800; text-align: center; text-overflow: ellipsis; white-space: nowrap; transition: transform .16s ease; }.search-genre-panel a:hover { transform: translateY(-1px); }.relative:focus-within > .search-genre-panel { display: block; }
@media (max-width: 480px) { .library-catalog-surface, .tbr-mobile-surface { padding: 1rem; border-radius: 20px; } .tbr-mobile-list { display: flex; overflow-x: auto; gap: .6rem; padding-bottom: .2rem; } .tbr-mobile-card { flex: 0 0 min(82vw, 285px); } }

/* Super Admin only: grouped navigation mirrors the operational access areas. */
.admin-nav-label { margin: 0 0 .35rem; color: #93c5fd; font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.admin-nav-label ~ a, .admin-nav-single { display: block; padding: .25rem .5rem .25rem .85rem; color: #cbd5e1; border-radius: .4rem; font-weight: 600; }
.admin-nav-label ~ a:hover, .admin-nav-single:hover { color: white; background: #334155; }
.admin-nav-single { padding-left: .25rem; }
.admin-search { min-width: 190px; border: 1px solid #475569; border-radius: .7rem; background: #0f172a; padding: .6rem .75rem; color: #e2e8f0; font-size: .75rem; outline: none; }
.admin-search:focus { border-color: #60a5fa; box-shadow: 0 0 0 2px #2563eb33; }
.admin-data-panel { border: 1px solid #334155; border-radius: 1.5rem; background: #1e293bcc; padding: 1.25rem; box-shadow: 0 18px 35px -28px #000; }
.admin-data-panel .admin-panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; color: #94a3b8; font-size: .78rem; font-weight: 600; }
.admin-data-panel table { color: #cbd5e1; }
.admin-data-panel th { padding-bottom: .7rem; color: #94a3b8; font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.admin-data-panel td { border-top: 1px solid #33415588; padding: .55rem .5rem .55rem 0; }
.admin-status { border-radius: 999px; background: #064e3b; padding: .2rem .5rem; color: #6ee7b7; font-size: .63rem; font-weight: 800; text-transform: capitalize; }
.admin-action { border-radius: .7rem; background: #2563eb; padding: .6rem .8rem; color: white; font-size: .72rem; font-weight: 800; }
.admin-empty-workspace { border: 1px dashed #475569; border-radius: 1.5rem; background: #1e293b99; padding: 2rem; color: #cbd5e1; }
.admin-empty-workspace > span { color: #60a5fa; font-size: .65rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.admin-empty-workspace h2 { margin: .3rem 0 .6rem; color: white; font-size: 1.5rem; font-weight: 800; }
.admin-empty-workspace > p { max-width: 42rem; color: #94a3b8; font-size: .85rem; line-height: 1.65; }
.admin-empty-workspace > div { margin-top: 1.5rem; }
.admin-empty-workspace > div > div { border: 1px solid #334155; border-radius: 1rem; background: #0f172a77; padding: 1rem; }
.admin-empty-workspace b, .admin-empty-workspace small { display: block; }.admin-empty-workspace b { color: white; font-size: .8rem; }.admin-empty-workspace small { margin-top: .2rem; color: #94a3b8; font-size: .7rem; }
@media (max-width: 640px) { .admin-data-panel .admin-panel-toolbar { align-items: stretch; flex-direction: column; } .admin-search { width: 100%; } }

/* Detail book view: cover and info arranged side-by-side in hero (Zero Overlap) */
.book-detail-page { padding-bottom: 9rem; }
.book-detail-card { overflow: hidden; background: white; border: 1px solid #e2e8f0; border-radius: 24px; box-shadow: 0 22px 45px -32px rgba(15, 23, 42, 0.5); }
.book-detail-hero { position: relative; overflow: hidden; background: #0f172a; padding: 1.5rem 1.25rem; }
.book-detail-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(28px); opacity: 0.3; transform: scale(1.15); pointer-events: none; }
.book-detail-hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 23, 42, 0.75) 0%, rgba(15, 23, 42, 0.95) 100%); }
.book-detail-hero-container { position: relative; z-index: 2; display: flex; align-items: flex-start; gap: 1.15rem; }
.book-detail-cover-wrapper { position: relative; flex-shrink: 0; width: 110px; }
.book-detail-cover-img { width: 100%; aspect-ratio: 2/3; border-radius: 12px; object-fit: cover; box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.6); border: 2px solid rgba(255, 255, 255, 0.2); }
.book-age-badge { position: absolute; top: 0.4rem; left: 0.4rem; border-radius: 6px; background: #2563eb; color: white; padding: 0.2rem 0.4rem; font-size: 0.6rem; font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.book-detail-main-info { flex: 1; min-width: 0; color: white; padding-top: 0.15rem; }
.book-detail-category { display: inline-block; margin-bottom: 0.35rem; color: #93c5fd; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.book-detail-title { margin: 0 0 0.5rem; color: #fff; font-family: Georgia, serif; font-size: clamp(1.25rem, 3.5vw, 2.25rem); font-weight: 700; line-height: 1.2; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.book-detail-author-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.book-detail-rating-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.book-detail-body { padding: 1.5rem 1.25rem; }
.book-detail-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.book-read-button, .book-wishlist-button { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 44px; border-radius: 999px; padding: 0.65rem 1.5rem; font-size: 0.85rem; font-weight: 800; transition: all 0.2s ease; text-decoration: none; }
.book-read-button { background: #2563eb; color: #fff; box-shadow: 0 8px 20px -6px rgba(37, 99, 235, 0.5); }
.book-read-button:hover { background: #1d4ed8; transform: translateY(-1px); }
.book-wishlist-button { border: 1.5px solid #cbd5e1; background: #fff; color: #334155; cursor: pointer; }
.book-wishlist-button:hover { background: #f8fafc; border-color: #94a3b8; }
.book-detail-about h2 { margin-bottom: 0.5rem; color: #1e293b; font-family: Georgia, serif; font-size: 1.15rem; font-weight: 700; }
.book-detail-about p { color: #475569; font-size: 0.9rem; line-height: 1.7; }
.book-detail-meta, .book-detail-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.book-detail-meta span { border-radius: 999px; background: #f1f5f9; padding: 0.4rem 0.75rem; color: #475569; font-size: 0.72rem; font-weight: 700; }
.book-detail-tags span { color: #2563eb; font-size: 0.75rem; font-weight: 700; }
.book-review-layout { display: grid; gap: 1rem; margin-bottom: 2rem; }
.similar-stories-panel { border: 1px solid #e2e8f0; border-radius: 18px; background: #fff; padding: 1rem; }
.similar-stories-panel > div:first-child p { color: #2563eb; font-size: .62rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.similar-stories-panel > div:first-child h2 { margin: .2rem 0 1rem; color: #1e293b; font-family: Georgia, serif; font-size: 1.15rem; font-weight: 700; }
.similar-stories-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .65rem; }
.similar-story-card { display: grid; min-width: 0; gap: .35rem; color: #1e293b; text-decoration: none; }
.similar-story-card img { width: 100%; aspect-ratio: 2 / 3; border-radius: 8px; object-fit: cover; background: #f1f5f9; transition: transform .2s ease; }
.similar-story-card:hover img { transform: scale(1.03); }
.similar-story-card span { overflow: hidden; font-size: .66rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.similar-story-card small { overflow: hidden; color: #94a3b8; font-size: .55rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.similar-empty { color: #94a3b8; font-size: .75rem; }

@media (min-width: 640px) {
  .catalog-surface { padding: 1.7rem; }
  .dashboard-book-card { flex-basis: 126px; }
  .book-detail-hero { padding: 2.5rem 2rem; }
  .book-detail-hero-container { gap: 2rem; }
  .book-detail-cover-wrapper { width: 170px; }
  .book-detail-cover-img { border-radius: 16px; border-width: 3px; }
  .book-detail-body { padding: 2rem; }
}
@media (min-width: 1024px) { .dashboard-book-card { flex-basis: 136px; } .catalog-dashboard { max-width: 1120px; } .book-review-layout { grid-template-columns: minmax(0, 1fr) 265px; align-items: start; } .similar-stories-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .floating-bottom-nav { top: 50%; bottom: auto; left: 1.25rem; width: 68px; max-width: none; padding: 8px; flex-direction: column; transform: translateY(-50%); border-radius: 23px; } .nav-hover-light { top: 8px; left: 8px; } .floating-nav-item::before { bottom: auto; top: 50%; left: calc(100% + 16px); transform: translate(6px,-50%) scale(.96); } .floating-nav-item:hover::before, .floating-nav-item:focus-visible::before { transform: translate(0,-50%) scale(1); } }
@media (max-width: 480px) {
  .catalog-heading { align-items: start; flex-direction: column; }
  .book-detail-hero { padding: 1.25rem 1rem; }
  .book-detail-hero-container { gap: 1rem; }
  .book-detail-cover-wrapper { width: 96px; }
  .book-detail-body { padding: 1.25rem 1rem; }
  .book-detail-actions { flex-direction: column; }
  .book-read-button, .book-wishlist-button { width: 100%; }
}

/* MY LIBRARY & NOTION DASHBOARD (Matching Image 1 Reference) */
.library-card {
  background: #fcfbf9;
  border: 1px solid #e7e5e4;
  border-radius: 1.5rem;
  padding: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.tbr-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.tbr-table th {
  background: #f5f5f4;
  color: #78716c;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e7e5e4;
}

.tbr-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f5f5f4;
  font-size: 0.825rem;
}

.tbr-table tr:last-child td {
  border-bottom: none;
}

/* Google Login Button */
.btn-google-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.875rem;
  background-color: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #1e293b;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-google-login:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* ==========================================================================
   SUPER ADMIN PANEL PRO STYLING (Ultra-Refined Glassmorphism)
   ========================================================================== */
.admin-shell {
  background: radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 85% 85%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
              #070b14;
  min-height: 100vh;
}

.admin-glass-card {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 1.25rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-glass-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.admin-nav-label {
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  margin-top: 0.85rem;
  margin-bottom: 0.35rem;
  padding-left: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-nav-link {
  display: flex !important;
  align-items: center !important;
  gap: 0.625rem !important;
  padding: 0.55rem 0.75rem !important;
  border-radius: 0.75rem !important;
  font-weight: 600 !important;
  font-size: 0.785rem !important;
  color: #94a3b8 !important;
  text-decoration: none !important;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: 1px solid transparent !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}

.admin-nav-link:hover {
  background-color: rgba(30, 41, 59, 0.8) !important;
  color: #f8fafc !important;
  transform: translateX(2px);
}

.admin-nav-link.active {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-color: rgba(147, 197, 253, 0.3) !important;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
}

.admin-nav-link svg,
.admin-nav-link .nav-icon {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}

.admin-data-panel {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

.admin-panel-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 640px) {
  .admin-panel-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.admin-search-wrapper {
  position: relative;
  min-width: 240px;
}
.admin-search-wrapper svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: #64748b;
  pointer-events: none;
}
.admin-search {
  width: 100%;
  background: rgba(10, 15, 29, 0.8);
  border: 1px solid #334155;
  border-radius: 0.875rem;
  padding: 0.55rem 1rem 0.55rem 2.35rem;
  color: #f8fafc;
  font-size: 0.775rem;
  outline: none;
  transition: all 0.2s;
}
.admin-search:focus {
  border-color: #3b82f6;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.admin-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.685rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-status-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.admin-status-draft {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.admin-status-suspended {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.admin-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}
.admin-action-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.admin-action-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}
.admin-action-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.admin-action-danger:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

.admin-curation-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 1.25rem;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.admin-curation-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(99, 102, 241, 0.2);
}

.custom-admin-scrollbar::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.custom-admin-scrollbar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
}
.custom-admin-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(71, 85, 105, 0.6);
  border-radius: 9999px;
}
.custom-admin-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.8);
}

/* ==========================================================================
   USER PROFILE HEADER DROPDOWN (Zero-Flicker Hover Bridge & Click Lock)
   ========================================================================== */
.user-dropdown-container {
  position: relative;
  display: inline-block;
}

#user-dropdown-btn {
  position: relative;
  z-index: 50;
}

/* Invisible diagonal hover safety area */
.user-dropdown-container:hover::before {
  content: '';
  position: absolute;
  top: -10px;
  bottom: -280px;
  right: -10px;
  left: -180px;
  z-index: 45;
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 50;
}

/* Bridge gap between button and menu */
.user-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -15px;
  left: 0;
  right: 0;
  height: 20px;
  background: transparent;
}

/* Show on hover OR when click-toggled open */
.user-dropdown-container:hover .user-dropdown-menu,
.user-dropdown-container.is-open .user-dropdown-menu {
  display: block !important;
  animation: scaleUp 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.user-dropdown-container:hover #user-dropdown-chevron,
.user-dropdown-container.is-open #user-dropdown-chevron {
  transform: rotate(180deg);
}


