/* ===== MODERN UI & DESIGN SYSTEM UPGRADE ===== */

/* Import Professional Fonts - Inter Primary, Poppins Secondary */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600&display=swap');

/* CSS Variables for Unified Design System */
:root {
  /* Unified Color Palette - Professional & Consistent */
  --color-primary: #3B82F6;           /* Blue - Primary actions */
  --color-primary-light: #DBEAFE;     /* Light blue background */
  --color-primary-dark: #2563EB;      /* Dark blue hover */

  --color-success: #10B981;           /* Green - Success actions */
  --color-success-light: #D1FAE5;     /* Light green background */
  --color-success-dark: #059669;      /* Dark green hover */

  --color-warning: #F59E0B;           /* Amber - Warning actions */
  --color-warning-light: #FEF3C7;     /* Light amber background */
  --color-warning-dark: #D97706;      /* Dark amber hover */

  --color-error: #EF4444;             /* Red - Error/danger actions */
  --color-error-light: #FEE2E2;       /* Light red background */
  --color-error-dark: #DC2626;        /* Dark red hover */

  --color-accent: #10B981;            /* Accent color (same as success) */
  --color-border: #D4D6DA;            /* Default border color */
  --color-background: #F0F0F0;        /* Default background */
}

/* ===== ENHANCED THEME FONT COLOR COMPATIBILITY SYSTEM ===== */

/* Light Theme - Professional Interface Design */
:root[data-theme="light"] {
  /* Background Colors - Clean & Professional */
  --color-bg-primary: #FFFFFF;
  --color-bg-secondary: #F8FAFC;
  --color-bg-dark: #F1F5F9;
  --color-surface: #FFFFFF;
  --color-background: #F8FAFC;

  /* Text Color Hierarchy - Professional & Readable */
  --color-text-primary: #1E293B;        /* Dark slate for primary text */
  --color-text-secondary: #475569;      /* Medium slate for secondary text */
  --color-text-tertiary: #64748B;       /* Light slate for tertiary text */
  --color-text-muted: #94A3B8;          /* Very light slate for muted text */
  --color-text-disabled: #CBD5E1;       /* Disabled text */

  /* Legacy support */
  --color-text: #1E293B;
  --color-subtle: #64748B;

  /* UI Component Text Colors */
  --color-text-input: #1E293B;          /* Input field text */
  --color-text-input-placeholder: #94A3B8; /* Placeholder text */
  --color-text-button: #FFFFFF;         /* Button text on colored backgrounds */
  --color-text-button-secondary: #475569; /* Secondary button text */
  --color-text-tab: #475569;            /* Tab navigation text */
  --color-text-tab-active: #3B82F6;     /* Active tab text */
  --color-text-table: #1E293B;          /* Table content text */
  --color-text-table-header: #64748B;   /* Table header text - more subtle */
  --color-text-link: #3B82F6;           /* Link text */
  --color-text-link-hover: #2563EB;     /* Link hover text */

  /* Status Colors - Professional & Clear */
  --color-text-success: #059669;        /* Success - professional green */
  --color-text-error: #DC2626;          /* Error - professional red */
  --color-text-warning: #D97706;        /* Warning - professional amber */
  --color-text-info: #2563EB;           /* Info - professional blue */

  /* Status Background Colors for Badges */
  --color-status-active-bg: #DCFCE7;    /* Light green background */
  --color-status-active-text: #059669;  /* Dark green text */
  --color-status-inactive-bg: #FEE2E2;  /* Light red background */
  --color-status-inactive-text: #DC2626; /* Dark red text */

  /* Border and Shadow - Clean & Subtle */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --border-color: #E2E8F0;              /* Light border color */
  --border-color-light: #F1F5F9;        /* Very light border */

  /* High Contrast Mode Support */
  --color-text-high-contrast: #000000;
  --color-bg-high-contrast: #FFFFFF;
}

/* Dark Theme - Professional Table Interface Design */
:root[data-theme="dark"] {
  /* Background Colors - Modern Dashboard Dark Theme */
  --color-bg-primary: #1A1D29;          /* Very dark blue-gray main background */
  --color-bg-secondary: #252A3A;        /* Card/surface background - lighter blue-gray */
  --color-bg-dark: #141721;             /* Darker background for contrast areas */
  --color-surface: #252A3A;             /* Card/surface background */
  --color-surface-elevated: #2D3348;    /* Elevated surfaces like modals */
  --color-background: #1A1D29;          /* Main app background */

  /* Text Color Hierarchy - Modern Dashboard Style */
  --color-text-primary: #FFFFFF;        /* Primary text - pure white for high contrast */
  --color-text-secondary: #B4B8C5;      /* Secondary text - light blue-gray */
  --color-text-tertiary: #8B92A5;       /* Tertiary text - medium blue-gray */
  --color-text-muted: #6B7280;          /* Muted text - darker gray */
  --color-text-disabled: #4B5563;       /* Disabled text - barely visible */

  /* Legacy support */
  --color-text: #FFFFFF;
  --color-subtle: #8B92A5;

  /* UI Component Text Colors */
  --color-text-input: #FFFFFF;          /* Input field text */
  --color-text-input-placeholder: #6B7280; /* Placeholder text */
  --color-text-button: #FFFFFF;         /* Button text on colored backgrounds */
  --color-text-button-secondary: #B4B8C5; /* Secondary button text */
  --color-text-tab: #B4B8C5;            /* Tab navigation text */
  --color-text-tab-active: #60A5FA;     /* Active tab text */
  --color-text-table: #FFFFFF;          /* Table content text */
  --color-text-table-header: #8B92A5;   /* Table header text - more subtle */
  --color-text-link: #60A5FA;           /* Link text */
  --color-text-link-hover: #93C5FD;     /* Link hover text */

  /* Status Colors - Professional & Muted */
  --color-text-success: #10B981;        /* Success - professional green */
  --color-text-error: #EF4444;          /* Error - professional red */
  --color-text-warning: #F59E0B;        /* Warning - professional amber */
  --color-text-info: #3B82F6;           /* Info - professional blue */

  /* Status Background Colors for Badges */
  --color-status-active-bg: #065F46;    /* Dark green background */
  --color-status-active-text: #10B981;  /* Light green text */
  --color-status-inactive-bg: #7F1D1D;  /* Dark red background */
  --color-status-inactive-text: #EF4444; /* Light red text */

  /* Border and Shadow - Dark Blue-Gray Theme */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --border-color: #3A4052;              /* Dark blue-gray border */
  --border-color-light: #434B5D;        /* Slightly lighter border */

  /* High Contrast Mode Support */
  --color-text-high-contrast: #FFFFFF;
  --color-bg-high-contrast: #000000;
}

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

