/* --- Design System & CSS Variables --- */
:root {
  --font-header: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Premium HSL Color Palette */
  --bg-color: #0b0f19;
  --bg-color-rgb: 11, 15, 25;
  --card-bg: rgba(17, 24, 39, 0.55);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-focus: rgba(250, 204, 21, 0.4);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #1f2937;

  --color-primary: #facc15; /* Highlighter Yellow */
  --color-primary-hover: #eab308;
  --color-primary-rgb: 250, 204, 21;

  --color-secondary: #6366f1; /* Indigo */
  --color-secondary-hover: #4f46e5;
  --color-secondary-rgb: 99, 102, 241;

  --color-success: #10b981; /* Emerald */
  --color-success-rgb: 16, 185, 129;

  --color-danger: #ef4444;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --glow-primary: 0 0 20px rgba(250, 204, 21, 0.25);
  --glow-secondary: 0 0 20px rgba(99, 102, 241, 0.25);

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Background Ambient Glows */
.bg-glow {
  position: fixed;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
}

.bg-glow-primary {
  top: -10vw;
  right: -10vw;
  background: radial-gradient(circle, rgba(var(--color-primary-rgb), 0.6) 0%, transparent 70%);
}

.bg-glow-secondary {
  bottom: -10vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(var(--color-secondary-rgb), 0.6) 0%, transparent 70%);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(250, 204, 21, 0.5);
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Header Section --- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logo-wrapper {
  display: flex;
  align-items: center;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.04em;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.logo-wrapper .highlight-word {
  color: #000000;
  position: relative;
  z-index: 2;
  padding: 0 6px;
  margin-right: 2px;
}

.logo-wrapper .highlight-word::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 3px;
  width: 100%;
  height: 65%;
  background: var(--color-primary);
  z-index: -1;
  transform-origin: left;
  transform: scaleX(0) skewX(-12deg);
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.45);
  animation: marker-draw 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.2s;
}

@keyframes marker-draw {
  to {
    transform: scaleX(1) skewX(-12deg);
  }
}

.logo-wrapper .marker-word {
  color: #ffffff;
  z-index: 2;
}

.header-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 500px;
  margin-left: 2rem;
  margin-right: auto;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  padding-left: 1.5rem;
}

/* --- Layout Grid --- */
.app-main {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2.5rem;
  padding: 2rem 0;
  flex-grow: 1;
}

.section-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0; /* Prevents flex children from stretching */
}

/* --- Glassmorphism UI Components --- */
.glass-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-card:focus-within {
  border-color: var(--card-border-focus);
}

/* --- Tab Header --- */
.tab-headers {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 0.5rem 0 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
}

.tab-header {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-header);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 0;
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.tab-header:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-header.active {
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.08);
}

.tab-header span {
  font-size: 1.2rem;
}

/* Highlight Auto-Extract Tab */
#tab-btn-triggers {
  color: var(--color-success);
  background: rgba(var(--color-success-rgb), 0.08);
  border: 1px dashed rgba(var(--color-success-rgb), 0.5);
  margin-left: 0.25rem;
}

#tab-btn-triggers:hover {
  background: rgba(var(--color-success-rgb), 0.15);
  border-style: solid;
}

#tab-btn-triggers.active {
  color: #fff;
  background: rgba(var(--color-success-rgb), 0.6);
  border: 1px solid var(--color-success);
  box-shadow: 0 0 20px rgba(var(--color-success-rgb), 0.4);
}

/* Tab panes */
.tab-contents {
  padding: 1.5rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tab-description {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* --- Input Fields --- */
.textarea-wrapper {
  position: relative;
  width: 100%;
}

textarea {
  width: 100%;
  height: 280px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-main);
  padding: 1.25rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  resize: none;
  outline: none;
  transition: all var(--transition-fast);
}

textarea:focus {
  border-color: var(--color-primary);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.1);
}

.clear-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
}

.textarea-wrapper:hover .clear-button,
textarea:focus + .clear-button {
  opacity: 1;
}

.clear-button:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.15);
}

/* URL Input */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
}

input[type="url"],
input[type="text"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-main);
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

input[type="url"]:focus,
input[type="text"]:focus {
  border-color: var(--color-primary);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.1);
}

/* --- Buttons --- */
.tab-actions {
  display: flex;
  gap: 0.75rem;
}

