/* BookCircl - Instagram-inspired colors */

:root {
  --gradient-start: #833AB4;
  --gradient-middle: #C13584;
  --gradient-end: #F77737;
  --gradient-yellow: #FCAF45;

  --bg-color: #FAFAFA;
  --text-primary: #262626;
  --text-secondary: #8E8E8E;
  --white: #FFFFFF;
  --border-color: #DBDBDB;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  min-width: 375px;
  overflow-x: hidden;
}

/* Navigation */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-brand {
  font-size: 1.75rem;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(135deg, #9B30FF 0%, #E040FB 25%, #FF6B6B 50%, #FF8C42 75%, #FFA726 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-color);
}

.nav-link.active {
  color: var(--gradient-middle);
}

.nav-link-button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.nav-icon {
  width: 24px;
  height: 24px;
}

.nav-label {
  font-size: 0.75rem;
  font-weight: 500;
}

.nav-brand-mobile {
  display: none;
}

/* Profile dropdown - hidden on mobile */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
}

.nav-chevron {
  width: 16px;
  height: 16px;
  margin-left: 0.25rem;
  transition: transform 0.2s;
}

.nav-dropdown:hover .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  padding: 0.5rem 0;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.nav-dropdown-item:hover {
  background: var(--bg-color);
}

.nav-dropdown-item-button {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.nav-dropdown-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
}

.nav-profile-mobile {
  display: none;
}

.nav-link-add-book {
  display: flex;
}

.tab.tab-add-book,
.tab.tab-add-book:hover {
  display: none;
  color: var(--white);
}

/* Main content area */
.main-content {
  padding-bottom: 0;
}

/* Mobile: Bottom navigation */
@media (max-width: 768px) {
  .nav {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    border-bottom: none;
    border-top: 1px solid var(--border-color);
  }

  .nav-container {
    padding: 0;
    height: 56px;
    justify-content: center;
  }

  .nav-brand {
    display: none;
  }

  .nav-brand-mobile {
    display: flex;
  }

  .nav-links {
    width: 100%;
    justify-content: space-around;
    gap: 0;
  }

  .nav-link {
    padding: 0.5rem;
    flex: 1;
    border-radius: 0;
  }

  .nav-link:hover {
    color: var(--text-secondary);
    background: none;
  }

  .nav-link.active:hover {
    color: var(--gradient-middle);
  }

  .nav-label {
    font-size: 0.65rem;
  }

  .nav-dropdown {
    display: none;
  }

  .nav-profile-mobile {
    display: flex;
  }

  .nav-link-add-book {
    display: none;
  }

  .tabs {
    align-items: center;
  }

  .tab.tab-add-book,
  .tab.tab-add-book:hover {
    display: inline-block;
    margin-left: auto;
    padding: 0.5rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    color: var(--white);
    background: linear-gradient(135deg, #9B30FF 0%, #E040FB 25%, #FF6B6B 50%, #FF8C42 75%, #FFA726 100%);
    border: none;
    border-bottom: none;
    border-radius: 6px;
    text-decoration: none;
  }


  .main-content {
    padding-bottom: 70px;
  }
}

/* Desktop: Horizontal labels */
@media (min-width: 769px) {
  .nav-link {
    flex-direction: row;
    gap: 0.5rem;
  }

  .nav-label {
    font-size: 0.875rem;
  }
}

/* Hero Section */
.hero {
  background: linear-gradient(45deg, var(--gradient-start), var(--gradient-middle), var(--gradient-end), var(--gradient-yellow));
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.hero-content {
  max-width: 500px;
}

.logo {
  font-size: 3.5rem;
  font-weight: 300;
  color: var(--white);
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tagline {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: var(--white);
  color: var(--text-primary);
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* User Info */
.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--white);
}

.user-name {
  color: var(--white);
  font-weight: 600;
  font-size: 1.1rem;
}

/* Flash Messages */
.flash {
  padding: 1rem 2rem;
  text-align: center;
}

.flash-notice {
  background: #d4edda;
  color: #155724;
}

.flash-alert {
  background: #f8d7da;
  color: #721c24;
}

/* Features Section */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 4rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.feature {
  background: var(--white);
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s;
}

.feature:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.feature p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  border-top: 1px solid var(--border-color);
}

.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  border-top: 1px solid var(--border-color);
  background: var(--white);
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-color);
  transition: color 0.2s, text-decoration-color 0.2s;
}