/* Prevent horizontal scrolling on mobile */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  background: var(--color-bg-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--color-text-primary);
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: -0.01em;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* MAIN LAYOUT */
main {
  padding: 24px;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* HEADER */
header {
  background: var(--color-surface);
  padding: 20px 24px;
  margin-bottom: 24px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.02em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* VERSION BADGE */
.version-badge {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.version-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* VERSION MODAL */
.version-modal .modal-content {
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.version-current {
  text-align: center;
  padding: 2rem 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.version-badge-large {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  font-size: 24px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: inline-block;
  margin-bottom: 1rem;
}

.version-current-text {
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.version-history {
  max-height: 400px;
  overflow-y: auto;
}

.version-entry {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: var(--color-surface);
  transition: all 0.2s ease;
}

.version-entry.current {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.05);
}

.version-entry:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.version-number {
  background: var(--color-primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.version-date {
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.version-changes {
  list-style: none;
  padding: 0;
  margin: 0;
}

.version-changes li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(var(--color-border-rgb), 0.3);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  padding-left: 1.5rem;
}

.version-changes li:last-child {
  border-bottom: none;
}

.version-changes li::before {
  content: '•';
  color: var(--color-primary);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.version-footer {
  text-align: center;
  padding: 2rem 0 1rem;
  border-top: 1px solid var(--color-border);
  margin-top: 2rem;
}

.version-footer p {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin: 0.5rem 0;
}

/* MODERN THEME TOGGLE - PROFESSIONAL DESIGN */
.theme-toggle-container {
  position: relative;
  display: flex;
  background: var(--color-bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 4px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  min-width: 140px;
  height: 40px;
  /* Enhanced touch support */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle-container:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.theme-toggle-container:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.theme-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
}

.theme-option:hover {
  transform: scale(1.02);
}

.theme-option.active {
  color: var(--color-text-button);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.theme-option:not(.active) {
  color: var(--color-text-tertiary);
}

.theme-option:not(.active):hover {
  color: var(--color-text-secondary);
}

.theme-icon {
  font-size: 14px;
  line-height: 1;
}

.theme-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.theme-toggle-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.theme-toggle-slider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
  border-radius: 20px;
  transition: opacity 0.3s ease;
}

/* Dark theme active state */
[data-theme="dark"] .theme-toggle-slider {
  transform: translateX(100%);
  background: linear-gradient(135deg, #1F2937, #374151);
  box-shadow: 0 2px 8px rgba(31, 41, 55, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Light theme active state */
[data-theme="light"] .theme-toggle-slider {
  transform: translateX(0%);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Animation when switching */
.theme-toggle-container.switching .theme-toggle-slider {
  animation: toggleBounce 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes toggleBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* FOCUS SOUNDS BUTTON */
.noise-generator-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  height: 40px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  outline: none;
  /* Enhanced touch support */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.noise-generator-btn:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.noise-generator-btn:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.noise-generator-btn:active {
  transform: scale(0.98);
}

.noise-generator-btn.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-color: var(--color-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.noise-generator-btn.active .noise-icon {
  animation: soundWave 2s ease-in-out infinite;
}

.noise-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.noise-label {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.3s ease;
}

@keyframes soundWave {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Header Content Layout - Positions elements correctly */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto; /* Ensures right alignment */
}

/* LEGACY NAVIGATION - DEPRECATED */
nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ===== RESPONSIVE TAB NAVIGATION SYSTEM ===== */

/* SHARED STYLES FOR TABS */
.tab-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--color-surface);
  color: var(--color-text-tab);
  font-family: 'Inter', sans-serif;
  z-index: 1000;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tab {
  background: none;
  border: none;
  color: var(--color-text-tab);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin: 4px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}

.tab:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-text-tab-active);
}

.tab.active {
  color: var(--color-text-tab-active);
  font-weight: 600;
  background: rgba(59, 130, 246, 0.15);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* DESKTOP TOP NAV */
.tab-bar-top {
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  padding: 8px 16px;
  display: none;
  box-shadow: var(--shadow);
}

.tab-bar-top .tab {
  flex-direction: row;
  min-width: auto;
  padding: 12px 20px;
}

/* MOBILE BOTTOM NAV */
.tab-bar-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 8px 4px 12px 4px;
  border-top: 1px solid var(--border-color);
  display: none;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  background: var(--color-surface);
}

.tab-bar-bottom .tab {
  flex-direction: column;
  padding: 8px 4px;
  font-size: 12px;
  line-height: 1.2;
  min-width: 60px;
  min-height: 48px;
}

.tab-bar-bottom .tab span {
  font-size: 10px;
  font-weight: 400;
  margin-top: 2px;
}

/* VISIBILITY BASED ON SCREEN SIZE */
@media (min-width: 768px) {
  .tab-bar-top { 
    display: flex; 
  }
  
  /* Add padding to main content to account for sticky top nav */
  main {
    padding-top: 0;
  }
}

@media (max-width: 767px) {
  .tab-bar-bottom { 
    display: flex; 
  }
  
  /* Add padding to main content to account for bottom nav */
  main {
    padding-bottom: 80px;
  }
  
  /* Hide header on mobile to save space */
  header {
    padding: 8px 16px;
  }

  .header-content {
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-content h1 {
    font-size: 18px;
    flex: 1;
    min-width: 0;
  }

  /* Mobile version badge adjustments */
  .version-badge {
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 10px;
  }

  /* Mobile version modal adjustments */
  .version-modal .modal-content {
    max-width: calc(100vw - 2rem);
    max-height: 90vh;
    margin: 1rem;
  }

  .version-badge-large {
    font-size: 20px;
    padding: 10px 20px;
    border-radius: 16px;
  }

  .version-entry {
    padding: 1rem;
  }

  .version-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Mobile header actions - stack vertically if needed */
  .header-actions {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
  }

  /* Mobile theme toggle adjustments - larger touch targets */
  .theme-toggle-container {
    min-width: 120px;
    height: 44px;
    flex-shrink: 0;
  }

  /* Mobile noise generator adjustments - larger touch targets */
  .noise-generator-btn {
    height: 44px;
    padding: 8px 12px;
    font-size: 12px;
    min-width: 44px;
    flex-shrink: 0;
  }

  .noise-label {
    font-size: 11px;
    display: none; /* Hide text on mobile to save space */
  }

  /* Show only icon on mobile */
  .noise-generator-btn .noise-icon {
    margin: 0;
  }

  .theme-option {
    padding: 4px 8px;
    gap: 4px;
  }

  .theme-label {
    font-size: 11px;
  }

  .theme-icon {
    font-size: 12px;
  }
}

/* Very small mobile screens - ultra compact header */
@media (max-width: 480px) {
  header {
    padding: 6px 12px;
  }

  .header-content h1 {
    font-size: 16px;
  }

  /* Ultra-small mobile version badge */
  .version-badge {
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 8px;
  }

  .theme-toggle-container {
    min-width: 100px;
    height: 40px;
  }

  .theme-label {
    display: none; /* Hide theme labels on very small screens */
  }

  .noise-generator-btn {
    height: 40px;
    padding: 6px 8px;
    min-width: 40px;
  }

  .timer-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
}

/* TAB CONTENT */
.tab-content {
  display: none;
  padding: 24px;
  min-height: calc(100vh - 200px);
}

.tab-content.active {
  display: block;
}

/* Mobile responsive adjustments for tab content */
@media (max-width: 767px) {
  .tab-content {
    padding: 16px 8px; /* Reduced side padding from 16px to 8px for wider cards */
    min-height: calc(100vh - 160px);
  }

  /* Section header mobile adjustments - Expert UX Guidelines */
  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px; /* Reduced from 20px */
    padding: 8px 0 12px 0; /* Reduced from 16px 0 20px 0 */
    margin-bottom: 16px; /* Reduced from 24px */
  }

  .section-header h2 {
    font-size: 18px; /* Reduced from 24px */
    margin: 0;
    letter-spacing: -0.3px;
    text-align: left;
    order: 1;
  }

  /* Mobile controls layout - prioritize visual hierarchy */
  .section-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    order: 2;
  }

  /* Top row: Sort controls (primary action) */
  .section-controls-top {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Changed to space-between for right alignment */
    gap: 8px;
    width: 100%;
    overflow: hidden;
  }

  /* Bottom row: Secondary info */
  .section-controls-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .sort-dropdown {
    width: auto; /* Let it size to match streak badge */
    min-width: auto;
    max-width: none;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    margin-left: auto; /* Push to right side */
  }

  .sort-select {
    font-size: 12px; /* Match streak badge font size */
    padding: 6px 12px; /* Match streak badge padding */
    min-width: 0;
    width: auto;
    height: auto;
    flex: none;
    border-radius: 16px; /* Match streak badge border radius */
    background: var(--color-surface);
    border: 1px solid var(--border-color);
    color: var(--color-text-primary);
    font-weight: 600; /* Match streak badge font weight */
  }

  .sort-direction-btn {
    display: none; /* Hide on mobile to save space */
  }

  .total-count {
    font-size: 12px;
  }

  /* Mobile layout structure - Expert UX Guidelines */
  .section-controls-top {
    order: 1;
    margin-bottom: 8px;
  }

  .section-controls-bottom {
    order: 2;
  }

  .sort-dropdown {
    width: auto; /* Let it size to match streak badge */
    min-width: auto;
    max-width: none;
    margin-left: auto; /* Push to right side */
  }

  .sort-select {
    font-size: 12px; /* Match streak badge font size */
    padding: 6px 12px; /* Match streak badge padding */
    height: auto;
    border-radius: 16px; /* Match streak badge border radius */
    width: auto;
    font-weight: 600; /* Match streak badge font weight */
  }

  .sort-direction-btn {
    display: none; /* Hide on mobile to save space */
  }

  .total-count {
    font-size: 14px;
    color: var(--color-text-secondary);
    font-weight: 500;
  }
}

/* Small mobile devices (≤480px) - Additional sorting optimizations */
@media (max-width: 480px) {
  .section-controls {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .sort-dropdown {
    width: auto !important; /* Let it size naturally */
    min-width: auto !important;
    max-width: none !important;
    margin-left: auto !important;
  }

  .sort-select {
    width: auto !important;
    min-width: auto !important;
    font-size: 11px !important; /* Slightly smaller for small screens */
    padding: 5px 10px !important; /* Slightly smaller padding */
    height: auto !important;
    border-radius: 14px !important; /* Slightly smaller radius */
  }

  .sort-direction-btn {
    display: none !important; /* Keep hidden on small mobile */
  }

  .total-count {
    font-size: 11px !important;
    text-align: center !important;
    padding: 4px 0 !important;
  }


}

/* ===== END TAB NAVIGATION SYSTEM ===== */



/* BOOK CARD - ENHANCED 2025 DESIGN SYSTEM WITH FULL COVER ART */
.book-card {
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15); /* Enhanced shadow for better depth */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--color-border);
  min-height: 480px; /* Increased from 420px to accommodate larger cover */
  position: relative;
}

.book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.book-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.book-card:hover::before {
  opacity: 1;
}

/* COVER CONTAINER - ENHANCED FULL COVER ART */
.cover-container {
  width: 100%;
  height: 240px; /* Increased from 180px for fuller cover display */
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  border-radius: 16px 16px 0 0; /* Rounded top corners to match card */
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 16px 16px 0 0;
  background: var(--color-surface);
}

.book-card:hover .cover-image {
  transform: scale(1.03); /* Slightly reduced for more subtle effect */
}

.book-card:hover .book-cover {
  transform: scale(1.03); /* Slightly reduced for more subtle effect */
}

/* Enhanced placeholder cover styling */
.cover-image.placeholder {
  background: linear-gradient(145deg, #374151, #4B5563);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px; /* Increased for better proportion */
  color: #9CA3AF;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* Add subtle overlay for better text readability on cover images */
.cover-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.1));
  pointer-events: none;
}

/* BOOK COVER CLASS (used by Utils.renderBookCover) - SAME STYLING AS COVER-IMAGE */
.book-cover {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 16px 16px 0 0;
  background: var(--color-surface);
}

.book-cover.placeholder {
  background: linear-gradient(145deg, #374151, #4B5563);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px; /* Increased for better proportion */
  color: #9CA3AF;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* Cover container for fallback support */
.book-cover-container,
.cover-image-container {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

/* Cover fallback styling for failed image loads */
.cover-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #374151, #4B5563);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #E5E7EB;
  font-size: 24px;
  border-radius: 16px 16px 0 0;
}

.cover-fallback .fallback-text {
  margin-top: 8px;
  font-size: 12px;
  color: #9CA3AF;
  text-align: center;
  font-weight: 500;
}

/* Modal cover containers */
.delete-book-cover-container,
.archive-book-cover-container,
.update-book-cover-container,
.options-book-cover-container,
.edit-cover-preview-container,
.delete-cover-image-container,
.archive-cover-image-container,
.update-cover-image-container,
.options-cover-image-container,
.edit-cover-image-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
}

/* CARD BODY */
.card-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.book-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--color-text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.book-author {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
  margin: 0;
}

/* PROGRESS SECTION - PRD COMPLIANT DESIGN */
.progress-section {
  margin: 12px 0;
}

/* Progress Bar CSS Variables for Theme Support */
:root {
  --progress-bg: #E0E0E0;
  --progress-fill: #2E86DE;
}

/* Dark theme with WCAG AA contrast compliance */
[data-theme="dark"] {
  --progress-bg: #2C2C2C;
  --progress-fill: #00C9A7;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --progress-bg: #000000;
    --progress-fill: #FFFFFF;
  }
  
  [data-theme="dark"] {
    --progress-bg: #FFFFFF;
    --progress-fill: #000000;
  }
}

/* Main Progress Container */
.progress-container {
  background-color: var(--progress-bg);
  border-radius: 4px;
  overflow: hidden;
  height: 8px; /* Desktop default */
  width: 100%;
  position: relative;
}

/* Table-specific progress bars - 16px height */
.table-progress-container {
  background-color: var(--progress-bg);
  border-radius: 4px;
  overflow: hidden;
  height: 16px; /* Increased height for table view */
  width: 100%;
  position: relative;
}

/* Card-specific progress bars - 16px height */
.card-progress-container {
  background-color: var(--progress-bg);
  border-radius: 4px;
  overflow: hidden;
  height: 16px; /* Increased height for card view */
  width: 100%;
  position: relative;
}

/* Progress Fill Bar */
.progress-fill {
  background-color: var(--progress-fill);
  height: 100%;
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  transition: width 0.4s ease-in-out;
  min-width: 0;
}

/* Table-specific progress fill */
.table-progress-fill {
  background-color: var(--progress-fill);
  height: 100%;
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  transition: width 0.4s ease-in-out;
  min-width: 0;
}

/* Card-specific progress fill */
.card-progress-fill {
  background-color: var(--progress-fill);
  height: 100%;
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  transition: width 0.4s ease-in-out;
  min-width: 0;
}

/* Progress update animation */
.progress-fill.progress-updating,
.progress-bar-fill.progress-updating,
.table-progress-fill.progress-updating,
.card-progress-fill.progress-updating {
  animation: progressPulse 0.8s ease-in-out;
}

@keyframes progressPulse {
  0%, 100% {
    opacity: 1;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.8;
    transform: scaleY(1.1);
  }
}

/* Mobile Responsiveness - maintain original heights for legacy containers */
@media (max-width: 768px) {
  .progress-container {
    height: 6px;
  }
  
  /* Keep enhanced heights on mobile for better touch interaction */
  .table-progress-container,
  .card-progress-container {
    height: 16px;
  }
}

/* Enhanced progress bar wrapper */
.progress-bar-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 6px;
}

/* Progress bar container - 50% taller */
.progress-bar-container {
  width: 100%;
  margin-bottom: 8px;
}

.progress-bar-container .table-progress-container,
.progress-bar-container .card-progress-container {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb); /* Modern gradient background */
  border-radius: 2px; /* Slightly rounded for modern look */
  height: 24px; /* Twice as tall as original 12px */
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06); /* Subtle inset shadow */
  border: 1px solid #d1d5db; /* Clean border */
}

.progress-bar-container .table-progress-fill,
.progress-bar-container .card-progress-fill {
  background: #3B82F6; /* Blue color to match numbers */
  height: 100%;
  border-radius: 2px; /* Match container */
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth easing */
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3); /* Subtle glow */
}

/* Gleam animation - only shows for 10 seconds after page load */
.progress-gleam-active .progress-bar-container .table-progress-fill::after,
.progress-gleam-active .progress-bar-container .card-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: gleamAnimation 2.5s ease-in-out infinite;
  animation-delay: 0.5s;
}

@keyframes gleamAnimation {
  0% {
    opacity: 0;
    transform: translateX(-100%);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Table-specific legacy container */
.progress-bar-container.table {
  height: 16px;
}

/* Card-specific legacy container */
.progress-bar-container.card {
  height: 16px;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--progress-fill);
  transition: width 0.4s ease-in-out;
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .progress-container {
    height: 6px;
  }
}

/* LEGACY PROGRESS BAR STYLES - FOR BACKWARD COMPATIBILITY */
.progress-bar {
  height: 8px;
  background: var(--progress-bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  width: 100%;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--progress-fill);
  transition: width 0.4s ease-in-out;
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

/* Mobile Responsiveness for legacy */
@media (max-width: 768px) {
  .progress-bar-container {
    height: 6px;
  }
}

.progress-label {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
}

/* Progress information below the progress bar */
.progress-info-below {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding: 0 2px;
}

.progress-text-line {
  display: flex;
  align-items: center;
}

.progress-text {
  font-weight: 500;
  color: var(--color-text-primary);
  font-size: 16px;
  line-height: 1.2;
}

.progress-numbers {
  font-weight: 700;
  color: #3B82F6; /* Blue color for calculated numbers only */
}

.days-text-line {
  display: flex;
  align-items: center;
}

.days-text {
  font-weight: 500;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.2;
}

.days-numbers {
  font-weight: 600;
  color: #3B82F6; /* Blue color for calculated numbers only */
}

/* Compact progress text for table view */
.progress-text {
  font-size: 11px;
  color: var(--color-text-secondary);
  text-align: center;
  margin-top: 4px;
}

/* Mobile responsiveness for progress info */
@media (max-width: 768px) {
  .progress-info-below {
    gap: 3px;
    margin-top: 6px;
  }

  .progress-numbers {
    font-size: 15px;
  }

  .days-numbers {
    font-size: 13px;
  }
}

/* READING STATS */
.reading-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.badge {
  font-size: 12px;
  background: rgba(255,255,255,0.05);
  padding: 4px 10px;
  border-radius: 999px;
  color: #BDC3C7;
  display: inline-block;
}

.badge-warning {
  color: #F39C12;
  background: rgba(243,156,18,0.15);
}

/* BUTTON GROUP */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.button-group .btn {
  flex: 1 1 auto;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.button-group .btn-primary {
  background: #00C9A7;
}

.button-group .btn-success {
  background: #10B981;
}

.button-group .btn-warning {
  background: #F59E0B;
}

.button-group .btn-danger {
  background: #EF4444;
}

.button-group .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* STATUS SECTION - 2025 DESIGN SYSTEM */
.status-section {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
  align-items: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  min-height: 28px;
  white-space: nowrap;
}

.status-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.status {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-primary);
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 28px;
}

.status.reading {
  background: rgba(77, 142, 255, 0.15);
  color: var(--color-primary);
  border-color: rgba(77, 142, 255, 0.3);
  box-shadow: 0 2px 8px rgba(77, 142, 255, 0.2);
}

.status.completed {
  background: rgba(56, 211, 159, 0.15);
  color: var(--color-success);
  border-color: rgba(56, 211, 159, 0.3);
  box-shadow: 0 2px 8px rgba(56, 211, 159, 0.2);
}

.status.want-to-read {
  background: rgba(255, 179, 71, 0.15);
  color: var(--color-warning);
  border-color: rgba(255, 179, 71, 0.3);
  box-shadow: 0 2px 8px rgba(255, 179, 71, 0.2);
}

.status.archived {
  background: rgba(248, 92, 92, 0.15);
  color: var(--color-error);
  border-color: rgba(248, 92, 92, 0.3);
  box-shadow: 0 2px 8px rgba(248, 92, 92, 0.2);
}

/* Reading Stats */
.reading-stats {
  display: flex;
  justify-content: space-between;
  margin: 12px 0;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-label {
  font-size: 10px;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.stat-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
}

/* BADGES / METRICS */
.badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-tertiary);
  display: inline-block;
  margin-right: 6px;
}

.badge-danger {
  background: rgba(248, 92, 92, 0.1);
  color: var(--color-text-error);
}

.badge-warning {
  background: rgba(243, 156, 18, 0.1);
  color: var(--color-text-warning);
}

.badge-success {
  background: rgba(56, 211, 159, 0.1);
  color: var(--color-text-success);
}

/* BUTTONS - PROFESSIONAL INTERFACE DESIGN */
.btn, .button {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin: 2px;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  min-height: 36px;
  position: relative;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.01em;
}

/* UNIFIED BUTTON COLOR SCHEME - PROFESSIONAL DESIGN */

/* Primary Action - Green (Main actions like Add, Update, Save) */
.btn-primary, .button-primary {
  background: #00C9A7;
  color: #FFFFFF;
  border: 1px solid #00C9A7;
  box-shadow: 0 1px 3px rgba(0, 201, 167, 0.2);
}

.btn-primary:hover {
  background: #00B894;
  border-color: #00B894;
  box-shadow: 0 2px 6px rgba(0, 201, 167, 0.3);
  transform: translateY(-1px);
}

/* Secondary Action - Neutral (Cancel, Close, Secondary actions) */
.btn-secondary, .button-secondary {
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-text-tertiary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

/* Success Action - Green (Restore, Complete, Confirm positive actions) */
.btn-success, .button-success {
  background: #10B981;
  color: #FFFFFF;
  border: 1px solid #10B981;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  background: #059669;
  border-color: #059669;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

/* Warning Action - Amber (Archive, Pause, Caution actions) */
.btn-warning {
  background: #F59E0B;
  color: #FFFFFF;
  border: 1px solid #F59E0B;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
  background: #D97706;
  border-color: #D97706;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
  transform: translateY(-1px);
}

/* Danger Action - Red (Delete, Remove, Destructive actions) */
.btn-danger, .button-danger {
  background: #EF4444;
  color: #FFFFFF;
  border: 1px solid #EF4444;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: #DC2626;
  border-color: #DC2626;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

/* Button Focus States for Accessibility */
.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 201, 167, 0.2);
}

.btn-primary:focus {
  box-shadow: 0 0 0 3px rgba(0, 201, 167, 0.3);
}

.btn-secondary:focus {
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.3);
}

.btn-success:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

.btn-warning:focus {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.btn-danger:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

/* Button Active States */
.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Disabled Button States */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Button Sizes */
.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
  min-height: 36px;
}

.btn-xs {
  padding: 6px 10px;
  font-size: 11px;
  min-height: 28px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
  min-height: 48px;
}

/* Button Icons */
.btn-icon {
  font-size: 14px;
  margin-right: 4px;
}

.btn-sm .btn-icon {
  font-size: 12px;
  margin-right: 3px;
}

.btn-xs .btn-icon {
  font-size: 10px;
  margin-right: 2px;
}

/* CARD ACTIONS - ENHANCED */
.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 16px;
}

.book-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 12px;
}

.book-actions .btn {
  flex: 1;
  min-width: 0;
  margin: 2px;
  font-size: 11px;
  padding: 6px 10px;
}

.action-buttons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.action-buttons .btn {
  margin: 1px;
}

/* FORMS */
.form-container {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.01em;
  font-weight: 500;
  color: var(--color-text-primary);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text-input);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
  color: var(--color-text-input-placeholder);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* SECTION HEADER - PROFESSIONAL INTERFACE DESIGN */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px; /* Reduced from 24px */
  padding: 8px 0; /* Reduced from 16px */
  border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
  font-size: 16px; /* Reduced from 20px */
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
  letter-spacing: -0.02em;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
}



.section-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Streak Badge - Red styling matching dashboard */
.streak-badge {
  background: #EF4444;
  color: white;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.streak-badge svg {
  fill: white;
  flex-shrink: 0;
}

/* Section controls top - Desktop layout */
.section-controls-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.total-count {
  font-size: 14px;
  color: var(--color-text-tertiary);
  font-weight: 500;
}



/* SORTING DROPDOWN - 2025 DESIGN SYSTEM */
.sort-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-select {
  background: var(--color-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 32px 8px 12px;
  font-size: 14px;
  color: var(--color-text-primary);
  cursor: pointer;
  appearance: none;
  min-width: 160px;
  transition: all 0.2s ease;
  position: relative;
}

.sort-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(77, 142, 255, 0.1);
}

.sort-dropdown .sort-select::after {
  content: '▼';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary);
  font-size: 10px;
  pointer-events: none;
  z-index: 1;
}

/* SORT DIRECTION TOGGLE BUTTON */
.sort-direction-btn {
  background: var(--color-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 36px;
  line-height: 1;
  flex-shrink: 0;
}

.sort-direction-btn:hover {
  background: rgba(77, 142, 255, 0.1);
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(77, 142, 255, 0.15);
}

.sort-direction-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(77, 142, 255, 0.2);
}

/* Direction-specific styling */
.sort-direction-btn.asc {
  color: var(--color-success);
  border-color: rgba(56, 211, 159, 0.3);
}

.sort-direction-btn.asc:hover {
  background: rgba(56, 211, 159, 0.1);
  border-color: var(--color-success);
  box-shadow: 0 2px 8px rgba(56, 211, 159, 0.15);
}

.sort-direction-btn.desc {
  color: var(--color-primary);
  border-color: rgba(77, 142, 255, 0.3);
}

.sort-direction-btn.desc:hover {
  background: rgba(77, 142, 255, 0.1);
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(77, 142, 255, 0.15);
}

/* Focus states for accessibility */
.sort-direction-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(77, 142, 255, 0.2);
}

.sort-direction-btn.asc:focus {
  box-shadow: 0 0 0 3px rgba(56, 211, 159, 0.2);
}

.sort-direction-btn.desc:focus {
  box-shadow: 0 0 0 3px rgba(77, 142, 255, 0.2);
}



/* MODAL - ENHANCED 2025 DESIGN SYSTEM */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
  opacity: 0;
  animation: modalFadeIn 0.3s ease-out forwards;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(8px);
  }
}