button {
  font-family: var(--font-header);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.primary-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, #eab308 100%);
  border: none;
  color: var(--text-dark);
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.primary-button:hover {
  background: linear-gradient(135deg, #fef08a 0%, var(--color-primary) 100%);
  box-shadow: var(--glow-primary);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.icon-button {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-button:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: rotate(15deg);
}

/* --- Quick Triggers Elements --- */
.trigger-groups {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.trigger-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trigger-box h3 {
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.trigger-box h3 span {
  color: var(--color-primary);
  font-size: 1.2rem;
}

.trigger-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.bookmarklet-btn,
.shortcut-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.75rem;
  border-radius: 8px;
  text-align: center;
  transition: all var(--transition-fast);
}

.bookmarklet-btn {
  background: rgba(var(--color-primary-rgb), 0.1);
  border: 1px dashed rgba(var(--color-primary-rgb), 0.4);
  color: var(--color-primary);
  cursor: grab;
}

.bookmarklet-btn:hover {
  background: rgba(var(--color-primary-rgb), 0.18);
  border-style: solid;
}

.shortcut-btn {
  background: rgba(var(--color-secondary-rgb), 0.1);
  border: 1px solid rgba(var(--color-secondary-rgb), 0.3);
  color: #a5b4fc;
}

.shortcut-btn:hover {
  background: rgba(var(--color-secondary-rgb), 0.2);
  color: #fff;
  box-shadow: var(--glow-secondary);
}

/* --- Extractor Console Logs Card --- */
.status-card {
  padding: 1.25rem;
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
}

.status-header h3 {
  font-family: var(--font-header);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.engine-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(250, 204, 21, 0.25);
  border-top-color: var(--color-primary);
  border-radius: 50%;
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-logs {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: #34d399; /* Green terminal font */
}

.log-entry {
  display: flex;
  gap: 0.5rem;
}

.log-time {
  color: #6b7280;
  user-select: none;
}

.log-text {
  word-break: break-all;
}

.log-error {
  color: var(--color-danger);
}

/* --- Results Section --- */
.results-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.results-header h2 {
  font-family: var(--font-header);
  font-size: 1.4rem;
  font-weight: 700;
}

.badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

/* Results Empty State */
.results-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  padding: 4rem 2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.empty-icon {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
}

.results-empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 320px;
}

/* Books Grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
}

.hidden {
  display: none !important;
}

/* --- Book Card Component --- */
.book-card {
  background: linear-gradient(135deg, rgba(25, 30, 45, 0.7) 0%, rgba(15, 18, 30, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}

.book-card:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--color-primary-rgb), 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(var(--color-primary-rgb), 0.05);
}

.book-cover-container {
  height: 180px;
  background: #111420;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.book-cover-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(20px) opacity(0.25);
  transform: scale(1.1);
}

.book-cover {
  width: 100px;
  height: 145px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
  z-index: 1;
  transition: transform var(--transition-normal);
}

.book-card:hover .book-cover {
  transform: scale(1.06) rotate(-2deg);
}

.book-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
  min-width: 0;
}

.book-title {
  font-family: var(--font-header);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  /* Truncate multi-line */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7rem;
}

.book-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  height: 3.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.25rem;
}

.book-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.book-price-box {
  display: flex;
  flex-direction: column;
}

.price-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.price-val {
  font-family: var(--font-header);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-success);
}

.price-val.free {
  color: var(--color-primary);
}

/* Card Action Links */
.book-card-actions {
  display: flex;
  flex-wrap: wrap;
  padding: 0.75rem 1.25rem 1.25rem 1.25rem;
  gap: 0.5rem;
}

.card-btn {
  flex: 1;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.65rem 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: all var(--transition-fast);
}

.card-btn-buy {
  background: var(--color-primary);
  color: var(--text-dark);
}

.card-btn-buy:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.15);
}

.card-btn-save {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.card-btn-save:hover {
  background: rgba(255, 255, 255, 0.12);
}

.card-btn-save.saved {
  background: rgba(var(--color-success-rgb), 0.15);
  border-color: rgba(var(--color-success-rgb), 0.4);
  color: var(--color-success);
}

/* Skeleton Loading Animation */
.skeleton-card {
  height: 380px;
}
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

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

/* --- Floating Drawer Button (Mobile) --- */
.floating-wishlist-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-secondary);
  border: none;
  color: #fff;
  display: none; /* Desktop hidden */
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
  z-index: 99;
}

.floating-wishlist-btn:hover {
  background: var(--color-secondary-hover);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
  transform: scale(1.05);
}

.count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-danger);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 2px solid var(--bg-color);
}

/* --- Wishlist Sidebar Drawer --- */
.wishlist-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100vh;
  background: rgba(10, 14, 23, 0.85);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
}

.wishlist-sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.sidebar-header h2 {
  font-family: var(--font-header);
  font-size: 1.3rem;
  font-weight: 700;
}