.site-footer a:hover {
  color: var(--text-primary);
  text-decoration-color: var(--text-primary);
}

@media (max-width: 768px) {
  .site-footer {
    display: none;
  }
}

/* Privacy Policy Page */
.privacy-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.privacy-page h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.privacy-updated {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.privacy-page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.privacy-page h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

.privacy-page p {
  margin-bottom: 0.75rem;
}

.privacy-page ul {
  margin: 0 0 0.75rem 1.25rem;
  padding: 0;
}

.privacy-page li {
  margin-bottom: 0.35rem;
}

.privacy-page hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

.privacy-page a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-color);
  transition: text-decoration-color 0.2s;
}

.privacy-page a:hover {
  text-decoration-color: var(--text-primary);
}

/* Page Header with Tabs */
.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
}

.tabs {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  gap: 2rem;
}

.tab {
  padding: 1rem 0;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--gradient-middle);
}


/* Hero description */
.hero-description {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Feature icon SVG styling */
.feature-icon svg {
  stroke: var(--gradient-middle);
}

/* Landing Page */
.landing {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* Hero */
.landing-hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.landing-hero-illustration {
  margin: 0 auto 1.5rem;
  max-width: 140px;
}

.landing-hero-illustration img {
  width: 100%;
  height: auto;
}

.landing-hero h1 {
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #9B30FF 0%, #E040FB 25%, #FF6B6B 50%, #FF8C42 75%, #FFA726 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-hero-sub {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Sections */
.landing-section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-color);
}

.landing-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.landing-section p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.landing-section p:last-of-type {
  margin-bottom: 1.5rem;
}

/* How It Works Steps */
.landing-steps-list {
  margin-top: 0.75rem;
  padding-left: 1.25rem;
  list-style: decimal;
}

.landing-steps-list li {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.landing-steps-list li strong {
  color: var(--text-primary);
}

/* Founder Note */
.landing-section--note {
  background: var(--bg-color);
  border-radius: 12px;
  padding: 2rem;
  border: none;
  margin-top: -1px;
}

.landing-signature {
  color: var(--text-primary);
  font-weight: 500;
}

.landing-signature-linkedin {
  color: var(--text-secondary);
  margin-left: 0.25rem;
  vertical-align: middle;
  transition: color 0.2s;
}

.landing-signature-linkedin:hover {
  color: #0a66c2;
}

.landing-signature-linkedin svg {
  vertical-align: -2px;
}

/* FAQ */
.landing-faq {
  margin-top: 0.5rem;
}

.landing-faq-item {
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.landing-faq-item:last-child {
  border-bottom: none;
}

.landing-faq-item summary {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.landing-faq-item summary::-webkit-details-marker {
  display: none;
}

.landing-faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: 1rem;
}

.landing-faq-item[open] summary::after {
  content: "\2212";
}

.landing-faq-item p {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Footer CTA */
.landing-footer-cta {
  text-align: center;
  padding: 3rem 0 0;
  border-top: 1px solid var(--border-color);
}

.landing-footer-cta h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.landing-footer-cta p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* CTA Buttons */
.btn-cta {
  display: inline-block;
  padding: 0.875rem 2rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, #9B30FF 0%, #E040FB 25%, #FF6B6B 50%, #FF8C42 75%, #FFA726 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-cta:hover {
  opacity: 0.85;
}

.btn-cta-secondary {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: transparent;
  background: linear-gradient(135deg, #9B30FF 0%, #E040FB 25%, #FF6B6B 50%, #FF8C42 75%, #FFA726 100%);
  -webkit-background-clip: text;
  background-clip: text;
  border: 1px solid #E040FB;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-cta-secondary:hover {
  opacity: 0.75;
}

@media (max-width: 768px) {
  .landing {
    padding: 0 1rem 3rem;
  }

  .landing-hero {
    padding: 2rem 0;
  }

  .landing-hero-illustration {
    max-width: 112px;
  }

  .landing-hero h1 {
    font-size: 2rem;
  }

  .landing-hero-sub {
    font-size: 1.05rem;
  }


  .landing-section--note {
    padding: 1.5rem;
  }
}

/* Page Styles */
.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  padding: 1.5rem 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

.books-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* Books Grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 1rem 0;
}

@media (max-width: 768px) {
  .books-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
  }
}

/* Book Card */
.book-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s;
}

.book-card:has(.book-status-dropdown.is-open) {
  overflow: visible;
}

.book-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.book-card--hidden {
  opacity: 0.6;
}

.book-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.book-cover {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--bg-color);
}

.book-cover-inner {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

@media (max-width: 768px) {
  .book-cover {
    aspect-ratio: 16/9;
  }
}

.book-cover img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s;
}

.book-cover img.loaded {
  opacity: 1;
}

.book-card-add {
  text-decoration: none;
  color: inherit;
  border-style: dashed;
}

.book-card-add-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.book-card-add-cover svg {
  width: 28px;
  height: 28px;
}

.add-book-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9B30FF 0%, #E040FB 25%, #FF6B6B 50%, #FF8C42 75%, #FFA726 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  transition: opacity 0.2s;
}