.modal-content {
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 0;
  max-width: min(480px, calc(100vw - 2rem));
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
  transform: scale(0.9) translateY(20px);
  animation: modalSlideIn 0.3s ease-out forwards;
  position: relative;
}

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

/* Clean Modal Header - No Gradients */
.modal-content h3 {
  background: var(--color-surface);
  color: var(--color-text);
  margin: 0;
  padding: 20px 24px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 12px 12px 0 0;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  box-shadow: none;
}

/* Remove gradient effects */
.modal-content h3::after {
  display: none;
}

/* Enhanced Modal Body */
.modal-content p {
  padding: 0 24px;
  margin: 20px 0 16px 0;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
}

/* Enhanced Form Group in Modal */
.modal-content .form-group {
  padding: 0 24px;
  margin-bottom: 24px;
}

.modal-content .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--color-text);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-content .form-group input[type="number"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
  text-align: center;
  font-family: 'Poppins', sans-serif;
  /* Hide number input spinner arrows */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

/* Hide webkit spinner arrows for modal number inputs */
.modal-content .form-group input[type="number"]::-webkit-outer-spin-button,
.modal-content .form-group input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.modal-content .form-group input[type="number"]:focus {
  outline: none;
  border-color: var(--color-primary);
  background: rgba(77, 142, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(77, 142, 255, 0.15);
  transform: translateY(-1px);
}

.modal-content .form-group small {
  display: block;
  margin-top: 8px;
  color: var(--color-subtle);
  font-size: 12px;
  text-align: center;
  font-weight: 500;
}

/* Enhanced Modal Actions */
.modal-actions {
  display: flex;
  gap: 12px;
  padding: 20px 24px 24px 24px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

.modal-actions .btn {
  margin: 0;
  min-width: 100px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

/* Modal buttons inherit the unified color scheme */
.modal-actions .btn-primary {
  background: #00C9A7;
  border: 1px solid #00C9A7;
  box-shadow: 0 2px 8px rgba(0, 201, 167, 0.25);
}

.modal-actions .btn-primary:hover {
  background: #00B894;
  border-color: #00B894;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 201, 167, 0.35);
}

.modal-actions .btn-secondary {
  background: var(--color-surface);
  border: 1px solid var(--border-color);
  color: var(--color-text-secondary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modal-actions .btn-secondary:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-text-tertiary);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Legacy Modal Header Support */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-subtle);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
}

/* Update Progress Modal Specific Styles */
.update-progress-content {
  padding: 24px;
}

.update-progress-content .book-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.update-book-cover {
  width: 60px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.update-book-cover.placeholder {
  background: linear-gradient(145deg, #374151, #4B5563);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #9CA3AF;
  font-weight: 600;
}

.update-progress-content .book-details {
  flex: 1;
  min-width: 0;
}

.update-progress-content .book-details h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
  word-wrap: break-word;
}

.update-progress-content .book-details p {
  margin: 0 0 4px 0;
  font-size: 14px;
  color: var(--color-text-secondary);
  padding: 0;
  line-height: 1.4;
}

.update-progress-content .current-progress {
  font-weight: 600;
  color: var(--color-primary) !important;
}

.update-progress-content .pace-info {
  font-size: 13px;
  color: var(--color-accent) !important;
  font-style: italic;
}

.progress-form {
  margin: 0;
}

.progress-form .form-group input.error {
  border-color: var(--color-error) !important;
  box-shadow: 0 0 0 3px rgba(248, 92, 92, 0.15) !important;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.live-preview {
  margin-top: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeIn 0.3s ease-in-out;
}

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

.live-preview .progress-bar-container {
  margin: 0;
}

.live-preview .progress-bar-fill {
  transition: all 0.3s ease;
}

.live-preview .progress-percentage {
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
  margin-top: 8px;
}

/* Enhanced modal button states */
.modal-actions .btn.btn-success {
  background: #10B981;
  border: 1px solid #10B981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25); }
  50% { box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4); }
  100% { box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25); }
}

.modal-actions .btn.btn-success:hover {
  background: #059669;
  border-color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* Use Pace Button Specific Styling */
#usePaceBtn {
  background: #10B981 !important;
  border-color: #10B981 !important;
  color: white !important;
  font-weight: 600;
  position: relative;
}

#usePaceBtn:hover {
  background: #059669 !important;
  border-color: #059669 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35) !important;
}

#usePaceBtn .btn-icon {
  color: white;
}

/* LONG PRESS DELETE MODAL */
.long-press-delete-modal .modal-content {
  max-width: 400px;
  width: 90%;
}

.long-press-delete-content {
  padding: 0;
}

.book-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--color-background);
  border-radius: 8px;
  margin-bottom: 20px;
}