/* Stats Row */
.sidebar-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-family: var(--font-header);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-primary);
}

.stat-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Empty Shelf state */
.wishlist-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  text-align: center;
  gap: 0.75rem;
  padding: 2rem;
}

.empty-shelf-icon {
  font-size: 3.5rem;
  color: rgba(255, 255, 255, 0.05);
}

.wishlist-empty p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Shelf Items */
.wishlist-items {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Saved Item Card */
.wishlist-item {
  display: flex;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 0.65rem;
  position: relative;
  align-items: center;
  transition: all var(--transition-fast);
}

.wishlist-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.wishlist-item-cover {
  width: 45px;
  height: 65px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.wishlist-item-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.wishlist-item-title {
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.wishlist-item-author {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.wishlist-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wishlist-item-price {
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-success);
}

.wishlist-item-actions {
  display: flex;
  gap: 0.5rem;
}

.wishlist-item-btn {
  text-decoration: none;
  background: rgba(var(--color-primary-rgb), 0.12);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  color: var(--color-primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.wishlist-item-btn:hover {
  background: var(--color-primary);
  color: var(--text-dark);
}

.btn-remove-item {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.btn-remove-item:hover {
  color: var(--color-danger);
}

/* Sidebar Actions */
.sidebar-actions {
  display: flex;
  gap: 0.75rem;
  position: relative;
}

.action-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  padding: 0.8rem 0;
  border-radius: 10px;
  font-size: 0.88rem;
}

.share-btn {
  background: var(--color-secondary);
  color: #fff;
}

.share-btn:hover {
  background: var(--color-secondary-hover);
  box-shadow: var(--glow-secondary);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

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

.export-dropdown-wrapper {
  flex: 1;
  position: relative;
  display: flex;
}

.export-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #111524;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  z-index: 10;
}

.export-menu button {
  background: none;
  border: none;
  color: var(--text-muted);
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.export-menu button:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

/* --- Modals --- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

.modal-card {
  width: 480px;
  max-width: 90%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
  from { transform: scale(0.9) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-header h2 {
  font-family: var(--font-header);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.form-group label {
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.01);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-footer button {
  flex: none;
}

/* --- Toast Alerts --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #10b981;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-family: var(--font-header);
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast-error {
  background: var(--color-danger);
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
  .app-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-subtitle {
    display: none;
  }
  
  .floating-wishlist-btn {
    display: flex;
  }

  .wishlist-sidebar {
    width: 100%;
    z-index: 101;
  }

  .app-header {
    padding: 1rem 0;
  }
}

/* /* ==========================================
   LANDING PAGE STYLES (IDEO Premium Design)
   ========================================== */
.landing-page {
  --bg-dark: #070b13; /* Ultra-deep indigo black */
  --primary-neon: #ffe600; /* Signature highlighter yellow */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  background-color: var(--bg-dark) !important;
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
}

.landing-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

/* Background glows */
.bg-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  filter: blur(150px);
  opacity: 0.08;
}

.bg-glow-primary {
  background: var(--primary-neon);
  top: -150px;
  left: -150px;
}

.bg-glow-secondary {
  background: #6366f1; /* Indigo */
  bottom: -150px;
  right: -150px;
}

/* Header Navigation */
.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-header);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--primary-neon);
}

.nav-links .nav-cta-btn {
  background: var(--primary-neon);
  color: #000 !important;
  padding: 0.6rem 1.5rem;
  border-radius: 30px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(255, 230, 0, 0.25);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.nav-links .nav-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 230, 0, 0.4);
}

/* SVG Highlighter Logo and Streak Animation */
.logo-highlighter {
  cursor: pointer;
}

.highlight-stroke {
  stroke-dasharray: 250;
  stroke-dashoffset: 250;
  animation: draw-streak 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.4s;
}

@keyframes draw-streak {
  to {
    stroke-dashoffset: 0;
  }
}

/* Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 5rem;
  padding: 7rem 0 8rem 0;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-content h1 {
  font-family: var(--font-header);
  font-size: 3.8rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
  color: #ffffff;
}

.text-neon {
  color: var(--primary-neon);
  text-shadow: 0 0 20px rgba(255, 230, 0, 0.15);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1.65;
  margin-bottom: 3rem;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.hero-primary-btn {
  background: var(--primary-neon);
  color: #000 !important;
  text-decoration: none;
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.9rem 2rem;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 25px rgba(255, 230, 0, 0.3);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.hero-primary-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(255, 230, 0, 0.45);
}

.hero-secondary-btn {
  color: #ffffff;
  text-decoration: none;
  font-family: var(--font-header);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.9rem 2rem;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hero-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Premium Glassmorphic Auth Card */
.hero-auth-card {
  perspective: 1000px;
}

.auth-card {
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  padding: 3rem 2.25rem;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255,255,255,0.1);
  transform: rotateY(-5deg) rotateX(5deg);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card:hover {
  transform: rotateY(0deg) rotateX(0deg);
}

.auth-card h3 {
  font-family: var(--font-header);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
}

.auth-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}