.book-card-add:hover .add-book-circle {
  opacity: 0.85;
}

.book-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.book-cover-placeholder svg {
  width: 48px;
  height: 48px;
}

.book-cover-placeholder--large svg {
  width: 80px;
  height: 80px;
}

.book-cover-skeleton {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--bg-color) 40%, #f0f0f0 50%, var(--bg-color) 60%);
  background-size: 300% 100%;
  animation: shimmer 2.5s ease-in-out infinite;
  opacity: 0.6;
}

.book-cover-skeleton.load-failed {
  animation: none;
  background: var(--bg-color);
  opacity: 1;
}

.book-cover-skeleton.load-failed::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%238E8E8E' stroke-width='1' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'%3E%3C/path%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'%3E%3C/path%3E%3C/svg%3E");
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.book-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 4px;
  color: var(--white);
}

.book-badge--to_swap {
  background: var(--gradient-middle);
}

.book-badge--to_give_away {
  background: #22c55e;
}

.book-badge--to_lend {
  background: #3b82f6;
}

.book-badge--large {
  position: static;
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  display: inline-block;
  margin-bottom: 1rem;
}

/* Status Dropdown */
.book-status-dropdown {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 20;
}

.book-status-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.4rem 0.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 4px;
  color: var(--white);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.book-status-btn:hover {
  opacity: 0.9;
}

.book-status-btn--to_swap {
  background: var(--gradient-middle);
}

.book-status-btn--to_give_away {
  background: #22c55e;
}

.book-status-btn--to_lend {
  background: #3b82f6;
}

.book-status-btn--hidden {
  background: var(--text-secondary);
}

.book-status-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.book-status-dropdown.is-open .book-status-chevron {
  transform: rotate(180deg);
}

.book-status-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100px;
  background: var(--white);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.book-status-dropdown.is-open .book-status-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.book-status-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.book-status-option:first-child {
  border-radius: 6px 6px 0 0;
}

.book-status-option:last-child {
  border-radius: 0 0 6px 6px;
}

.book-status-option:hover {
  background: var(--bg-color);
}

.book-status-option.is-active {
  color: var(--gradient-middle);
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot--to_swap {
  background: var(--gradient-middle);
}

.status-dot--to_give_away {
  background: #22c55e;
}

.status-dot--to_lend {
  background: #3b82f6;
}

.status-dot--hidden {
  background: var(--text-secondary);
}

.book-status-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.25rem 0;
}