.delete-book-cover {
  width: 60px;
  height: 90px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.delete-book-cover.placeholder {
  background: linear-gradient(145deg, #374151, #4B5563);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  font-size: 24px;
}

/* Archive book cover styles */
.archive-book-cover {
  width: 60px;
  height: 90px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  max-width: 60px;
  max-height: 90px;
}

.archive-book-cover.placeholder {
  background: linear-gradient(145deg, #374151, #4B5563);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  font-size: 24px;
  width: 60px;
  height: 90px;
}

.book-details h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.book-details p {
  margin: 0 0 4px 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.warning-message {
  text-align: center;
  padding: 0 20px;
}

.warning-message p {
  margin: 0 0 12px 0;
  color: var(--color-text-primary);
}

.warning-message strong {
  color: var(--color-danger);
}

.modal-header.warning h3 {
  color: var(--color-danger);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* BOOK OPTIONS MODAL */
.book-options-modal .modal-content {
  max-width: 500px;
  width: 90%;
}

.book-options-content {
  padding: 20px 24px;
}

.book-options-content .book-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--color-surface-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.options-book-cover {
  width: 60px;
  height: 80px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.options-book-cover.placeholder {
  background: linear-gradient(145deg, #374151, #4B5563);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #9CA3AF;
}

.book-options-content .book-details h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.book-options-content .book-details p {
  margin: 0 0 2px 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.options-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-large {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
  min-height: 52px;
}

.btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-large .btn-icon {
  font-size: 18px;
}

.btn-large.btn-primary {
  background: linear-gradient(135deg, #00C9A7, #00B894);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 201, 167, 0.25);
}

.btn-large.btn-primary:hover {
  background: linear-gradient(135deg, #00B894, #00A085);
  box-shadow: 0 6px 20px rgba(0, 201, 167, 0.35);
}

.btn-large.btn-danger {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-large.btn-danger:hover {
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-subtle);
}

.empty-state h2 {
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--color-text);
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 24px;
}

/* SKELETON LOADING */
.skeleton-card {
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0;
  overflow: hidden;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.skeleton-cover {
  height: 200px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: 0;
  margin-bottom: 16px;
}

.skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-title {
  height: 20px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: 4px;
}

.skeleton-author {
  height: 16px;
  width: 70%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: 4px;
}

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

/* RESPONSIVE TYPE */
h1, h2, h3, p, span, button {
  font-size: clamp(14px, 1.2vw, 18px);
}

/* ===== HEADER QUOTE STYLING ===== */

/* Header Quote Styling - Random quote display */
.header-quote {
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  font-style: italic;
  color: var(--color-text-secondary);
  margin-top: 0.5rem;
  text-align: center;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.4s ease-in;
  max-width: 100%;
  word-wrap: break-word;
  padding: 0 1rem;
}

.header-quote.visible {
  opacity: 1;
}

/* Dark theme override for better readability */
[data-theme="dark"] .header-quote {
  color: #cccccc;
}

/* High contrast theme support */
@media (prefers-contrast: high) {
  .header-quote {
    color: var(--color-text-primary);
    font-weight: 500;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .header-quote {
    transition: none;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .header-quote {
    font-size: clamp(0.7rem, 3vw, 0.9rem);
    margin-top: 0.75rem;
    padding: 0 0.5rem;
  }

  /* Mobile modal actions - stack buttons vertically */
  .modal-actions {
    flex-direction: column;
    gap: 8px;
    padding: 16px;
  }

  .modal-actions .btn {
    width: 100%;
    min-width: auto;
    justify-content: center;
  }

  /* Fix mobile cover expansion in modals */
  .delete-book-cover,
  .archive-book-cover,
  .options-book-cover {
    width: 60px !important;
    height: 90px !important;
    max-width: 60px !important;
    max-height: 90px !important;
    flex-shrink: 0 !important;
    object-fit: cover !important;
  }

  .delete-book-cover.placeholder,
  .archive-book-cover.placeholder,
  .options-book-cover.placeholder {
    width: 60px !important;
    height: 90px !important;
    max-width: 60px !important;
    max-height: 90px !important;
  }

  /* Ensure book preview containers don't expand */
  .book-preview {
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .book-details {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
}

/* ===== END HEADER QUOTE STYLING ===== */

/* ===== ANIMATED TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  transform: translateX(100%) scale(0.8);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.toast-success {
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
}

.toast-celebration {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.3);
}

.toast-info {
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

.toast-warning {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.3);
}

.toast-error {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
}

.toast-show {
  transform: translateX(0) scale(1);
  opacity: 1;
}

.toast-hide {
  transform: translateX(100%) scale(0.8);
  opacity: 0;
}

.toast-icon {
  font-size: 24px;
  flex-shrink: 0;
  animation: toastIconBounce 0.6s ease-out;
}

.toast-message {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}

@keyframes toastIconBounce {
  0% { transform: scale(0.3) rotate(-10deg); }
  50% { transform: scale(1.1) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Mobile toast adjustments - 50% smaller */
@media (max-width: 768px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    align-items: center;
  }

  .toast {
    min-width: auto;
    max-width: none;
    width: 100%;
    padding: 8px 12px;  /* Reduced from 14px 16px */
    border-radius: 8px;  /* Reduced from 12px */
    transform: scale(0.75);  /* 50% smaller overall */
    transform-origin: center;
  }

  .toast-icon {
    font-size: 16px;  /* Reduced from 20px */
  }

  .toast-message {
    font-size: 12px;  /* Reduced from 14px */
    line-height: 1.3;  /* Tighter line height */
  }

  /* Adjust animations for smaller size */
  .toast-show {
    transform: translateX(0) scale(0.75);
    opacity: 1;
  }

  .toast-hide {
    transform: translateX(100%) scale(0.6);
    opacity: 0;
  }
}

/* ===== END TOAST NOTIFICATIONS ===== */

/* ===== ADMIN DASHBOARD STYLING ===== */
.admin-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1.5rem 0;
  border-bottom: 2px solid var(--color-border);
}

.admin-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.5rem 0;
  background: linear-gradient(135deg, #3B82F6, #8B5CF6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin: 0;
  font-weight: 400;
}

/* Primary Stats Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.admin-stat-card {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.admin-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-color-light));
  opacity: 0.8;
}

.admin-stat-card.primary::before {
  background: linear-gradient(90deg, #3B82F6, #60A5FA);
}

.admin-stat-card.success::before {
  background: linear-gradient(90deg, #10B981, #34D399);
}

.admin-stat-card.info::before {
  background: linear-gradient(90deg, #8B5CF6, #A78BFA);
}

.admin-stat-card.warning::before {
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-color);
}

.admin-stat-card .stat-icon {
  font-size: 2.5rem;
  opacity: 0.8;
  flex-shrink: 0;
}

.admin-stat-card .stat-content {
  flex: 1;
}

.admin-stat-card .stat-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.admin-stat-card .stat-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}

.admin-stat-card .stat-detail {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* Secondary Stats */
.admin-secondary-stats {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

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

.stat-item .stat-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.stat-item .stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

/* Progress Overview */
.admin-progress-section {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.admin-progress-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.3rem;
  color: var(--color-text);
  font-weight: 600;
}

.progress-overview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.book-progress-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--color-background-secondary);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.book-progress-item .book-info {
  flex: 1;
  min-width: 0;
}

.book-progress-item .book-title {
  display: block;
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.book-progress-item .progress-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.progress-bar-mini {
  width: 80px;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-mini .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-color-light));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.book-progress-item .progress-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  min-width: 35px;
  text-align: right;
}

/* Data Management Section */
.admin-data-section {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.admin-data-section h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.3rem;
  color: var(--color-text);
  font-weight: 600;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.admin-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-background);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.admin-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.admin-btn:hover::before {
  transform: scaleX(1);
}

.admin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-color);
}

.admin-btn.export::before { background: #10B981; }
.admin-btn.import::before { background: #3B82F6; }
.admin-btn.settings::before { background: #8B5CF6; }
.admin-btn.danger::before { background: #EF4444; }

.admin-btn .btn-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.admin-btn .btn-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.admin-btn .btn-detail {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

/* Achievement Summary */
.admin-achievements-section {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
}

.admin-achievements-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.3rem;
  color: var(--color-text);
  font-weight: 600;
}

.achievement-overview {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.achievement-stats {
  display: flex;
  justify-content: space-around;
  padding: 1rem;
  background: var(--color-background-secondary);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.achievement-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.achievement-stat .stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}

.achievement-stat .stat-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.recent-achievements h4 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  color: var(--color-text);
  font-weight: 600;
}

.recent-achievement {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--color-background-secondary);
  border-radius: 6px;
  border: 1px solid var(--color-border);
  margin-bottom: 0.5rem;
}

.recent-achievement:last-child {
  margin-bottom: 0;
}

.recent-achievement .achievement-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.recent-achievement .achievement-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
}

.recent-achievement .achievement-date {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.no-achievements {
  text-align: center;
  color: var(--color-text-secondary);
  font-style: italic;
  padding: 2rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .admin-header h1 {
    font-size: 2rem;
  }

  .admin-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .admin-stat-card {
    padding: 1.25rem;
  }

  .admin-stat-card .stat-number {
    font-size: 1.8rem;
  }

  .stat-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .admin-actions {
    grid-template-columns: 1fr;
  }

  .book-progress-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .book-progress-item .progress-info {
    width: 100%;
    justify-content: space-between;
  }

  .progress-bar-mini {
    flex: 1;
    max-width: 120px;
  }

  .achievement-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .achievement-stat {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* User Management Section */
.admin-user-management {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.user-management-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.user-management-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--color-text);
  font-weight: 600;
}

.user-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.user-search-input {
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-text);
  font-size: 0.9rem;
  width: 200px;
  transition: all 0.3s ease;
}

.user-search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
  position: absolute;
  right: 0.75rem;
  color: var(--color-text-secondary);
  pointer-events: none;
}

.user-sort-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.user-sort-select:focus {
  outline: none;
  border-color: var(--accent-color);
}

.refresh-btn {
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.refresh-btn:hover {
  background: var(--color-background-secondary);
  border-color: var(--accent-color);
}

/* User Table */
.user-table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  margin-bottom: 1rem;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-background);
}

.user-table th {
  background: var(--color-background-secondary);
  padding: 1rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.85rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.user-table td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.user-row:hover {
  background: var(--color-background-secondary);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 200px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-color-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-details {
  min-width: 0;
  flex: 1;
}

.user-name {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.user-email {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.inactive {
  background: rgba(239, 68, 68, 0.1);
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-badge.premium {
  background: rgba(245, 158, 11, 0.1);
  color: #D97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-badge.trial {
  background: rgba(139, 92, 246, 0.1);
  color: #7C3AED;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.book-stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.current-books, .paused-books, .completed-books, .deleted-books {
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.2;
}

.current-books {
  background: rgba(59, 130, 246, 0.1);
  color: #2563EB;
}

.paused-books {
  background: rgba(245, 158, 11, 0.1);
  color: #D97706;
}

.completed-books {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.deleted-books {
  background: rgba(239, 68, 68, 0.1);
  color: #DC2626;
}

.user-streak {
  text-align: center;
}

.streak-number {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.125rem;
}

.streak-label {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.login-count {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.login-dots {
  display: flex;
  gap: 0.25rem;
}

.login-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border);
  transition: all 0.3s ease;
}

.login-dot.active {
  background: var(--accent-color);
  box-shadow: 0 0 4px rgba(59, 130, 246, 0.4);
}

.user-last-active {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

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

.action-btn {
  padding: 0.375rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-background);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  background: var(--color-background-secondary);
  border-color: var(--accent-color);
}

.action-btn.view:hover { border-color: #3B82F6; }
.action-btn.edit:hover { border-color: #F59E0B; }
.action-btn.delete:hover { border-color: #EF4444; }

/* Pagination */
.user-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.pagination-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-background);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.pagination-btn:not(:disabled):hover {
  background: var(--color-background-secondary);
  border-color: var(--accent-color);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

/* Analytics Section */
.admin-analytics-section {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.admin-analytics-section h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.3rem;
  color: var(--color-text);
  font-weight: 600;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.analytics-card {
  background: var(--color-background-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
}

.analytics-card h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: var(--color-text);
  font-weight: 600;
}

/* Activity Chart */
.activity-chart-placeholder {
  display: flex;
  align-items: end;
  justify-content: space-between;
  height: 120px;
  padding: 1rem 0;
  gap: 0.5rem;
}

.chart-bar {
  flex: 1;
  background: linear-gradient(to top, var(--accent-color), var(--accent-color-light));
  border-radius: 4px 4px 0 0;
  position: relative;
  min-height: 20px;
  transition: all 0.3s ease;
}

.chart-bar:hover {
  opacity: 0.8;
}

.chart-bar span {
  position: absolute;
  bottom: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--color-text-secondary);
}

/* Trend Stats */
.trend-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.trend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

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

.trend-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.trend-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

/* Top Performers */
.top-performers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.performer-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--color-background);
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.performer-rank {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-color);
  min-width: 30px;
}

.performer-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
}

.performer-stat {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* System Management */
.admin-system-section {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
}

.admin-system-section h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.3rem;
  color: var(--color-text);
  font-weight: 600;
}

.system-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

/* Mobile Responsive for User Management */
@media (max-width: 768px) {
  .user-management-header {
    flex-direction: column;
    align-items: stretch;
  }

  .user-controls {
    flex-direction: column;
    gap: 0.75rem;
  }

  .user-search-input {
    width: 100%;
  }

  .user-table-container {
    font-size: 0.8rem;
  }

  .user-table th,
  .user-table td {
    padding: 0.75rem 0.5rem;
  }

  .user-info {
    min-width: 150px;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .activity-chart-placeholder {
    height: 80px;
  }

  .system-actions {
    grid-template-columns: 1fr;
  }

  .user-pagination {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* User Details Modal */
.user-details-modal {
  z-index: 10001;
}

.user-details-content {
  max-width: 900px;
  width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

.user-details-body {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1.5rem 0;
}

/* User Info Section */
.user-info-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--color-background-secondary);
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.user-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-color-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.user-profile-info {
  flex: 1;
  min-width: 0;
}

.user-profile-info h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  color: var(--color-text);
  font-weight: 600;
}

.user-profile-info .user-email {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: var(--color-text-secondary);
}

.user-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  padding: 1rem;
  background: var(--color-background-secondary);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.user-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.75rem;
  background: var(--color-background);
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.user-stat .stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.user-stat .stat-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* Books Section */
.user-books-section {
  background: var(--color-background-secondary);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.books-tabs {
  display: flex;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
}

.book-tab {
  flex: 1;
  padding: 1rem;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
}

.book-tab:hover {
  background: var(--color-background-secondary);
  color: var(--color-text);
}

.book-tab.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
  background: var(--color-background-secondary);
}

.books-content {
  padding: 1.5rem;
  min-height: 200px;
}

.no-books {
  text-align: center;
  color: var(--color-text-secondary);
  font-style: italic;
  padding: 2rem;
}

.books-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.book-item {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.3s ease;
}

.book-item:hover {
  border-color: var(--accent-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.book-info {
  margin-bottom: 1rem;
}

.book-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

.book-author {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.book-meta span {
  padding: 0.25rem 0.5rem;
  background: var(--color-background-secondary);
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

.book-dates {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.date-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

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

.date-item.deleted {
  color: #DC2626;
  background: rgba(239, 68, 68, 0.05);
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.date-label {
  font-weight: 500;
  color: var(--color-text-secondary);
}

.date-value {
  color: var(--color-text);
}

.deletion-reason {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.book-progress-bar {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 1rem;
}

.book-progress-bar .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-color-light));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Mobile Responsive for User Details */
@media (max-width: 768px) {
  .user-details-content {
    width: 95vw;
    max-height: 95vh;
  }

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

  .user-avatar-large {
    width: 60px;
    height: 60px;
    font-size: 1.4rem;
  }

  .user-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .books-tabs {
    flex-direction: column;
  }

  .book-tab {
    border-bottom: 1px solid var(--color-border);
    border-right: none;
  }

  .book-tab.active {
    border-bottom-color: var(--accent-color);
    border-left: 3px solid var(--accent-color);
  }

  .book-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .date-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

/* ===== NOISE GENERATOR MODAL STYLING ===== */


.noise-generator-modal {
  z-index: 10002;
}

.noise-generator-content {
  max-width: 400px;
  width: 90vw;
  max-height: 85vh;
  background: #2a2a3e;
  border-radius: 16px;
  overflow: hidden;
  border: none;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Header */
.noise-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid #3a3a4e;
}

.noise-header h2 {
  font-size: 0.8rem;
  font-weight: 600;
  color: #8b8b9a;
  letter-spacing: 0.5px;
  margin: 0;
  text-transform: uppercase;
}

.noise-close {
  background: none;
  border: none;
  color: #8b8b9a;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.noise-close:hover {
  color: #ffffff;
}

/* Body */
.noise-body {
  padding: 0;
}

.noise-section {
  padding: 1rem 0 0 0;
}

/* Play/Pause Control */
.play-pause-control {
  display: flex;
  justify-content: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #3a3a4e;
  margin-bottom: 0.5rem;
}

.master-play-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.master-play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.master-play-btn:active {
  transform: scale(0.95);
}

.master-play-btn.playing {
  background: linear-gradient(135deg, #ef4444, #f87171);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.master-play-btn.playing:hover {
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

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

/* Noise Items */
.noise-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.noise-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.noise-item.selected {
  background: rgba(99, 102, 241, 0.2);
  border-left: 3px solid #6366f1;
}

.sound-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  flex-shrink: 0;
}

.sound-icon.white {
  background: linear-gradient(135deg, #ffffff, #e0e0e0);
  color: #333;
}

.sound-icon.pink {
  background: linear-gradient(135deg, #ff6b9d, #ff8fab);
  color: #fff;
}

.sound-icon.brown {
  background: linear-gradient(135deg, #8b4513, #a0522d);
  color: #fff;
}

.sound-icon.tone {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

.sound-name {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  color: #ffffff;
}

/* Timer section styling */
.timer-section {
  margin-bottom: 1rem;
}

.timer-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timer-presets {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.timer-preset-btn,
.timer-custom-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  min-width: 70px;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  justify-content: center;
}

.timer-preset-btn:hover,
.timer-custom-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.timer-preset-btn:active,
.timer-custom-btn:active {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(1px);
}

.timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  animation: timerPulse 2s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
  }
  50% {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.15);
  }
}

.timer-time {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-size: 1.25rem;
  font-weight: 600;
  color: #10b981;
  letter-spacing: 0.05em;
}

.timer-stop-btn {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-stop-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Timer Noise Toggle */
.timer-noise-toggle {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-text-primary);
  user-select: none;
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--color-text-secondary);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #ffffff;
}

.toggle-text {
  font-weight: 500;
  line-height: 1.4;
}

/* Master controls styling */
.master-controls {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.audio-controls-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  min-width: 250px;
}

.master-volume-control,
.reverb-control,
.filter-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.volume-label {
  font-size: 0.875rem;
  color: #9ca3af;
  min-width: 80px;
}

.volume-value {
  font-size: 0.875rem;
  color: #ffffff;
  min-width: 40px;
  text-align: right;
}

.stop-all-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.stop-all-btn:hover {
  background: #dc2626;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
  .master-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .audio-controls-grid {
    min-width: auto;
  }

  .master-volume-control {
    display: none; /* Hide master volume on mobile since it doesn't work */
  }

  .reverb-control,
  .filter-control {
    min-width: auto;
  }

  .stop-all-btn {
    align-self: center;
    min-width: 120px;
  }
}

/* Updated noise item styling for mixing */
.noise-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.5rem;
}

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

.noise-item.selected {
  background: rgba(107, 114, 128, 0.2);
  border-color: #6b7280;
}

.sound-info {
  flex: 1;
  margin-left: 1rem;
}

.sound-name {
  display: block;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.sound-controls {
  margin-top: 0.5rem;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.volume-control .volume-label {
  font-size: 0.75rem;
  min-width: 50px;
}

.volume-control .volume-slider {
  flex: 1;
  max-width: 100px;
}

.volume-control .volume-value {
  font-size: 0.75rem;
  min-width: 35px;
}

.sound-status {
  display: flex;
  align-items: center;
}

.play-pause-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #ffffff;
}

.play-pause-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.play-pause-btn.playing {
  background: #10b981;
}

.play-pause-btn.playing:hover {
  background: #059669;
}

/* Volume slider styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Now Playing Section */
.now-playing {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  padding: 1rem 1.5rem;
  margin-top: 1rem;
}

.now-playing-content {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.sound-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
  color: #ffffff;
}

.now-playing-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.now-playing-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.now-playing-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}

.play-control {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.play-control:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Volume Bar */
.volume-bar {
  margin-top: 1rem;
}

.volume-slider {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .noise-generator-content {
    width: 95vw;
    max-height: 90vh;
  }

  .noise-header {
    padding: 1.25rem 1.25rem 0.75rem 1.25rem;
  }

  .noise-item {
    padding: 0.875rem 1.25rem;
  }

  .sound-icon {
    width: 36px;
    height: 36px;
  }

  .now-playing {
    padding: 0.875rem 1.25rem;
  }

  /* Hide master volume control in noise generator modal on mobile */
  .noise-generator-modal .master-volume-control {
    display: none !important;
  }



  .preset-description {
    font-size: 0.75rem;
  }
}

/* ===== END NOISE GENERATOR MODAL STYLING ===== */

/* ===== EDIT BOOK MODAL STYLING ===== */
.edit-book-modal .modal-content {
  max-width: 500px;
  width: 90vw;
}

.edit-book-content {
  padding: 1.5rem;
}

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

.edit-book-form .form-row {
  display: flex;
  flex-direction: column;
}

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

.edit-book-form label {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 0.9rem;
}

.edit-book-form input[type="text"] {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.edit-book-form input[type="text"]:focus,
.edit-book-form input[type="number"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(77, 142, 255, 0.1);
}

.edit-book-form input[type="number"] {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.field-description {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
  font-style: italic;
}

/* Pace Edit Section */
.pace-edit-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pace-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

.pace-preset-btn {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
}

.pace-preset-btn:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-primary);
}

.pace-preset-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.pace-preset-btn.active:hover {
  background: var(--color-primary-dark);
}

.cover-edit-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--color-bg-secondary);
}

.current-cover {
  flex-shrink: 0;
}

.edit-cover-preview {
  width: 60px;
  height: 80px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.edit-cover-preview.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 1.5rem;
}

.cover-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.cover-actions .btn {
  justify-content: center;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

/* Cover Picker Modal */
.cover-picker-modal .modal-content {
  max-width: 600px;
  width: 90vw;
}

.cover-picker-content {
  padding: 1.5rem;
}

.cover-carousel-container {
  position: relative;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.cover-carousel {
  width: 100%;
  height: 300px;
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.cover-option {
  cursor: pointer;
  transition: transform 0.2s ease;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
}

.cover-option:hover {
  transform: scale(1.05);
  border-color: var(--color-primary);
}

.cover-option .cover-image {
  max-width: 200px;
  max-height: 250px;
  object-fit: cover;
  border-radius: 6px;
}

.typography-cover {
  width: 150px;
  height: 200px;
  background: var(--color-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--color-text-secondary);
}

.carousel-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  pointer-events: none;
}

.carousel-btn {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background-color 0.2s ease;
  pointer-events: all;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

.no-covers {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .edit-book-modal .modal-content {
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
  }

  .edit-book-content {
    padding: 1rem;
  }

  .cover-edit-section {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .current-cover {
    align-self: center;
  }

  .cover-actions {
    flex-direction: row;
  }

  /* Pace presets mobile adjustments */
  .pace-presets {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.375rem;
  }

  .pace-preset-btn {
    padding: 0.625rem 0.75rem;
    font-size: 0.8rem;
  }

  .cover-picker-modal .modal-content {
    width: 95vw;
    max-height: 90vh;
  }

  .cover-picker-content {
    padding: 1rem;
  }

  .cover-carousel {
    height: 250px;
  }

  .carousel-slide {
    padding: 1rem;
  }

  .cover-option .cover-image {
    max-width: 150px;
    max-height: 200px;
  }

  .typography-cover {
    width: 120px;
    height: 160px;
    font-size: 1.5rem;
  }
}

/* ===== END EDIT BOOK MODAL STYLING ===== */

/* ===== TIMER BADGE STYLING ===== */
.timer-badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--color-primary);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  animation: pulse 2s infinite;
}

.timer-badge svg {
  opacity: 0.9;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Mobile timer badge adjustments */
@media (max-width: 768px) {
  .timer-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    gap: 0.25rem;
  }

  .timer-badge svg {
    width: 10px;
    height: 10px;
  }
}

/* ===== END TIMER BADGE STYLING ===== */



/* Admin/User Tab Dropdown Styles */
.user-dropdown-tab {
  position: relative;
}

.user-dropdown-tab .dropdown-arrow,
.user-dropdown-tab .dropdown-arrow-mobile {
  transition: transform 0.2s ease;
  opacity: 0.7;
}

.user-dropdown-tab:hover .dropdown-arrow,
.user-dropdown-tab:hover .dropdown-arrow-mobile {
  opacity: 1;
  transform: rotate(180deg);
}

.admin-user-dropdown {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  min-width: 280px;
  max-width: calc(100vw - 2rem);
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  animation: dropdownFadeIn 0.2s ease;
}

.admin-user-dropdown .dropdown-header {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.admin-user-dropdown .user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-user-dropdown .user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
}

.admin-user-dropdown .user-details {
  flex: 1;
}

.admin-user-dropdown .user-name {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

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

.admin-user-dropdown .dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0;
}

.admin-user-dropdown .dropdown-items {
  padding: 0.5rem 0;
}

.admin-user-dropdown .dropdown-item {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  color: var(--color-text-primary);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-user-dropdown .dropdown-item:hover {
  background: var(--color-bg-secondary);
}

.admin-user-dropdown .dropdown-item.danger {
  color: var(--color-error);
}

.admin-user-dropdown .dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.admin-user-dropdown .dropdown-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile responsive adjustments for admin/user dropdown */
@media (max-width: 768px) {
  .admin-user-dropdown {
    min-width: 260px;
    max-width: calc(100vw - 1rem);
    width: 280px !important;
    /* Positioning handled by JavaScript for mobile */
  }

  .admin-user-dropdown .dropdown-header {
    padding: 0.75rem;
  }

  .admin-user-dropdown .user-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .admin-user-dropdown .dropdown-item {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }

  /* Add upward animation for mobile bottom tabs */
  .admin-user-dropdown.mobile-upward {
    animation: dropdownFadeInUpward 0.2s ease;
  }
}

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

.dropdown-header {
  padding: 1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-details {
  min-width: 0;
  flex: 1;
}

.user-name {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.user-email {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.dropdown-items {
  padding: 0.5rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  border: none;
  background: transparent;
  color: var(--color-text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--color-surface-hover);
  color: var(--color-primary);
}

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

.dropdown-item.danger:hover {
  background: rgba(var(--color-error-rgb), 0.1);
  color: var(--color-error);
}

.dropdown-item svg {
  opacity: 0.7;
  flex-shrink: 0;
}



/* ===== END USER DROPDOWN STYLING ===== */

/* ===== SETTINGS VIEW STYLING ===== */
.settings-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.settings-header {
  text-align: center;
  margin-bottom: 3rem;
}

.settings-header h2 {
  color: var(--color-text-primary);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.settings-header p {
  color: var(--color-text-secondary);
  font-size: 1rem;
}

.settings-sections {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.settings-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.settings-section h3 {
  color: var(--color-text-primary);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5rem;
}

.account-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--color-background);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.info-item label {
  font-weight: 500;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.info-value {
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  background: var(--color-surface);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

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

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

.settings-form label {
  font-weight: 500;
  color: var(--color-text-primary);
  font-size: 0.9rem;
}

.settings-form input {
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.settings-form input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(77, 142, 255, 0.15);
}

.settings-form input::placeholder {
  color: var(--color-text-tertiary);
}

.settings-form .btn {
  align-self: flex-start;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.settings-form .btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(77, 142, 255, 0.2);
}

.settings-form .btn-primary:hover {
  background: #4d8eff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(77, 142, 255, 0.4);
}

.settings-form .btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: 2px solid var(--color-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.settings-form .btn-secondary:hover {
  background: var(--color-background);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

/* Mobile settings adjustments */
@media (max-width: 768px) {
  .settings-container {
    padding: 1rem;
  }

  .settings-header {
    margin-bottom: 2rem;
  }

  .settings-header h2 {
    font-size: 1.5rem;
  }

  .settings-section {
    padding: 1.5rem;
  }

  .settings-sections {
    gap: 1.5rem;
  }

  .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .info-value {
    align-self: stretch;
    text-align: center;
  }

  .settings-form .btn {
    align-self: stretch;
    text-align: center;
  }
}

/* ===== END SETTINGS VIEW STYLING ===== */

/* ===== MOBILE PACE BADGE STYLING ===== */
.mobile-pace-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--color-text-secondary);
  background: var(--color-background);
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  white-space: nowrap;
  margin-top: 0.5rem;
  width: fit-content;
}

.mobile-pace-badge .pace-text {
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* ===== END MOBILE PACE BADGE STYLING ===== */

/* ===== MOBILE CARD LAYOUT STYLING ===== */
.mobile-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.mobile-card-title {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.3;
}

.mobile-days-badge {
  flex-shrink: 0;
  background: var(--color-accent);
  color: white;
  padding: 0.125rem 0.375rem;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
}

.mobile-days-badge .days-numbers {
  color: white;
  font-weight: 700;
}

.mobile-card-bottom {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.mobile-bottom-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.mobile-date-info {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
}

.mobile-info-icon {
  font-size: 0.8rem;
  opacity: 0.8;
}

.mobile-info-text {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.mobile-archived-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.mobile-stat-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Update mobile progress text styling */
.mobile-progress-text {
  font-size: 0.75rem;
  color: var(--color-text-primary);
  text-align: center;
  margin-top: 0.5rem;
}

.mobile-progress-main {
  color: var(--color-text-primary);
}

/* Match desktop number styling */
.mobile-progress-text .progress-numbers {
  color: var(--color-primary);
  font-weight: 600;
}

/* ===== END MOBILE CARD LAYOUT STYLING ===== */

/* ===== LOGIN MODAL STYLING ===== */
.login-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.login-content {
  background: var(--color-background);
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 2px solid var(--color-border);
  animation: loginSlideIn 0.3s ease-out;
}

@keyframes loginSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h2 {
  margin: 0 0 0.5rem 0;
  color: var(--color-text-primary);
  font-size: 1.5rem;
  font-weight: 600;
}

.login-header p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* Auth tabs */
.auth-tabs {
  display: flex;
  background: var(--color-surface);
  border-radius: 8px;
  padding: 0.25rem;
  margin-bottom: 2rem;
  border: 1px solid var(--color-border);
}

.auth-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.auth-tab.active {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 2px 4px rgba(77, 142, 255, 0.2);
}

.auth-tab:hover:not(.active) {
  background: var(--color-background);
  color: var(--color-text-primary);
}

/* Auth forms */
.auth-form {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-form.active {
  display: flex;
}

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

.auth-form label {
  font-weight: 500;
  color: var(--color-text-primary);
  font-size: 0.9rem;
}

.auth-form input {
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-background);
  box-shadow: 0 0 0 3px rgba(77, 142, 255, 0.15);
}

.auth-form input::placeholder {
  color: var(--color-text-tertiary);
}

.auth-form input:invalid {
  border-color: var(--color-error);
}

.auth-btn {
  padding: 0.875rem 1.5rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
  box-shadow: 0 2px 8px rgba(77, 142, 255, 0.2);
}

.auth-btn:hover:not(:disabled) {
  background: #4d8eff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(77, 142, 255, 0.4);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.login-note {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .login-modal {
    padding: 1rem;
    align-items: flex-start;
    overflow-y: auto;
  }

  .login-content {
    padding: 1.25rem;
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: 90vh;
    overflow-y: auto;
    margin-top: 2rem;
    margin-bottom: 2rem;
  }

  .login-header h2 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
  }

  .login-header p {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }

  .auth-tabs {
    margin-bottom: 1.5rem;
  }

  .auth-tab {
    padding: 0.625rem 0.75rem;
    font-size: 0.85rem;
  }

  .auth-form {
    gap: 1.25rem;
  }

  .auth-form input {
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
  }

  .auth-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }

  .login-footer {
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .login-note {
    font-size: 0.75rem;
  }
}

/* Password Reset Specific Styling */
.forgot-password-link {
  text-align: center;
  margin-top: 1rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.link-btn:hover {
  color: #4d8eff;
  background: rgba(77, 142, 255, 0.1);
  text-decoration: underline;
}

.reset-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.reset-header h3 {
  margin: 0 0 0.5rem 0;
  color: var(--color-text-primary);
  font-size: 1.2rem;
  font-weight: 600;
}

.reset-header p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.back-to-login {
  text-align: center;
  margin-top: 1rem;
}

/* Mobile adjustments for password reset */
@media (max-width: 768px) {
  .forgot-password-link {
    margin-top: 0.75rem;
  }

  .link-btn {
    font-size: 0.85rem;
    padding: 0.375rem;
  }

  .reset-header h3 {
    font-size: 1.1rem;
  }

  .reset-header p {
    font-size: 0.85rem;
  }

  .back-to-login {
    margin-top: 0.75rem;
  }
}

/* ===== END LOGIN MODAL STYLING ===== */



/* ===== END ADMIN DASHBOARD STYLING ===== */

/* BOOK METRICS AND READING STATS */
.reading-metrics {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 11px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.metric-label {
  color: var(--color-subtle);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  color: var(--color-text);
  font-weight: 600;
  font-size: 11px;
}

/* PACE INFO STYLING */
.pace-info {
  display: flex;
  gap: 6px;
  margin: 8px 0;
  flex-wrap: wrap;
}

.pace-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-subtle);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pace-badge.pages-per-day {
  color: var(--color-primary);
  background: rgba(77, 142, 255, 0.1);
  border-color: rgba(77, 142, 255, 0.2);
}

.pace-badge.days-remaining {
  color: var(--color-accent);
  background: rgba(56, 211, 159, 0.1);
  border-color: rgba(56, 211, 159, 0.2);
}

/* TABLE STYLES - PROFESSIONAL INTERFACE DESIGN */
.books-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  table-layout: fixed;
}

.books-table thead {
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.books-table th {
  padding: 8px 12px;
  text-align: left;
  font-weight: 500;
  color: var(--color-text-table-header);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-right: 1px solid var(--border-color);
  vertical-align: middle;
  height: 40px;
}

.books-table th:last-child {
  border-right: none;
}

/* Specific header column alignments */
.books-table th.cover-column {
  text-align: center;
  width: 120px;
  padding: 8px 6px;
}

.books-table th.book-column {
  text-align: left;
  min-width: 180px; /* Reduced to accommodate larger covers */
  width: auto;
}

.books-table th.progress-column {
  text-align: center;
  width: 340px; /* Expanded to fill space from removed pace column */
}

.books-table th.completed-column {
  text-align: center;
  width: 140px;
}

.books-table th.pages-column {
  text-align: center;
  width: 80px;
}

.books-table th.avg-column {
  text-align: center;
  width: 80px;
}

.books-table th.actions-column {
  text-align: center;
  width: 200px;
}

.books-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 14px;
  color: var(--color-text-table);
  font-weight: 400;
  height: 180px; /* Ensure consistent row height for larger covers */
}

.books-table td:last-child {
  border-right: none;
}

/* Specific cell alignments to match headers */
.books-table .cover-cell {
  text-align: center;
  padding: 8px !important;
  width: 120px;
  height: 180px;
}

.books-table .book-cell {
  text-align: left;
  vertical-align: middle;
  padding: 16px 12px; /* Adjusted padding for better spacing */
}

.books-table .book-cell .book-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  gap: 4px;
}

.books-table .book-cell .book-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.3;
  margin: 0;
}

.books-table .book-cell .book-author {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.2;
  margin: 0;
}

.books-table .progress-cell {
  text-align: center;
  vertical-align: middle;
  padding: 20px 16px; /* Increased padding for taller rows */
  position: relative;
}

/* Progress cell content wrapper for better alignment */
.progress-cell .progress-bar-wrapper {
  margin-bottom: 0;
}

.progress-cell .progress-info-below {
  margin-top: 6px;
  margin-bottom: 4px;
}

/* Progress badges container */
.progress-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Start date badge - matching mobile info item style */
.start-date-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-secondary);
  background: var(--color-background);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

.start-date-badge .badge-icon {
  font-size: 10px;
  opacity: 0.8;
}

.start-date-badge .badge-text {
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* Pace badge - matching mobile info item style */
.pace-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-secondary);
  background: var(--color-background);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

.pace-badge .badge-icon {
  font-size: 10px;
  opacity: 0.8;
}

.pace-badge .badge-text {
  font-weight: 500;
  color: var(--color-text-secondary);
}

.pace-badge .pace-status {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1;
}

.pace-badge .pace-status.on-track {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.pace-badge .pace-status.behind {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.books-table .completed-cell {
  text-align: center;
}

.books-table .pages-cell {
  text-align: center;
}

.books-table .avg-cell {
  text-align: center;
}

.books-table .actions-cell {
  text-align: center;
}

.books-table tbody tr {
  min-height: 88px; /* Ensure consistent row height for uniform covers */
  transition: background-color 0.15s ease;
}

.books-table tbody tr:hover {
  background: var(--color-bg-secondary);
}

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

.cover-column {
  width: 120px; /* Doubled width for larger book cover display */
  padding: 8px !important; /* Slightly increased padding for larger covers */
  vertical-align: middle; /* Center align for better visual balance */
  height: 180px; /* Doubled height for better book proportions */
}

.book-table-cover {
  width: 96px; /* Doubled book cover width (120px - 24px padding) */
  height: 156px; /* Doubled book cover height (180px - 24px padding) - ~1.6:1 aspect ratio */
  border-radius: 4px; /* Slightly larger rounded corners for bigger covers */
  overflow: hidden;
  background: linear-gradient(145deg, #374151, #4B5563);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25); /* Enhanced shadow for larger covers */
  transition: all 0.2s ease;
  position: relative;
  margin: 0 auto; /* Center the cover in the cell */
}

.book-table-cover:hover {
  transform: translateY(-1px); /* Subtle lift effect */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.book-table-cover img,
.book-table-cover .cover-image {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Contain ensures the full image is visible without cropping */
  object-position: center;
  transition: transform 0.2s ease;
  background: var(--color-surface);
  border-radius: 4px; /* Match container border radius */
  display: block; /* Ensure proper rendering */
}

.book-table-cover:hover img,
.book-table-cover:hover .cover-image {
  transform: scale(1.02); /* Subtle zoom on image */
}

.book-table-cover .placeholder-cover,
.book-table-cover .cover-image.placeholder,
.book-table-cover .book-cover.placeholder {
  font-size: 24px; /* Larger size for the doubled book cover cell */
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px; /* Match container border radius */
}

.book-title-cell {
  line-height: 1.3;
}

.author-subtitle {
  font-size: 11px;
  color: var(--color-text-tertiary);
}

.progress-column {
  width: 340px; /* Expanded to fill space from removed pace column */
}

/* Book column auto-scaling for better layout */
.book-column {
  width: auto;
  min-width: 180px; /* Reduced to accommodate larger covers */
  max-width: none;
}

.book-cell {
  width: auto;
  min-width: 180px; /* Reduced to accommodate larger covers */
  max-width: none;
}



.actions-cell {
  width: 200px;
}

/* ===== AWARDS TAB & GAMIFIED ACHIEVEMENTS SYSTEM ===== */

/* Awards Grid Layout */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
  max-width: none;
}

/* Desktop: 3-4 cards per row */
@media (min-width: 1200px) {
  .awards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) and (max-width: 1199px) {
  .awards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }
}

/* Tablet: 2 cards per row */
@media (min-width: 768px) and (max-width: 1023px) {
  .awards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Mobile: 1 card per row */
@media (max-width: 767px) {
  .awards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Achievement Badge Card */
.achievement-badge {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-height: 196px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

/* Achievement Badge Unlocked State */
.achievement-badge.unlocked {
  background: linear-gradient(135deg, var(--color-surface) 0%, rgba(77, 142, 255, 0.03) 100%);
  border-color: rgba(77, 142, 255, 0.2);
}

.achievement-badge.unlocked::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: 1;
}

/* Achievement Badge Locked State */
.achievement-badge.locked {
  opacity: 0.6;
  background: var(--color-surface);
  filter: grayscale(60%);
  position: relative;
}

.achievement-badge.locked::after {
  content: '🔒';
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.2rem;
  opacity: 0.7;
}

.achievement-badge.locked .achievement-icon {
  opacity: 0.5;
}

.achievement-badge.locked .achievement-title {
  color: var(--color-subtle);
}

.achievement-badge.locked .achievement-description {
  color: var(--color-subtle);
}

/* Achievement Badge Hover Effects */
.achievement-badge:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.achievement-badge.unlocked:hover {
  box-shadow: 0 12px 40px rgba(77, 142, 255, 0.2);
}

.achievement-badge.locked:hover {
  transform: translateY(-4px);
  opacity: 0.8;
}

/* Achievement Icon */
.achievement-icon {
  font-size: 2.2rem;
  margin-bottom: 0.7rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  width: 56px;
  margin: 0 auto 0.7rem auto;
  transition: all 0.3s ease;
}

.achievement-badge.unlocked .achievement-icon {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  box-shadow: 0 4px 16px rgba(77, 142, 255, 0.3);
}

.achievement-badge.locked .achievement-icon {
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-subtle);
}

/* Achievement Content */
.achievement-content, .achievement-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.achievement-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.achievement-badge.unlocked .achievement-title {
  color: var(--color-primary);
}

.achievement-description {
  font-size: 0.85rem;
  color: var(--color-subtle);
  line-height: 1.4;
  flex: 1;
}

/* Achievement Progress (for progressive achievements) */
.achievement-progress {
  margin-top: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.achievement-badge.unlocked .achievement-progress {
  opacity: 1;
}

.achievement-progress-bar, .progress-bar {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 10px;
  transition: width 0.6s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--color-subtle);
  text-align: center;
}

/* Achievements Grid within Categories */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

/* Desktop: 3-4 cards per row for achievements grid */
@media (min-width: 1200px) {
  .achievements-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) and (max-width: 1199px) {
  .achievements-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }
}

/* Tablet: 2 cards per row for achievements grid */
@media (min-width: 768px) and (max-width: 1023px) {
  .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Mobile: 1 card per row for achievements grid */
@media (max-width: 767px) {
  .achievements-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.achievement-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 10px;
  transition: width 0.6s ease;
}

.achievement-progress-text {
  font-size: 0.75rem;
  color: var(--color-subtle);
  text-align: center;
}

/* Achievement Date Unlocked */
.achievement-date, .achievement-unlocked-date {
  font-size: 0.75rem;
  color: var(--color-subtle);
  margin-top: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.achievement-badge.unlocked .achievement-date,
.achievement-badge.unlocked .achievement-unlocked-date {
  opacity: 1;
  color: var(--color-primary);
}

/* Achievement Checkmark */
.achievement-checkmark {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--color-success);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(56, 211, 159, 0.3);
}

/* Awards Section Header */
.awards-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 2rem;
  color: var(--color-text);
  margin-bottom: 1rem;
}

/* Achievement Stats */
.achievement-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.stat-badge {
  background: var(--color-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 100px;
  transition: all 0.3s ease;
}

.stat-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--color-primary);
}

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-subtle);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.awards-container {
  margin-top: 3rem;
}

/* Main Trophies View Container */
#trophiesView {
  padding: 0;
  min-height: 400px;
}

/* Awards Section Header */
.awards-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.awards-header h2 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.awards-stats {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.awards-counter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(77, 142, 255, 0.3);
}

.awards-percentage {
  font-size: 0.8rem;
  color: var(--color-subtle);
  font-weight: 500;
}

/* Achievement Categories */
.achievement-category {
  margin-bottom: 3rem;
}

.category-header {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 1rem;
  padding-left: 0.5rem;
  border-left: 4px solid var(--color-primary);
}

/* Achievement Unlock Animation */
@keyframes achievementUnlock {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
    }
}

.achievement-badge.newly-unlocked {
  animation: achievementUnlock 0.6s ease-out;
}

/* Glow effect for newly unlocked achievements */
.achievement-badge.newly-unlocked::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--color-primary), var(--color-accent), var(--color-primary));
  border-radius: 18px;
  z-index: -1;
  opacity: 0.6;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.3;
  }
}

/* Empty State for Awards */
.awards-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-subtle);
  background: var(--color-surface);
  border-radius: 16px;
  border: 2px dashed var(--border-color);
  margin: 2rem 0;
}

.awards-empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.awards-empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.awards-empty-state p {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto;
}

/* Notification Styles for Achievement Unlocks */
.notification.achievement {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  border: none;
}

/* ==============================================
   ENHANCED ADD BOOK TAB STYLES
   ============================================== */

/* Main Container Layout */
.add-book-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Book Preview Panel */
.book-preview-panel {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.preview-card {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.preview-cover-container {
    position: relative;
    width: 200px;
    height: 280px;
    margin: 0 auto 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-background);
}

/* Cover Carousel Styles */
.cover-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
    cursor: grab;
}

.cover-carousel:active {
    cursor: grabbing;
}

.cover-carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.cover-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: var(--color-surface);
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

.cover-slide img[src=""] {
    opacity: 0.5;
}

/* Carousel Navigation */
.carousel-nav {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.carousel-dots {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    backdrop-filter: blur(8px);
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.carousel-dot.active {
    background: white;
    transform: scale(1.2);
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Swipe Hint */
.swipe-hint {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    animation: swipeHintPulse 2s ease-in-out infinite;
    max-width: 70%;
    text-align: center;
}

@keyframes swipeHintPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.swipe-text {
    white-space: nowrap;
}

.preview-cover-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: var(--color-surface);
}

.preview-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #374151, #4B5563);
    color: #9CA3AF;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.placeholder-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Cover Loading Placeholder */
.cover-loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--color-background);
    color: var(--color-text-secondary);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-border);
    border-top: 2px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
}

.loading-text {
    font-size: 0.8rem;
    font-weight: 500;
}

.preview-details {
    text-align: center;
}

.preview-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--color-text);
    line-height: 1.3;
}

.preview-author {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin: 0 0 1.5rem;
    font-style: italic;
}

.preview-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--color-background);
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Slot Machine in Preview */
.slot-machine-stat {
    background: var(--color-surface);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.5rem;
}

.slot-machine-display-inline {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}





/* Book Form Panel */
.book-form-panel {
    min-width: 0; /* Prevent overflow */
}

.book-form-enhanced {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary-light);
    text-align: center;
}

/* Enhanced Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

/* Reading pace section gets extra padding */
.form-group:has(label[for="paceControl"]) {
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

/* Fallback for browsers that don't support :has() */
.pace-form-group {
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Autocomplete System */
.autocomplete-group {
    position: relative;
}

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--color-background);
    color: var(--color-text);
    transition: all 0.2s ease;
}

.autocomplete-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.autocomplete-spinner {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border);
    border-top: 2px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    /* Enhanced mobile support */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
    color: var(--color-text);
    transition: background-color 0.15s ease;
    /* Enhanced mobile touch support */
    min-height: 44px;
    display: flex;
    align-items: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

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

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.autocomplete-item strong {
    color: var(--color-primary);
    font-weight: 600;
}

/* Numeric Input Wrapper */
.numeric-input-wrapper {
    position: relative;
}

.numeric-input-wrapper input {
    width: 100%;
    padding: 0.75rem 4rem 0.75rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--color-background);
    color: var(--color-text);
    transition: all 0.2s ease;
    /* Hide number input spinner arrows */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

/* Hide webkit spinner arrows for numeric input wrapper */
.numeric-input-wrapper input::-webkit-outer-spin-button,
.numeric-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.numeric-input-wrapper input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.input-suffix {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
       color: var(--color-text-secondary);
    font-weight: 500;
    pointer-events: none;
}

/* Cover Picker Section */
.cover-picker-section {
    border: 2px dashed var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    background: var(--color-background);
    transition: border-color 0.2s ease;
}

.cover-picker-section:hover {
    border-color: var(--color-primary);
}

.cover-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.cover-search-btn:hover:not(:disabled) {
    background: var(--color-primary-dark);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.cover-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-spinner {
    position: absolute;
    right: 0.75rem;
}

.spinner-small {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}



/* Enhanced Pace Control */
.pace-control-enhanced {
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 1rem;
    background: var(--color-background);
}

.pace-preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.pace-preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    background: var(--color-background);
    border: 2px solid var(--color-primary-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pace-preset-btn:hover {
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: var(--color-surface);
}

.pace-preset-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(77, 142, 255, 0.3);
}

.pace-number {
    font-size: 1.25rem;
    font-weight: 700;
    line-height:   1;
    margin-bottom: 0.25rem;
}

.pace-label {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.8;
}

.custom-pace-section {
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
}

.custom-pace-input-wrapper {
    position: relative;
    min-width: 280px;
    max-width: 100%;
    flex: 1;
}

.custom-pace-input-wrapper input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--color-background);
    color: var(--color-text-input);
    transition: all 0.2s ease;
    /* Hide number input spinner arrows */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

/* Hide webkit spinner arrows */
.custom-pace-input-wrapper input::-webkit-outer-spin-button,
.custom-pace-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.custom-pace-input-wrapper input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.pace-unit {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    pointer-events: none;
}

/* Estimated Time Section */
.estimated-time-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
}

.estimated-time-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Countdown Container */
.countdown-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Countdown Cards */
.countdown-card {
    background: #48484a;
    border-radius: 12px;
    padding: 1rem 0.75rem;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.countdown-card:hover {
    transform: translateY(-2px);
}

.countdown-number {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 0.5rem;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
}

.countdown-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #999;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Countdown Animation */
.countdown-number.counting {
    animation: countingPulse 0.8s ease-out;
}

@keyframes countingPulse {
    0% {
        transform: scale(1);
        color: #fff;
    }
    50% {
        transform: scale(1.1);
        color: #f0f0f0;
    }
    100% {
        transform: scale(1);
        color: #fff;
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .countdown-container {
        gap: 0.75rem;
    }

    .countdown-card {
        min-width: 70px;
        padding: 0.75rem 0.5rem;
    }

    .countdown-number {
        font-size: 1.75rem;
    }

    .countdown-label {
        font-size: 0.7rem;
    }
}







/* Floating particles effect */
.estimated-time-display::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 50%;
    opacity: 0;
    animation: floatingParticle 4s infinite;
}

@keyframes floatingParticle {
    0% {
        transform: translateY(20px) translateX(-10px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0;
    }
}

/* Enhanced Date Input */
.custom-date-input-wrapper.enhanced {
    position: relative;
    max-width: 250px;
    margin: 0 auto;
    width: 100%;
}

.custom-date-input-wrapper.enhanced input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--color-background);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-date-input-wrapper.enhanced input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
    animation: dateInputFocus 0.2s ease-out;
}

@keyframes dateInputFocus {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.custom-date-input-wrapper.enhanced .date-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
}

/* Enhanced Form Actions */
.form-actions-enhanced {
    display: flex;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    min-width: 140px;
    justify-content: center;
}

.btn-large .btn-spinner {
    position: absolute;
    right: 1rem;
}



/* ===== MOBILE RESPONSIVENESS FOR NEW FEATURES ===== */
@media (max-width: 768px) {
    /* Enhanced Mobile Quote Styling */
    .inspiring-quote-card {
        margin: 1.5rem 0;
        padding: 1.25rem;
    }
    
    .quote-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        align-items: center;
    }
    
    .quote-content {
        padding-right: 0;
        text-align: center;
    }
    
    .quote-text {
        font-size: 1.1rem;
        line-height: 1.5;
        padding-left: 0;
        text-align: center;
    }
    
    .quote-text::before {
        display: none; /* Hide decorative quote mark on mobile for cleaner look */
    }
    
    .quote-author {
        text-align: center;
        padding-left: 0;
        font-size: 0.9rem;
    }
    
    .quote-author::before {
        display: none; /* Hide decorative line on mobile */
    }
    
    .quote-refresh-btn {
        margin-top: 0.5rem;
        width: 2.5rem;
        height: 2.5rem;
    }

    /* Mobile autocomplete improvements */
    .autocomplete-dropdown {
        max-height: 250px;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    }

    .autocomplete-item {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
    }

    .autocomplete-item:active {
        background: var(--color-primary-light);
        transform: scale(0.98);
    }
    
    .refresh-icon {
        font-size: 1rem;
    }
    

}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .inspiring-quote-card {
        margin: 1rem 0;
        padding: 1rem;
    }
    
    .quote-text {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .quote-author {
        font-size: 0.85rem;
    }
    
    .quote-refresh-btn {
        width: 2.25rem;
        height: 2.25rem;
    }
}



/* Responsive pace control grid adjustments */
@media (max-width: 480px) {
    .pace-preset-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .pace-preset-btn {
        padding: 0.5rem 0.25rem;
    }
    
    .pace-number {
        font-size: 1rem;
    }
    
    .pace-label {
        font-size: 0.65rem;
    }
    
    .custom-pace-input-wrapper {
        min-width: 240px;
        max-width: 100%;
    }
}

@media (max-width: 320px) {
    .pace-preset-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .pace-preset-btn {
        padding: 0.5rem 0.25rem;
        min-height: 50px;
    }
    
    .custom-pace-input-wrapper {
        min-width: 200px;
        max-width: 100%;
    }
}

/* Archive Status Labels */
.archive-status-label {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  margin: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.archive-status-label.completed {
  background: rgba(56, 211, 159, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(56, 211, 159, 0.3);
}

.archive-status-label.paused {
  background: rgba(255, 179, 71, 0.15);
  color: var(--color-warning);
  border: 1px solid rgba(255, 179, 71, 0.3);
}

/* Archive Status Labels in Grid View */
.book-stats .archive-status-label {
  margin-top: 8px;
  align-self: flex-start;
}

/* Archive Status Labels in Table View */
.books-table .archive-status-label {
  margin: 0;
  padding: 3px 8px;
  font-size: 10px;
}

/* ==============================================
   INSPIRATIONAL QUOTES STYLING
   ============================================== */

/* Main Quote Card Container */
.inspiring-quote-card {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem 0;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.inspiring-quote-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    opacity: 0.8;
}

.inspiring-quote-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Quote Container Layout */
.quote-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    transition: opacity 0.3s ease;
}

/* Quote Content Area */
.quote-content {
    flex: 1;
    padding-right: 1rem;
}

/* Quote Text Styling */
.quote-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-text-primary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    font-style: italic;
    position: relative;
    padding-left: 1.5rem;
}

.quote-text::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -0.25rem;
    font-size: 2.5rem;
    color: var(--color-primary);
    font-weight: 700;
    line-height: 1;
    opacity: 0.6;
    font-family: 'Times New Roman', serif;
}

/* Quote Author Styling */
.quote-author {
    font-size: 1rem;
    color: var(--color-text-secondary);
    font-weight: 600;
    text-align: left;
    padding-left: 1.5rem;
    position: relative;
}

.quote-author::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 1px;
}

/* Refresh Button Styling */
.quote-refresh-btn {
    background: var(--color-background);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.quote-refresh-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 142, 255, 0.3);
}

.quote-refresh-btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

/* Refresh Icon */
.refresh-icon {
    font-size: 1.2rem;
    transition: all 0.2s ease;
    color: var(--color-text-secondary);
}

.quote-refresh-btn:hover .refresh-icon {
    color: white;
    transform: rotate(180deg);
}

/* Loading State for Quote Refresh */
.quote-refresh-btn.loading .refresh-icon {
    animation: spin 1s linear infinite;
}

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

/* Quote Fade Transition */
.quote-container.fading {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

/* Special Styling for Different Quote Types */
.inspiring-quote-card.featured {
    background: linear-gradient(135deg, var(--color-surface) 0%, rgba(77, 142, 255, 0.03) 100%);
    border-color: rgba(77, 142, 255, 0.2);
}

.inspiring-quote-card.featured::before {
    height: 6px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent), var(--color-primary));
    background-size: 200% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Enhanced Typography for Quotes */
.quote-text {
    font-family: 'Poppins', 'Georgia', serif;
    letter-spacing: 0.3px;
}

.quote-author {
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* Accessibility Improvements */
.quote-refresh-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-primary-light);
    border-color: var(--color-primary);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .quote-text {
        color: var(--color-text-high-contrast);
        font-weight: 600;
    }
    
    .quote-author {
        color: var(--color-text-high-contrast);
    }
    
    .inspiring-quote-card {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .inspiring-quote-card {
        transition: none;
    }

    .quote-refresh-btn:hover .refresh-icon {
        transform: none;
    }

    .quote-refresh-btn.loading .refresh-icon {
        animation: none;
    }

    .inspiring-quote-card.featured::before {
        animation: none;
    }
}

/* ===== MOBILE ADD BOOK FORM LAYOUT ===== */
/* Mobile responsive layout for Add Book tab (≤768px) */
@media (max-width: 768px) {
    /* Transform grid layout to vertical stacking */
    .add-book-container {
        display: block !important;
        grid-template-columns: none !important;
        padding: 1rem !important;
        gap: 1.5rem !important;
        max-width: 100% !important;
    }

    /* Book preview panel - remove sticky positioning */
    .book-preview-panel {
        position: static !important;
        margin-bottom: 1.5rem !important;
        width: 100% !important;
    }

    /* Book form panel - full width */
    .book-form-panel {
        width: 100% !important;
        min-width: auto !important;
    }

    /* Form sections - card-style spacing */
    .book-form-enhanced {
        padding: 1.5rem !important;
        margin-bottom: 0 !important;
    }

    /* Form rows - stack vertically instead of side-by-side */
    .form-row {
        display: block !important;
        grid-template-columns: none !important;
        gap: 1rem !important;
    }

    /* Form groups - proper mobile spacing */
    .form-row .form-group {
        margin-bottom: 1rem !important;
    }

    .form-row .form-group:last-child {
        margin-bottom: 0 !important;
    }

    /* Enhanced touch targets for mobile */
    .autocomplete-input,
    .numeric-input-wrapper input,
    .custom-date-input-wrapper input {
        padding: 0.875rem 1rem !important;
        font-size: 16px !important; /* Prevent iOS zoom */
        min-height: 48px !important;
        border-radius: 8px !important;
    }

    /* Numeric input wrapper mobile adjustments */
    .numeric-input-wrapper input {
        padding-right: 4rem !important;
    }

    /* Form actions - stack vertically */
    .form-actions-enhanced {
        flex-direction: column !important;
        gap: 0.75rem !important;
        margin-top: 1.5rem !important;
    }

    /* Buttons - full width on mobile */
    .form-actions-enhanced .btn {
        width: 100% !important;
        min-height: 48px !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 16px !important;
        justify-content: center !important;
    }

    /* Section titles - better mobile spacing */
    .section-title {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
        padding-bottom: 0.5rem !important;
    }

    /* Preview card mobile optimizations */
    .preview-card {
        padding: 1.25rem !important;
        text-align: center !important;
    }

    /* Cover container mobile sizing */
    .preview-cover-container {
        width: 160px !important;
        height: 224px !important;
        margin: 0 auto 1rem !important;
    }

    /* Mobile carousel adjustments */
    .carousel-dots {
        gap: 4px !important;
        padding: 4px 8px !important;
    }

    .carousel-dot {
        width: 5px !important;
        height: 5px !important;
    }

    .swipe-hint {
        font-size: 0.7rem !important;
        padding: 4px 8px !important;
        top: 8px !important;
    }

    /* Preview stats mobile layout */
    .preview-stats {
        gap: 0.5rem !important;
    }

    .stat-item {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.85rem !important;
    }

    /* Pace control mobile adjustments */
    .pace-preset-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    .pace-preset-btn {
        min-height: 48px !important;
        padding: 0.75rem 0.5rem !important;
    }


}

/* Small mobile devices (≤480px) - Additional optimizations */
@media (max-width: 480px) {
    .add-book-container {
        padding: 0.75rem !important;
        gap: 1rem !important;
    }

    .book-form-enhanced {
        padding: 1rem !important;
        border-radius: 12px !important;
    }

    .preview-card {
        padding: 1rem !important;
    }

    .preview-cover-container {
        width: 140px !important;
        height: 196px !important;
    }

    /* Extra small mobile carousel adjustments */
    .swipe-hint {
        font-size: 0.65rem !important;
        padding: 3px 6px !important;
    }

    .carousel-dots {
        gap: 3px !important;
        padding: 3px 6px !important;
    }

    .section-title {
        font-size: 0.95rem !important;
    }

    .form-group label {
        font-size: 0.9rem !important;
    }

    /* Tighter spacing for small screens */
    .form-group {
        margin-bottom: 1rem !important;
    }

    .form-section {
        margin-bottom: 1.5rem !important;
    }

    /* Estimated time section mobile adjustments */
    .estimated-time-section {
        padding: 0.75rem !important;
        margin-top: 0.75rem !important;
    }

    .estimated-time-label {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }



    /* Calendar width matches pace control on mobile */
    .custom-date-input-wrapper.enhanced {
        max-width: 280px !important;
        width: calc(100% - 2rem) !important;
        margin: 0 auto !important;
    }

    .custom-date-input-wrapper.enhanced input {
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* ===== MOBILE CURRENT BOOKS RECTANGULAR CARDS ===== */
/* Mobile table-like rectangular card layout for Current Books (≤768px) */
@media (max-width: 768px) {


    /* Show mobile rectangular cards */
    .books-mobile-cards {
        display: block !important;
    }

    /* Hide table view on mobile */
    .books-table-container {
        display: none !important;
    }
}

/* Mobile rectangular card container */
.books-mobile-cards {
    display: none; /* Hidden by default, shown on mobile */
    gap: 0.75rem;
    padding: 0;
}

/* Individual mobile rectangular card */
.book-card-mobile {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
    min-height: 125px; /* 25% taller than current: 100px * 1.25 = 125px */
}

.book-card-mobile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: var(--color-primary-light);
}

/* Mobile card cover thumbnail - Larger size */
.mobile-cover-thumbnail {
    width: 60px; /* Increased from 48px */
    height: 80px; /* Increased from 64px */
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--color-background);
    border: 1px solid var(--color-border);
}

.mobile-cover-thumbnail img,
.mobile-cover-thumbnail .book-cover {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 6px;
}

.mobile-cover-thumbnail .book-cover.placeholder {
    background: linear-gradient(145deg, #374151, #4B5563);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #9CA3AF;
    font-weight: 600;
}

/* Mobile card main content */
.mobile-card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Mobile card header (title and author) */
.mobile-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-card-author {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile card progress section - Compact design */
.mobile-card-progress {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mobile-progress-bar {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb); /* Modern gradient background like desktop */
    border-radius: 2px; /* Slightly rounded for modern look */
    height: 24px; /* Twice as tall like desktop */
    overflow: hidden;
    width: 100%;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06); /* Subtle inset shadow */
    border: 1px solid #d1d5db; /* Clean border */
}

.mobile-progress-fill {
    background: #3B82F6; /* Blue color to match desktop numbers */
    height: 100%;
    border-radius: 2px; /* Match container */
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth easing like desktop */
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3); /* Subtle glow like desktop */
}

/* Gleam animation for mobile progress bars - matches desktop */
.progress-gleam-active .mobile-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: gleamAnimation 2.5s ease-in-out infinite;
    animation-delay: 0.5s;
}



/* Compact mobile info sections */
.mobile-card-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.mobile-info-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    background: var(--color-background);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    white-space: nowrap;
}

.mobile-info-icon {
    font-size: 0.65rem;
    opacity: 0.8;
}

.mobile-info-value {
    font-weight: 600;
    color: #3B82F6; /* Blue color for calculated numbers */
}

.mobile-info-label {
    font-size: 0.65rem;
    opacity: 0.9;
}

/* Mobile card actions */
.mobile-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
    min-width: 80px;
}

.mobile-action-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-decoration: none;
}

.mobile-action-btn.btn-primary {
    background: #00C9A7;
    color: white;
    border: 1px solid #00C9A7;
}

.mobile-action-btn.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.mobile-action-btn.btn-success {
    background: #10B981;
    color: white;
    border: 1px solid #10B981;
}

.mobile-action-btn.btn-warning {
    background: #F59E0B;
    color: white;
    border: 1px solid #F59E0B;
}

.mobile-action-btn.btn-danger {
    background: #EF4444;
    color: white;
    border: 1px solid #EF4444;
}

.mobile-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Mobile card pace info - Compact design */
.mobile-pace-info {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.1rem;
}

.mobile-pace-value {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.7rem;
}

.mobile-pace-status {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 6px;
    font-weight: 500;
    line-height: 1;
}

.mobile-pace-status.on-track {
    background: rgba(56, 211, 159, 0.15);
    color: var(--color-success);
}

.mobile-pace-status.behind {
    background: rgba(255, 179, 71, 0.15);
    color: var(--color-warning);
}

/* Small mobile devices (≤480px) - Mobile cards optimizations */
@media (max-width: 480px) {
    .book-card-mobile {
        padding: 0.75rem !important;
        gap: 0.75rem !important;
        min-height: 110px !important; /* 25% taller than current: 88px * 1.25 = 110px */
    }

    .tab-content {
        padding: 16px 4px !important; /* Even less side padding on small screens */
    }

    .mobile-cover-thumbnail {
        width: 50px !important; /* Increased from 40px */
        height: 70px !important; /* Increased from 56px */
    }

    .mobile-card-title {
        font-size: 0.9rem !important;
    }

    .mobile-card-author {
        font-size: 0.8rem !important;
    }

    .mobile-card-actions {
        min-width: 70px !important;
    }

    .mobile-action-btn {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.75rem !important;
        min-height: 32px !important;
    }

    .mobile-progress-text {
        font-size: 0.7rem !important;
    }

    .mobile-pace-info {
        font-size: 0.7rem !important;
    }
}

/* Very small mobile devices (≤320px) - Ultra compact */
@media (max-width: 320px) {
    .book-card-mobile {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        min-height: 95px !important; /* Adjusted for very small screens */
    }

    .tab-content {
        padding: 16px 2px !important; /* Minimal side padding on very small screens */
    }

    .mobile-cover-thumbnail {
        width: 45px !important; /* Increased from 36px */
        height: 60px !important; /* Increased from 48px */
        align-self: flex-start !important;
    }

    .mobile-card-content {
        width: 100% !important;
    }

    .mobile-card-actions {
        width: 100% !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        min-width: auto !important;
    }

    .mobile-action-btn {
        flex: 1 !important;
        margin: 0 0.125rem !important;
    }
}

/* ===== MOBILE VIEWPORT AND SCALING OPTIMIZATION ===== */
/* Prevent horizontal scrolling and ensure perfect mobile scaling */
@media (max-width: 768px) {
  /* Root level mobile optimizations */
  html {
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
  }

  body {
    overflow-x: hidden !important;
    width: 100vw !important;
    max-width: 100vw !important;
    position: relative !important;
  }

  /* Ensure all containers respect viewport width */
  .container,
  .section,
  .card,
  .modal,
  .dropdown,
  .form-group,
  .input-group,
  .button-group {
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* Fix any elements that might cause horizontal overflow */
  * {
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* Ensure text doesn't overflow */
  .book-title,
  .book-author,
  .user-name,
  .user-email,
  h1, h2, h3, h4, h5, h6,
  p, span, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  /* Fix input fields */
  input,
  textarea,
  select,
  .form-control {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  /* Fix buttons */
  .btn,
  button {
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
  }

  /* Fix dropdowns and modals */
  .dropdown-menu,
  .modal-content,
  .admin-user-dropdown {
    max-width: calc(100vw - 1rem);
    box-sizing: border-box;
  }

  /* Fix tables */
  .books-table,
  .user-table,
  table {
    max-width: 100%;
    table-layout: fixed;
    word-wrap: break-word;
  }

  /* Fix grid layouts */
  .grid,
  .awards-grid,
  .achievements-grid,
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Fix flex layouts */
  .flex-container {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Ensure images don't overflow */
  img,
  .cover-image,
  .book-cover {
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }

  /* Fix progress bars */
  .progress-container,
  .progress-bar,
  .mobile-progress-bar {
    max-width: 100%;
    overflow: hidden;
  }

  /* Fix any remaining overflow issues */
  .tab-content,
  .section-content,
  .book-card,
  .mobile-book-card {
    max-width: 100%;
    overflow-x: hidden;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    box-sizing: border-box;
  }

  /* Prevent zoom on input focus (iOS Safari) */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important; /* Prevents iOS zoom */
    -webkit-appearance: none !important;
    appearance: none !important;
    border-radius: 8px !important;
  }

  /* Ensure header stays at top and is always visible */
  header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  /* Ensure main content doesn't overflow */
  main {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding-bottom: 80px !important; /* Space for bottom navigation */
  }

  /* Bottom navigation positioning */
  .tab-bar-bottom {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    z-index: 1000 !important;
  }
}