.auth-buttons {
  margin-top: 0.75rem;
}

.google-auth-btn {
  width: 100%;
  background: #ffffff;
  color: #0f172a !important;
  border: none;
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 0.85rem 1.5rem;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.google-auth-btn:hover {
  background: #f9fafb;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.lock-icon {
  font-size: 1rem;
  color: var(--color-success);
}

/* Key Capabilities Features Grid */
.features-section {
  padding: 8rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.section-title-wrapper {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 5.5rem auto;
}

.section-title-wrapper .badge {
  background: rgba(255, 230, 0, 0.08);
  border: 1px solid rgba(255, 230, 0, 0.2);
  color: var(--primary-neon);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.section-title-wrapper h2 {
  font-family: var(--font-header);
  font-size: 2.5rem;
  font-weight: 800;
  margin: 1.25rem 0 1rem 0;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.section-title-wrapper p {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 2rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 3rem 2.5rem;
  border-radius: 20px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}

.feature-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 230, 0, 0.3);
  box-shadow: 0 15px 40px rgba(255, 230, 0, 0.06);
  background: rgba(255, 255, 255, 0.025);
}

.feature-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 230, 0, 0.06);
  border: 1px solid rgba(255, 230, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.feature-icon {
  color: var(--primary-neon);
  font-size: 1.65rem;
}

.feature-card h3 {
  font-family: var(--font-header);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: #ffffff;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
}

/* Landing Footer */
.landing-footer {
  text-align: center;
  padding: 4rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Responsive Landing Details */
@media (max-width: 992px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: 4rem;
    padding: 5rem 0;
    text-align: center;
  }
  
  .hero-content {
    align-items: center;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .hero-auth-card {
    max-width: 450px;
    margin: 0 auto;
  }
  
  .auth-card {
    transform: none;
  }
  
  .auth-card:hover {
    transform: none;
  }

  .hero-content h1 {
    font-size: 3rem;
  }
}

@media (max-width: 900px) {
  .dashboard-grid, .app-main {
    display: flex !important;
    flex-direction: column !important;
  }
  .results-container {
    order: 1 !important;
  }
  .dashboard-sidebar {
    order: 2 !important;
  }
}

@media (max-width: 576px) {
  .landing-container, .app-container {
    padding: 0 1.25rem;
  }
  
  .hero-content h1 {
    font-size: 2.4rem;
  }
  
  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 1rem;
  }

  .hero-primary-btn, .hero-secondary-btn {
    width: 100%;
    justify-content: center;
  }

  .landing-header {
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem 0;
  }
  
  .section-title-wrapper h2 {
    font-size: 1.8rem;
  }

  /* Extractor & Dashboard Mobile Fixes */
  .btn-text {
    display: none !important;
  }
  .user-name-text {
    display: none !important;
  }
  #user-name-span {
    display: none !important;
  }
  .nav-link-btn, 
  #user-profile-header a {
    padding: 0 !important;
    width: 36px !important;
    height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    flex: none !important;
  }
  .app-header {
    padding: 0.75rem 0 !important;
    gap: 0.5rem !important;
  }
  .header-actions {
    gap: 8px !important;
  }
  .tab-header {
    font-size: 0.78rem !important;
    gap: 0.25rem !important;
    padding: 0.6rem 0.25rem !important;
  }
  .filter-sort-panel > div {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }
  .filter-sort-panel > div > div {
    width: 100% !important;
    margin-left: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  .library-items-grid {
    grid-template-columns: 1fr !important;
  }
  
  .book-card-actions,
  .tab-actions {
    flex-direction: column !important;
  }
}

/* Dashboard Select Picker Styling */
.dashboard-select {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 2rem 0.4rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  transition: all var(--transition-fast);
}

.dashboard-select:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.dashboard-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.2);
}

.dashboard-select option {
  background-color: #0f131a;
  color: var(--text-main);
  padding: 0.5rem;
}

/* Animation helper for pending books */
.animate-pulse {
  animation: pulse-effect 1.8s ease-in-out infinite;
}

@keyframes pulse-effect {
  0%, 100% {
    opacity: 0.35;
    transform: scale(0.95);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.05);
  }
}