.book-status-option--danger {
  color: #ef4444;
}

.book-status-option--danger:hover {
  background: #fef2f2;
}

.status-icon {
  width: 14px;
  height: 14px;
}

.book-favorite-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  z-index: 10;
}

.book-favorite-btn:hover {
  background: var(--white);
  transform: scale(1.1);
}

.book-favorite-btn .heart-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  transition: fill 0.2s, stroke 0.2s;
}

.book-favorite-btn.is-favorited .heart-icon {
  fill: #ef4444;
  stroke: #ef4444;
}

.book-favorite-btn:hover .heart-icon {
  stroke: #ef4444;
}

.book-info {
  padding: 0.75rem;
}

.book-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-title a {
  text-decoration: none;
  color: inherit;
}

.book-title a:hover {
  text-decoration: underline;
}

.book-author {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.book-owner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.book-owner-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.book-owner-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.book-message-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-middle);
  color: var(--white);
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.book-message-btn:hover {
  opacity: 0.85;
}

.book-message-btn svg {
  width: 16px;
  height: 16px;
}

/* My Books Action Buttons */
.book-card-actions {
  justify-content: center;
  gap: 0.5rem;
}

.book-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--white);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.book-action-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.book-action-btn svg {
  width: 16px;
  height: 16px;
}

.book-action-btn--danger:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* Book Detail Page */
.book-detail {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.book-detail-cover {
  aspect-ratio: 2/3;
  background: var(--bg-color);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.book-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-detail-info {
  padding-top: 0.5rem;
}

.book-detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.book-detail-author {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.book-detail-owner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-color);
  border-radius: 8px;
}

.book-detail-owner-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.book-detail-owner-info {
  display: flex;
  flex-direction: column;
}

.book-detail-owner-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.book-detail-owner-name {
  font-weight: 600;
}

.book-detail-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.book-detail-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.book-detail-back {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .book-detail {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .book-detail-cover {
    max-width: 200px;
    margin: 0 auto;
  }

  .book-detail-info {
    text-align: center;
  }

  .book-detail-owner {
    justify-content: center;
  }

  .book-detail-actions {
    justify-content: center;
  }
}

/* My Books List */
.books-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.books-list .book-card {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
}

.books-list .book-cover {
  width: 80px;
  height: 120px;
  border-radius: 6px;
}

.books-list .book-info {
  padding: 0;
}

.book-status {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 4px;
  margin-top: 0.5rem;
  text-transform: capitalize;
}

.book-status--to_swap {
  background: #f3e8ff;
  color: #9333ea;
}

.book-status--to_give_away {
  background: #dcfce7;
  color: #16a34a;
}

.book-status--hidden {
  background: #f3f4f6;
  color: #6b7280;
}

.book-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--white);
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-small:hover {
  background: var(--bg-color);
}

.btn-small--danger {
  color: #dc2626;
  border-color: #fecaca;
}

.btn-small--danger:hover {
  background: #fef2f2;
}

@media (max-width: 768px) {
  .books-list .book-card {
    grid-template-columns: 60px 1fr;
    gap: 0.75rem;
  }

  .books-list .book-cover {
    width: 60px;
    height: 90px;
  }

  .book-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin-top: 0.5rem;
  }
}

/* Form Styles */
.form-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.location-confirmation {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-color);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.location-confirmation svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.location-confirmation strong {
  color: var(--text-primary);
}

.location-confirmation small {
  margin-left: auto;
}

.location-confirmation small a {
  color: var(--text-secondary);
  text-decoration: underline;
}

.book-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  font-size: 0.9rem;
}

.form-input,
.form-select {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--white);
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--gradient-middle);
}

.form-actions {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
}

.form-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 1rem;
  color: #dc2626;
}

.form-errors h2 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-errors ul {
  padding-left: 1.25rem;
  font-size: 0.875rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Book Search */
.book-search-container {
  position: relative;
}

.book-search-container .form-input {
  width: 100%;
}

.book-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 4px;
}

.book-search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-color);
}

.book-search-item:last-child {
  border-bottom: none;
}

.book-search-item:hover,
.book-search-item--active {
  background: var(--bg-secondary);
}

.book-search-item-cover {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.book-search-item-cover--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.book-search-item-cover--placeholder svg {
  width: 20px;
  height: 20px;
}

.book-search-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.book-search-item-title {
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-search-item-author {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-search-loading,
.book-search-empty,
.book-search-error {
  padding: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.book-search-error {
  color: #dc2626;
}

.book-search-manual {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
  border-top: 1px solid var(--border-color);
  color: var(--gradient-middle);
  font-weight: 500;
  font-size: 0.9rem;
}

.book-search-manual:hover,
.book-search-manual.book-search-item--active {
  background: var(--bg-color);
}

.book-search-manual svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Book Preview (selected book) */
.book-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.book-preview-cover {
  flex-shrink: 0;
}

.book-preview-cover img {
  width: 50px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
}

.book-preview-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.book-preview-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-preview-author {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.book-preview-clear {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--white);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.book-preview-clear:hover {
  background: var(--border-color);
}

.book-preview-clear svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.book-preview-placeholder {
  width: 50px;
  height: 70px;
  background: var(--bg-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.book-preview-placeholder svg {
  width: 24px;
  height: 24px;
}

/* Manual Entry Form */
.manual-entry {
  background: var(--bg-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.manual-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.manual-entry-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.manual-entry-cancel {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--white);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.manual-entry-cancel:hover {
  background: var(--border-color);
}

.manual-entry-cancel svg {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
}

.manual-entry-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.manual-entry .form-group {
  margin-bottom: 1rem;
}

.manual-entry .form-group:last-of-type {
  margin-bottom: 1.25rem;
}

.manual-entry .btn-secondary {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.manual-entry .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Empty State */
/* Profile Page */
.profile {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.profile-header {
  display: flex;
  gap: 2rem;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
  flex-shrink: 0;
}

.profile-avatar img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.profile-avatar-placeholder svg {
  width: 48px;
  height: 48px;
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.profile-joined {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.profile-location {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.profile-location-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.profile-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.profile-stat {
  display: flex;
  flex-direction: column;
}

.profile-stat-value {
  font-size: 1.25rem;
  font-weight: 600;
}

.profile-stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.profile-report-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.profile-report-btn svg {
  width: 16px;
  height: 16px;
}

.profile-report-btn:hover {
  color: var(--text-primary);
}

/* Follow Button */
.follow-dropdown {
  position: relative;
}

.follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.follow-btn--follow {
  background: linear-gradient(135deg, #9B30FF 0%, #E040FB 50%, #FF6B6B 100%);
  color: var(--white);
}

.follow-btn--follow:hover {
  opacity: 0.85;
}

.follow-btn--following {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.follow-btn--following:hover {
  background: var(--bg-tertiary);
}

.follow-btn-icon,
.follow-btn-chevron {
  width: 18px;
  height: 18px;
}

.follow-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 140px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  overflow: hidden;
}

.follow-dropdown.is-open .follow-dropdown-menu {
  display: block;
}

.follow-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #fff;
  border: none;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}

.follow-dropdown-item:hover {
  background: var(--bg-secondary);
}

.follow-dropdown-item--unfollow {
  color: #e74c3c;
}

.follow-dropdown-item--unfollow:hover {
  background: #fff;
}

.follow-dropdown-item svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, #9B30FF 0%, #E040FB 50%, #FF6B6B 100%);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.85;
}

.profile-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.profile-books {
  margin-top: 2rem;
}

/* Settings button - mobile only */
.profile-actions--own {
  display: none;
}

.btn-settings {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-settings:hover {
  background: var(--bg-tertiary);
}

.btn-settings svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .profile {
    padding: 1rem;
  }

  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  .profile-avatar img,
  .profile-avatar-placeholder {
    width: 100px;
    height: 100px;
  }

  .profile-location {
    justify-content: center;
  }

  .profile-stats {
    justify-content: center;
  }

  .profile-actions {
    justify-content: center;
  }

  .profile-actions--own {
    display: flex;
  }
}

/* Settings Page */
.settings-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.settings-section {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  margin-top: 1.5rem;
}

.settings-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.settings-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.location-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.location-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.location-indicator svg {
  width: 20px;
  height: 20px;
}

.location-indicator--set {
  color: #22c55e;
}

.location-indicator--not-set {
  color: var(--text-secondary);
}

.location-error {
  color: #ef4444;
  font-size: 0.875rem;
  padding: 0.75rem;
  background: #fef2f2;
  border-radius: 6px;
  margin-top: 1rem;
}

.city-fallback {
  margin-top: 1rem;
}

.city-fallback .settings-description {
  margin-bottom: 0.5rem;
}

.city-fallback-form {
  display: flex;
  gap: 0.5rem;
}

.city-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}

.city-input-wrapper .form-input {
  width: 100%;
}

.city-fallback-form .btn {
  flex-shrink: 0;
}

.city-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
}

.city-suggestions li {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--bg-color);
}

.city-suggestions li:last-child {
  border-bottom: none;
}

.city-suggestions li:hover,
.city-suggestions li.active {
  background: #f0f7ff;
  color: #1d4ed8;
}

@media (max-width: 768px) {
  .city-suggestions {
    top: auto;
    bottom: 100%;
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
  }
}

.city-suggestions-loading {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-style: italic;
  cursor: default;
}

/* Settings Toggle */
.settings-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.settings-toggle input {
  display: none;
}

.settings-toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 12px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.settings-toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.2s;
}

.settings-toggle input:checked + .settings-toggle-slider {
  background: var(--gradient-middle);
}

.settings-toggle input:checked + .settings-toggle-slider::after {
  transform: translateX(20px);
}

.settings-toggle-label {
  font-size: 0.95rem;
  color: var(--text-primary);
}

@media (max-width: 480px) {
  .location-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Location Prompt (Add Book page) */
.location-prompt {
  max-width: 400px;
  margin: 3rem auto;
  text-align: center;
  padding: 2rem;
}

.location-prompt-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  color: var(--gradient-middle);
}

.location-prompt-icon svg {
  width: 100%;
  height: 100%;
}

.location-prompt-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.location-prompt-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

/* Spin animation for loading */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  width: 100%;
  max-width: 100%;
}

.empty-state p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

/* Infinite Scroll */
.scroll-trigger {
  height: 1px;
  width: 100%;
  grid-column: 1 / -1;
}

.loading-indicator {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Admin Interface */
.admin-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.admin-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.admin-search .form-input {
  flex: 1;
  max-width: 300px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  background: var(--bg-color);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.admin-table td {
  font-size: 0.9rem;
}

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

.admin-row--banned {
  background: #fef2f2;
}

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.admin-book-cover {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 3px;
}

.admin-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
}

.admin-badge--active {
  background: #dcfce7;
  color: #16a34a;
}

.admin-badge--banned {
  background: #fecaca;
  color: #dc2626;
}

.admin-self {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .admin-table {
    display: block;
    overflow-x: auto;
  }
}

/* Admin Stats */
.admin-stats {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stat {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 100px;
}

.admin-stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.admin-stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.admin-stat--active {
  border-color: #22c55e;
}

.admin-stat--active .admin-stat-value {
  color: #16a34a;
}

.admin-stat--banned {
  border-color: #fecaca;
}

.admin-stat--banned .admin-stat-value {
  color: #dc2626;
}

/* Admin Pagination */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem 0;
}

.admin-pagination-link {
  padding: 0.5rem 1rem;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
}

.admin-pagination-link:hover {
  background: var(--bg-color);
  border-color: var(--text-secondary);
}

.admin-pagination-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .admin-stats {
    flex-wrap: wrap;
  }

  .admin-stat {
    flex: 1;
    min-width: 80px;
    padding: 0.75rem 1rem;
  }

  .admin-stat-value {
    font-size: 1.5rem;
  }
}

.admin-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.admin-section-title:first-child {
  margin-top: 0;
}

.admin-nav {
  margin-top: 2rem;
}

.admin-back-link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.admin-back-link:hover {
  color: var(--text-primary);
}

/* Danger Button */
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: #dc2626;
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger:hover {
  background: #b91c1c;
}

/* Settings Danger Section */
.settings-section--danger {
  border-color: var(--border-color);
  background: var(--bg-color);
}

.settings-section--danger .settings-section-title {
  color: var(--text-secondary);
  font-size: 1rem;
}

.settings-section--danger .btn-danger {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-size: 0.95rem;
  padding: 0.6rem 1.2rem;
}

.settings-section--danger .btn-danger:hover {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* Settings Mobile Section */
.settings-mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .settings-mobile-only {
    display: block;
    text-align: center;
  }
}

.settings-signout-btn {
  width: 100%;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
}

.settings-signout-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.settings-legal-links {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.settings-legal-links a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-color);
}

.settings-legal-links a:hover {
  color: var(--text-primary);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.modal-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.modal-actions .btn {
  padding: 0.625rem 1.25rem;
}


/* ==================== */
/* Nav Badge            */
/* ==================== */

.nav-badge {
  background: var(--gradient-middle);
  color: var(--white);
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  position: absolute;
  top: 2px;
  right: 2px;
}

/* ==================== */
/* Chats (Inbox)        */
/* ==================== */

.chats-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.chats-list {
  display: flex;
  flex-direction: column;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

.chat-item:hover {
  background: var(--bg-color);
}

.chat-item--unread {
  background: #faf5ff;
}

.chat-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chat-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.chat-avatar-placeholder svg {
  width: 24px;
  height: 24px;
}

.chat-content {
  flex: 1;
  min-width: 0;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.chat-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.chat-item--unread .chat-name {
  color: var(--gradient-middle);
}

.chat-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.chat-preview {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item--unread .chat-preview {
  color: var(--text-primary);
  font-weight: 500;
}

.chat-badge {
  background: var(--gradient-middle);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  flex-shrink: 0;
}

/* ======================== */
/* Chat Page (Show)         */
/* ======================== */

.chat-page {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 60px);
}

.chat-top-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.chat-back {
  display: flex;
  align-items: center;
  color: var(--text-primary);
  text-decoration: none;
}

.chat-back svg {
  width: 24px;
  height: 24px;
}

.chat-top-user-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.chat-top-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.chat-top-user-deleted {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Messages */
.messages-list {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
}

.message {
  display: flex;
  max-width: 75%;
}

.message--sent {
  align-self: flex-end;
}

.message--received {
  align-self: flex-start;
}

.message-bubble {
  padding: 0.625rem 0.875rem;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.message--sent .message-bubble {
  background: #f0f0f0;
  color: var(--text-primary);
  border-bottom-right-radius: 4px;
}

.message--received .message-bubble {
  background: #e3f2fd;
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.message-body {
  margin: 0;
}

.message-time {
  display: block;
  font-size: 0.65rem;
  margin-top: 0.25rem;
  opacity: 0.7;
}

.message--received .message-time {
  color: var(--text-secondary);
}

/* Message Input */
.message-form-container {
  padding: 0.75rem 1rem;
  background: var(--white);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.message-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.message-input {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 1rem;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
}

.message-input:focus {
  outline: none;
  border-color: var(--gradient-middle);
}

.message-send-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--gradient-middle);
  color: var(--white);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.message-send-btn:hover {
  opacity: 0.85;
}

.message-send-btn svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .chat-page {
    height: calc(100dvh - 56px);
  }

  .message-form-container {
    padding-bottom: calc(0.75rem + 56px);
  }
}


