/* ========================================
   LIGHTWEIGHT PRODUCT UI DESIGN SYSTEM
   Enterprise PDF Book Platform
======================================== */

:root {
  /* Enhanced Color Palette */
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-surface: #1e1e1e;
  --bg-elevated: #282828;
  --bg-input: #1a1a1a;
  --bg-hero: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #b8b8b8;
  --text-tertiary: #888888;
  --text-muted: #666666;
  
  /* Accent Colors */
  --accent-primary: #4a9eff;
  --accent-hover: #3d8bdb;
  --accent-subtle: rgba(74, 158, 255, 0.08);
  --accent-glow: rgba(74, 158, 255, 0.2);
  --accent-glow-soft: rgba(74, 158, 255, 0.12);
  --accent-glow-subtle: rgba(74, 158, 255, 0.06);
  --accent-glow-focus: rgba(74, 158, 255, 0.25);
  
  /* Borders & Dividers */
  --border-primary: #2a2a2a;
  --border-secondary: #3a3a3a;
  --border-focus: var(--accent-primary);
  --divider: linear-gradient(90deg, transparent 0%, var(--border-primary) 50%, transparent 100%);
  
  /* Status Colors */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  
  /* Spacing Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  
  /* Typography */
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 32px;
  --font-size-4xl: 40px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Shadows & Glows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --glow-subtle: 0 0 20px var(--accent-glow);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========================================
   RESET & BASE STYLES
======================================== */

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

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========================================
   TYPOGRAPHY SYSTEM
======================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { 
  font-size: var(--font-size-4xl); 
  font-weight: 700;
}
h2 { 
  font-size: var(--font-size-3xl); 
  font-weight: 600;
}
h3 { 
  font-size: var(--font-size-2xl); 
}
h4 { 
  font-size: var(--font-size-xl); 
}
h5 { 
  font-size: var(--font-size-lg); 
}
h6 { 
  font-size: var(--font-size-base); 
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

/* ========================================
   TECH HEADER AND CONTENT SECTIONS
======================================== */

.tech-header-section {
  padding: var(--space-6) 0 var(--space-4) 0;
  position: relative;
}

.tech-books-section {
  padding: var(--space-2) 0;
  position: relative;
}

.about-section {
  padding: var(--space-4) 0;
  position: relative;
}

/* ========================================
   LAYOUT SYSTEM
======================================== */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.section {
  padding: var(--space-6) 0;
  position: relative;
}

.section-divider {
  height: 1px;
  background: var(--divider);
  margin: var(--space-4) 0;
  opacity: 0.6;
}

.grid {
  display: grid;
  gap: var(--space-6);
}

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

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

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

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

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* ========================================
   NAVIGATION WITH ANIMATIONS
======================================== */

.navbar {
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-primary);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 64px;
  transition: all var(--transition-smooth);
}

.navbar.scrolled {
  background: rgba(10, 10, 10, 0.98);
  box-shadow: var(--shadow-md);
}

.navbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.navbar-brand {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.navbar-brand:hover {
  transform: scale(1.02);
}

.navbar-brand i {
  color: var(--accent-primary);
  font-size: 1.2em;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  margin: 0 auto;
  padding: 0;
}

.navbar-auth {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.nav-link {
  padding: var(--space-2) var(--space-4);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-surface);
  transform: translateY(-1px);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent-primary);
  border-radius: 1px;
}

/* ========================================
   ENHANCED BUTTON SYSTEM
======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left var(--transition-smooth);
}

.btn:hover::before {
  left: 100%;
}

.btn:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-hover) 100%);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #2d7bc7 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-secondary);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--font-size-base);
  font-weight: 700;
}

/* ========================================
   ENHANCED CARD SYSTEM
======================================== */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-smooth);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.card:hover {
  border-color: var(--border-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card:hover::before {
  opacity: 0.6;
}

.card-header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-secondary);
}

.card-body {
  padding: var(--space-5);
}

.card-footer {
  padding: var(--space-5);
  border-top: 1px solid var(--border-primary);
  background: var(--bg-secondary);
}

/* ========================================
   ENHANCED FORM SYSTEM
======================================== */

.form-group {
  margin-bottom: var(--space-5);
  position: relative;
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  transition: color var(--transition-fast);
}

.form-control {
  width: 100%;
  padding: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-subtle);
  transform: translateY(-1px);
}

.form-control::placeholder {
  color: var(--text-muted);
  transition: opacity var(--transition-fast);
}

.form-control:focus::placeholder {
  opacity: 0.7;
}

.form-group:focus-within .form-label {
  color: var(--accent-primary);
}

/* ========================================
   IMAGE LOADING STATES
======================================== */

.book-cover img.loading,
.book-cover-large img.loading {
  opacity: 0;
  transition: opacity var(--transition);
}

.book-cover img,
.book-cover-large img {
  opacity: 1;
  transition: opacity var(--transition);
}

/* Ensure images don't show broken state */
.book-cover img[src=""],
.book-cover img:not([src]),
.book-cover-large img[src=""],
.book-cover-large img:not([src]) {
  display: none;
}

/* ========================================
   BOOK COMPONENTS - PDF PLATFORM FOCUSED
======================================== */

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-6);
  padding: var(--space-4) 0;
}

.book-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 380px;
  position: relative;
}

.book-card:hover {
  border-color: var(--border-secondary);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.book-cover {
  width: 100%;
  height: 240px;
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: var(--space-3);
}

.book-cover img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  transition: transform var(--transition);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.book-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-4);
}

.book-cover-placeholder i {
  font-size: 3rem;
  margin-bottom: var(--space-2);
  opacity: 0.6;
}

.book-cover-placeholder .placeholder-text {
  font-size: var(--font-size-sm);
  font-weight: 500;
  opacity: 0.8;
}

.book-info {
  padding: var(--space-4);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.book-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-author {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.book-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.book-category {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  background-color: var(--bg-elevated);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
}

.book-format {
  font-size: var(--font-size-xs);
  color: var(--accent-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.book-format i {
  font-size: 0.9em;
}

/* ========================================
   CATEGORY NAVIGATION
======================================== */

.category-nav {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  padding: var(--space-4) 0;
}

.category-list {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.category-item {
  padding: var(--space-2) var(--space-4);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
}

.category-item:hover,
.category-item.active {
  background-color: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* ========================================
   BOOK DETAIL PAGE - PDF FOCUSED
======================================== */

.book-detail {
  padding-top: 80px;
}

.book-header {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-10);
  align-items: start;
}

.book-cover-large {
  width: 280px;
  height: 400px;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  padding: var(--space-4);
}

.book-cover-large img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-md);
  transition: opacity var(--transition);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.book-cover-large img[src=""],
.book-cover-large img:not([src]) {
  opacity: 0;
}

.book-cover-large-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-6);
}

.book-cover-large-placeholder i {
  font-size: 4rem;
  margin-bottom: var(--space-3);
  opacity: 0.6;
}

.book-cover-large-placeholder .placeholder-text {
  font-size: var(--font-size-base);
  font-weight: 500;
  opacity: 0.8;
}

.book-meta {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: var(--space-2);
}

.book-title-large {
  font-size: var(--font-size-3xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  line-height: 1.2;
}

.book-author-large {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  font-weight: 500;
}

.book-actions {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.book-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-6);
}

.book-metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  padding: var(--space-4);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
}

.metadata-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

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

.metadata-value {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

/* ========================================
   PDF VIEWER - ENHANCED
======================================== */

.pdf-section {
  margin-top: var(--space-10);
}

.pdf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.pdf-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-primary);
  font-weight: 500;
}

.pdf-controls {
  display: flex;
  gap: var(--space-2);
}

.pdf-viewer {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.pdf-viewer iframe {
  width: 100%;
  height: 700px;
  border: none;
  background-color: #ffffff;
}

.pdf-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  z-index: 10;
}

.pdf-loading i {
  font-size: 2rem;
  margin-bottom: var(--space-3);
  animation: spin 1s linear infinite;
}

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

/* ========================================
   USER LIBRARY - PDF FOCUSED
======================================== */

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-primary);
}

.library-stats {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.library-categories {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.library-category {
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.library-category:hover,
.library-category.active {
  background-color: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.library-books {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-6);
}

.library-book-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  height: 420px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.library-book-card:hover {
  border-color: var(--border-secondary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.library-book-actions {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--transition);
}

.library-book-card:hover .library-book-actions {
  opacity: 1;
}

.library-book-info {
  padding: var(--space-4);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.library-added-date {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-primary);
}

/* ========================================
   UTILITIES
======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none; }
.block { display: block; }

/* ========================================
   RESPONSIVE DESIGN - ENHANCED
======================================== */

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-3);
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-4);
  }
  
  .book-header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-6);
  }
  
  .book-cover-large {
    margin: 0 auto;
    width: 240px;
    height: 340px;
  }
  
  .navbar-nav {
    gap: var(--space-1);
  }
  
  .nav-link {
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-xs);
  }
  
  .category-list {
    gap: var(--space-1);
  }
  
  .library-categories {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  
  .library-books {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-4);
  }
  
  .book-actions {
    flex-direction: column;
    gap: var(--space-2);
  }
  
  .pdf-header {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }
  
  .pdf-controls {
    justify-content: center;
  }
  
  .pdf-viewer iframe {
    height: 500px;
  }
}

@media (max-width: 480px) {
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-3);
  }
  
  .book-card {
    height: 340px;
  }
  
  .book-cover {
    height: 200px;
  }
  
  .book-cover-large {
    width: 200px;
    height: 280px;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .library-books {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-3);
  }
  
  .library-book-card {
    height: 360px;
  }
  
  .book-title-large {
    font-size: var(--font-size-2xl);
  }
  
  .pdf-viewer iframe {
    height: 400px;
  }
  
  .book-metadata-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   ACCESSIBILITY
======================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .auth-card:hover {
    transform: none;
    box-shadow: var(--shadow-lg);
  }
}

/* Mobile-safe glow alternative for touch devices */
@media (hover: none) and (pointer: coarse) {
  .auth-card:hover {
    transform: none;
    box-shadow: var(--shadow-lg);
  }
  
  .auth-card:focus-within,
  .auth-card:active {
    border-color: var(--accent-primary);
    box-shadow: 
      var(--shadow-lg),
      0 0 0 2px var(--accent-glow-soft),
      0 0 20px var(--accent-glow-subtle);
  }
  
  .auth-card:focus-within::after,
  .auth-card:active::after {
    opacity: 0.03;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for keyboard navigation */
.btn:focus-visible,
.form-control:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ========================================
   ENHANCED BOOK COMPONENTS
======================================== */

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-8);
  padding: var(--space-6) 0;
}

.book-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-smooth);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 420px;
  position: relative;
  animation: slideUp 0.4s ease-out;
}

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

.book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  pointer-events: none;
  z-index: 1;
}

.book-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg), var(--glow-subtle);
}

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

.book-cover {
  width: 100%;
  height: 260px;
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.book-cover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.1) 100%);
  pointer-events: none;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform var(--transition-smooth);
  z-index: 2;
}

.book-card:hover .book-cover img {
  transform: scale(1.05);
}

.book-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-6);
  height: 100%;
  width: 100%;
}

.book-cover-placeholder i {
  font-size: 3.5rem;
  margin-bottom: var(--space-3);
  opacity: 0.7;
  color: var(--accent-primary);
}

.book-cover-placeholder .placeholder-text {
  font-size: var(--font-size-sm);
  font-weight: 600;
  opacity: 0.9;
  color: var(--text-secondary);
}

.book-info {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.book-title {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-author {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  line-height: 1.3;
  font-weight: 500;
}

.book-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.book-category {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.book-format {
  font-size: var(--font-size-xs);
  color: var(--accent-primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--accent-subtle);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}

.book-format i {
  font-size: 1em;
}

/* ========================================
   ENHANCED SINGLE BOOK PAGE
======================================== */

.book-detail {
  padding-top: 80px;
  animation: fadeInUp 0.6s ease-out;
}

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

.book-header {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-16);
  margin-bottom: var(--space-16);
  align-items: start;
}

.book-cover-large {
  width: 320px;
  height: 450px;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: bookCoverReveal 0.8s ease-out 0.2s both;
  padding: var(--space-4);
}

@keyframes bookCoverReveal {
  from {
    opacity: 0;
    transform: rotateY(-15deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
  }
}

.book-cover-large::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(74, 158, 255, 0.05) 100%);
  pointer-events: none;
  z-index: 1;
}

.book-cover-large img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-xl);
  z-index: 2;
  transition: opacity var(--transition-fast);
}

.book-cover-large img.loading {
  opacity: 0.7;
}

.book-cover-large img[src=""],
.book-cover-large img:not([src]) {
  display: none;
}

.book-cover-large-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-8);
  z-index: 2;
}

.book-cover-large-placeholder i {
  font-size: 5rem;
  margin-bottom: var(--space-4);
  opacity: 0.7;
  color: var(--accent-primary);
}

.book-cover-large-placeholder .placeholder-text {
  font-size: var(--font-size-lg);
  font-weight: 600;
  opacity: 0.9;
}

.book-meta-detail {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: var(--space-4);
  animation: slideInRight 0.6s ease-out 0.4s both;
}

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

.book-title-large {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.book-author-large {
  font-size: var(--font-size-xl);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  font-weight: 600;
}

.book-actions {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.book-description {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-8);
  font-size: var(--font-size-base);
}

.book-metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-5);
  padding: var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  position: relative;
}

.book-metadata-grid::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--divider);
}

.metadata-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.metadata-label {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.metadata-value {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 600;
}
/* ========================================
   HERO SECTION WITH GRAPHICS
======================================== */

.hero-section {
  background: var(--bg-hero);
  padding: 0 0 var(--space-8) 0;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, var(--accent-glow) 0%, transparent 50%);
  opacity: 0.3;
  pointer-events: none;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--space-16);
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero-text {
  animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-title {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: var(--font-size-xl);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  line-height: 1.6;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero-graphic {
  position: relative;
  height: 300px;
  animation: slideInRight 0.8s ease-out 0.2s both;
}

.floating-books {
  position: relative;
  width: 100%;
  height: 100%;
}

.book-icon {
  position: absolute;
  width: 80px;
  height: 80px;
  background: var(--bg-surface);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  font-size: 2rem;
  box-shadow: var(--shadow-lg);
  animation: float 3s ease-in-out infinite;
}

.book-1 {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.book-2 {
  top: 50%;
  right: 20%;
  animation-delay: 1s;
}

.book-3 {
  bottom: 20%;
  left: 30%;
  animation-delay: 2s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

/* ========================================
   ENHANCED FEATURE CARDS
======================================== */

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
  transform: scaleX(0);
  transition: transform var(--transition-smooth);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-icon {
  width: 80px;
  height: 80px;
  background: var(--accent-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
  color: var(--accent-primary);
  font-size: 2rem;
  transition: all var(--transition-smooth);
}

.feature-card:hover .feature-icon {
  background: var(--accent-primary);
  color: white;
  transform: scale(1.1);
}

.feature-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.feature-description {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========================================
   ENHANCED STATS SECTION
======================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  transition: all var(--transition-smooth);
  position: relative;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  border-radius: var(--radius-xl);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
}

.stat-card:hover::before {
  opacity: 0.1;
}

.stat-number {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  color: var(--accent-primary);
  margin-bottom: var(--space-2);
  position: relative;
  z-index: 2;
}

.stat-label {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  font-weight: 600;
  position: relative;
  z-index: 2;
}

/* ========================================
   CALL TO ACTION SECTION
======================================== */

.cta-card {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-16);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
  opacity: 0.1;
  pointer-events: none;
}

.cta-content {
  position: relative;
  z-index: 2;
}

.cta-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.cta-description {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.cta-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================
   ENHANCED LIBRARY COMPONENTS
======================================== */

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 2px solid var(--border-primary);
  position: relative;
}

.library-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100px;
  height: 2px;
  background: var(--accent-primary);
}

.library-stats {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.library-categories {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.library-category {
  padding: var(--space-3) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: 600;
  position: relative;
  color: var(--text-secondary);
}

.library-category:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

.library-category.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.library-category.active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
}

.library-books {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-8);
}

.library-book-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-smooth);
  height: 420px;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: slideUp 0.4s ease-out;
}

.library-book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  pointer-events: none;
  z-index: 1;
}

.library-book-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-lg), var(--glow-subtle);
}

.library-book-card:hover::before {
  opacity: 0.1;
}

.library-book-actions {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  gap: var(--space-2);
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 10;
}

.library-book-card:hover .library-book-actions {
  opacity: 1;
}

.library-book-info {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.library-added-date {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
/* ========================================
   UTILITY CLASSES
======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none; }
.block { display: block; }

/* ========================================
   ENHANCED RESPONSIVE DESIGN
======================================== */

@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-12);
  }
  
  .hero-graphic {
    height: 200px;
  }
  
  .book-header {
    grid-template-columns: 280px 1fr;
    gap: var(--space-12);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-3);
  }
  
  .navbar {
    height: 60px;
  }
  
  .hero-section {
    padding: 0 0 var(--space-4) 0;
  }
  
  .tech-header-section,
  .tech-books-section,
  .about-section {
    padding: var(--space-4) 0 var(--space-3) 0;
  }
  
  .section-divider {
    margin: var(--space-3) 0;
  }
  
  .hero-title {
    font-size: var(--font-size-3xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-lg);
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-6);
  }
  
  .book-header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-8);
  }
  
  .book-cover-large {
    margin: 0 auto;
    width: 280px;
    height: 380px;
    padding: var(--space-3);
  }
  
  .navbar-nav {
    gap: var(--space-1);
  }
  
  .nav-link {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
  }
  
  .library-categories {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  
  .library-books {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-6);
  }
  
  .book-actions {
    flex-direction: column;
    gap: var(--space-3);
  }
  
  .cta-card {
    padding: var(--space-12);
  }
  
  .cta-title {
    font-size: var(--font-size-2xl);
  }
  
  .cta-actions {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-4);
  }
  
  .book-card {
    height: 380px;
  }
  
  .book-cover {
    height: 220px;
  }
  
  .book-cover-large {
    width: 240px;
    height: 320px;
    padding: var(--space-3);
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .library-books {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-4);
  }
  
  .library-book-card {
    height: 400px;
  }
  
  .book-title-large {
    font-size: var(--font-size-2xl);
  }
  
  .hero-section {
    padding: 0 0 var(--space-3) 0;
  }
  
  .tech-header-section,
  .tech-books-section,
  .about-section {
    padding: var(--space-3) 0 var(--space-2) 0;
  }
  
  .section-divider {
    margin: var(--space-2) 0;
  }
  
  .book-metadata-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-title {
    font-size: var(--font-size-2xl);
  }
  
  .floating-books {
    display: none;
  }
  
  .feature-card {
    padding: var(--space-6);
  }
  
  .stat-card {
    padding: var(--space-6);
  }
}

/* ========================================
   ACCESSIBILITY & PERFORMANCE
======================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .floating-books {
    display: none;
  }
  
  .auth-card:hover {
    transform: none;
  }
  
  .auth-icon:hover {
    transform: none;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for keyboard navigation */
.btn:focus-visible,
.form-control:focus-visible,
.nav-link:focus-visible,
.book-card:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Image loading optimization */
.book-cover img,
.book-cover-large img {
  opacity: 1;
  transition: opacity var(--transition-fast);
}

.book-cover img[src=""],
.book-cover img:not([src]),
.book-cover-large img[src=""],
.book-cover-large img:not([src]) {
  display: none;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Loading states */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--accent-primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* ========================================
   ENHANCED ABOUT PAGE
======================================== */

.about-page {
  animation: fadeInUp 0.6s ease-out;
}

.about-header {
  padding: var(--space-6) 0 var(--space-8) 0;
  position: relative;
}

.about-icon-wrapper {
  width: 120px;
  height: 120px;
  background: var(--accent-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  animation: pulse 2s ease-in-out infinite;
}

.about-main-icon {
  font-size: 3rem;
  color: var(--accent-primary);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--accent-glow);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 20px transparent;
  }
}

.about-title {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  animation: slideInUp 0.8s ease-out 0.2s both;
}

.about-subtitle {
  font-size: var(--font-size-xl);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
  animation: slideInUp 0.8s ease-out 0.4s both;
}

.about-mission .about-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  transition: all var(--transition-smooth);
  animation: slideInLeft 0.8s ease-out both;
}

.about-mission .about-card:nth-child(2) {
  animation: slideInRight 0.8s ease-out 0.2s both;
}

.about-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg);
}

.about-card-icon {
  width: 80px;
  height: 80px;
  background: var(--accent-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-smooth);
}

.about-card-icon i {
  font-size: 2rem;
  color: var(--accent-primary);
}

.about-card:hover .about-card-icon {
  background: var(--accent-primary);
  transform: scale(1.1);
}

.about-card:hover .about-card-icon i {
  color: white;
}

.about-card-content h3 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.about-card-content p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.section-title {
  text-align: center;
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-10);
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--accent-primary);
  border-radius: 2px;
}

.value-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  transition: all var(--transition-smooth);
  animation: slideUp 0.6s ease-out both;
}

.value-card:nth-child(2) {
  animation-delay: 0.1s;
}

.value-card:nth-child(3) {
  animation-delay: 0.2s;
}

.value-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg);
}

.value-icon {
  width: 80px;
  height: 80px;
  background: var(--accent-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
  transition: all var(--transition-smooth);
}

.value-icon i {
  font-size: 2rem;
  color: var(--accent-primary);
}

.value-card:hover .value-icon {
  background: var(--accent-primary);
  transform: scale(1.1);
}

.value-card:hover .value-icon i {
  color: white;
}

.value-card h4 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.value-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.feature-list {
  animation: slideInLeft 0.8s ease-out both;
}

.feature-list:nth-child(2) {
  animation: slideInRight 0.8s ease-out 0.2s both;
}

.feature-list-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  position: relative;
}

.feature-list-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--accent-primary);
  border-radius: 1px;
}

.feature-items {
  list-style: none;
  padding: 0;
}

.feature-item {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.feature-item:hover {
  background: var(--bg-elevated);
  transform: translateX(4px);
}

.feature-item i {
  color: var(--accent-primary);
  margin-right: var(--space-4);
  font-size: 1.1em;
  flex-shrink: 0;
}

.feature-item span {
  color: var(--text-secondary);
  font-weight: 500;
}

.tech-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  text-align: center;
  animation: slideUp 0.8s ease-out both;
}

.tech-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.tech-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  transition: all var(--transition-smooth);
}

.tech-item:hover {
  transform: translateY(-4px);
  background: var(--accent-subtle);
}

.tech-item i {
  font-size: 2.5rem;
  color: var(--accent-primary);
}

.tech-item span {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

.about-cta {
  animation: slideUp 0.8s ease-out both;
}

/* ========================================
   ENHANCED AUTHENTICATION PAGES
======================================== */

.auth-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) 0;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 30%, var(--accent-glow) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, var(--accent-glow) 0%, transparent 50%);
  opacity: 0.1;
  pointer-events: none;
  animation: authBackgroundFloat 20s ease-in-out infinite;
}

@keyframes authBackgroundFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(1deg);
  }
}

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 0 var(--space-4);
  animation: authContainerSlideIn 0.8s ease-out;
}

@keyframes authContainerSlideIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  animation: authCardReveal 0.8s ease-out 0.2s both;
  transition: all var(--transition-smooth);
  /* GPU optimization for smooth glow effects */
  will-change: transform, box-shadow, border-color;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover), var(--accent-primary));
  background-size: 200% 100%;
  animation: authCardGlow 3s ease-in-out infinite;
}

.auth-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

/* Professional Glow Effect on Hover */
.auth-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: 
    var(--shadow-lg),
    0 0 0 1px var(--accent-glow-subtle),
    0 0 20px var(--accent-glow-soft),
    0 0 40px var(--accent-glow-subtle),
    0 0 80px rgba(74, 158, 255, 0.03);
}

.auth-card:hover::after {
  opacity: 0.04;
}

/* Enhanced glow for focus state (accessibility) */
.auth-card:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 
    var(--shadow-lg),
    0 0 0 2px var(--accent-glow-focus),
    0 0 25px var(--accent-glow-soft),
    0 0 50px var(--accent-glow-subtle);
}

@keyframes authCardReveal {
  from {
    opacity: 0;
    transform: translateY(20px) rotateX(10deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
  }
}

@keyframes authCardGlow {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-6);
  position: relative;
}

.auth-icon {
  width: 70px;
  height: 70px;
  background: var(--accent-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-3);
  position: relative;
  animation: authIconPulse 3s ease-in-out infinite;
  transition: all var(--transition-smooth);
}

.auth-card:hover .auth-icon {
  background: var(--accent-primary);
  transform: scale(1.05);
  box-shadow: 
    0 0 20px var(--accent-glow-soft),
    0 0 40px var(--accent-glow-subtle);
}

.auth-card:hover .auth-icon i {
  color: white;
}

.auth-icon::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  opacity: 0;
  animation: authIconRipple 2s ease-out infinite;
}

@keyframes authIconPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--accent-glow);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px transparent;
  }
}

@keyframes authIconRipple {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

.auth-icon i {
  font-size: 1.8rem;
  color: var(--accent-primary);
  animation: authIconFloat 2s ease-in-out infinite;
}

@keyframes authIconFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-3px);
  }
}

.auth-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  animation: authTitleSlide 0.8s ease-out 0.4s both;
}

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

.auth-subtitle {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  animation: authSubtitleSlide 0.8s ease-out 0.6s both;
}

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

.auth-form {
  animation: authFormSlide 0.8s ease-out 0.8s both;
}

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

.auth-form .form-group {
  margin-bottom: var(--space-4);
  position: relative;
}

.auth-form .form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  transition: all var(--transition-smooth);
  position: relative;
}

.auth-form .form-control {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-size: var(--font-size-base);
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  border: 2px solid var(--border-primary);
  color: var(--text-primary);
  transition: all var(--transition-smooth);
  position: relative;
}

.auth-form .form-control::placeholder {
  color: var(--text-muted);
  transition: opacity var(--transition-smooth);
}

.auth-form .form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-surface);
  transform: translateY(-2px);
  box-shadow: 0 0 0 4px var(--accent-subtle), 
              0 8px 25px rgba(0, 0, 0, 0.15);
}

.auth-card:hover .auth-form .form-control {
  border-color: var(--border-secondary);
}

.auth-card:hover .auth-form .form-label {
  color: var(--text-primary);
}

.auth-form .form-control:focus::placeholder {
  opacity: 0.7;
  transform: translateX(5px);
}

.auth-form .form-group:focus-within .form-label {
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.auth-form .btn {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  font-size: var(--font-size-base);
  font-weight: 700;
  margin-top: var(--space-4);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-hover) 100%);
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.auth-form .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--transition-smooth);
}

.auth-form .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(74, 158, 255, 0.3);
  background: linear-gradient(135deg, var(--accent-hover) 0%, #2d7bc7 100%);
}

.auth-form .btn:hover::before {
  left: 100%;
}

.auth-form .btn:active {
  transform: translateY(0px);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-primary);
  animation: authFooterSlide 0.8s ease-out 1s both;
}

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

.auth-footer p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-3);
}

.auth-footer a {
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: none;
  position: relative;
  transition: all var(--transition-smooth);
}

.auth-footer a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width var(--transition-smooth);
}

.auth-footer a:hover {
  color: var(--accent-hover);
  transform: translateY(-1px);
}

.auth-footer a:hover::after {
  width: 100%;
}

/* ========================================
   RESPONSIVE ENHANCEMENTS FOR NEW COMPONENTS
======================================== */

@media (max-width: 768px) {
  .about-mission .about-card {
    flex-direction: column;
    text-align: center;
    gap: var(--space-4);
  }
  
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
  
  .auth-page {
    padding: var(--space-4) 0;
  }
  
  .auth-card {
    padding: var(--space-6);
  }
  
  .auth-icon {
    width: 60px;
    height: 60px;
  }
  
  .auth-icon i {
    font-size: 1.6rem;
  }
  
  .auth-title {
    font-size: var(--font-size-lg);
  }
  
  .auth-form .form-control {
    padding: var(--space-3) var(--space-4);
  }
}

@media (max-width: 480px) {
  .about-title {
    font-size: var(--font-size-2xl);
  }
  
  .about-subtitle {
    font-size: var(--font-size-base);
  }
  
  .tech-grid {
    grid-template-columns: 1fr;
  }
  
  .auth-page {
    padding: var(--space-2) 0;
    min-height: 100vh;
  }
  
  .auth-card {
    padding: var(--space-4);
    margin: 0 var(--space-2);
  }
  
  .auth-icon {
    width: 50px;
    height: 50px;
  }
  
  .auth-icon i {
    font-size: 1.4rem;
  }
  
  .auth-title {
    font-size: var(--font-size-base);
  }
  
  .auth-subtitle {
    font-size: var(--font-size-xs);
  }
  
  .auth-form .form-control {
    padding: var(--space-3);
    font-size: var(--font-size-sm);
  }
  
  .auth-form .form-group {
    margin-bottom: var(--space-3);
  }
  
  .auth-footer {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
  }
  
  .auth-footer p {
    margin-bottom: var(--space-2);
  }
}
  }
  
  .auth-form .btn {
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-sm);
  }
}
/* ========================================
   TECHBOOKHUB - TECHNICAL PLATFORM DESIGN
======================================== */

/* Technical Header */
/* Technical Header - Force Right Alignment */
.tech-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: var(--space-8);
  padding: var(--space-6) 0 var(--space-8) 0;
  border-bottom: 1px solid var(--border-primary);
  position: relative;
  width: 100%;
}

.tech-header-actions {
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: var(--space-3);
  margin-left: auto !important; /* Force right alignment */
  justify-self: flex-end !important;
}

.tech-header-actions .tech-search {
  max-width: 400px;
  animation: slideInRight 0.8s ease-out 0.3s both;
}

.tech-header-actions .btn {
  white-space: nowrap;
}

.tech-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 30%);
  opacity: 0.05;
  pointer-events: none;
}

.tech-header-content {
  flex: 1 !important;
  position: relative;
  z-index: 2;
  min-width: 0 !important; /* Prevents flex item from overflowing */
  max-width: calc(100% - 450px) !important; /* Reserve space for actions */
}

.tech-icon-group {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  animation: slideInLeft 0.8s ease-out;
}

.tech-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  font-size: 1.2rem;
  transition: all var(--transition-smooth);
  animation: float 3s ease-in-out infinite;
}

.tech-icon:nth-child(1) { animation-delay: 0s; }
.tech-icon:nth-child(2) { animation-delay: 0.5s; }
.tech-icon:nth-child(3) { animation-delay: 1s; }
.tech-icon:nth-child(4) { animation-delay: 1.5s; }

.tech-icon:hover {
  background: var(--accent-primary);
  color: white;
  transform: translateY(-2px) scale(1.1);
}

.tech-title {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  animation: slideInUp 0.8s ease-out 0.2s both;
}

.tech-subtitle {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: 1.6;
  animation: slideInUp 0.8s ease-out 0.4s both;
}

/* Technical Search - now handled within tech-header-actions */

.search-form {
  position: relative;
}

.search-input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-smooth);
}

.search-input-group:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.search-icon {
  position: absolute;
  left: var(--space-4);
  color: var(--text-muted);
  z-index: 2;
}

.search-input {
  flex: 1;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-12);
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  padding: var(--space-3) var(--space-4);
  background: var(--accent-primary);
  border: none;
  color: white;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-btn:hover {
  background: var(--accent-hover);
}

/* Technical Category Navigation */
.tech-category-nav {
  margin-bottom: var(--space-4);
  position: relative;
}

.category-scroll {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding: var(--space-2) 0 var(--space-4);
  scrollbar-width: thin;
  scrollbar-color: var(--border-primary) transparent;
}

.category-scroll::-webkit-scrollbar {
  height: 4px;
}

.category-scroll::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 2px;
}

.category-scroll::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 2px;
}

.tech-category-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}

.tech-category-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--accent-primary);
  opacity: 0;
  border-radius: var(--radius-lg);
  transition: opacity var(--transition-fast);
}

.tech-category-item i,
.tech-category-item span {
  position: relative;
  z-index: 2;
}

.tech-category-item:hover {
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.tech-category-item:hover::before {
  opacity: 0.1;
}

.tech-category-item.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  transform: translateY(-2px);
}

.tech-category-item.active::before {
  opacity: 1;
}

/* Technical Books Grid */
.tech-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-8);
  animation: fadeIn 0.6s ease-out;
}

.tech-book-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-smooth);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: slideUp 0.6s ease-out both;
  min-height: 440px; /* Changed from fixed height to min-height */
}

.tech-book-card:nth-child(odd) {
  animation-delay: 0.1s;
}

.tech-book-card:nth-child(even) {
  animation-delay: 0.2s;
}

.tech-book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  pointer-events: none;
  z-index: 1;
}

.tech-book-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-lg), 0 0 30px var(--accent-glow);
}

.tech-book-card:hover::before {
  opacity: 0.08;
}

.tech-book-cover {
  width: 100%;
  height: 280px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.tech-book-cover img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  transition: transform var(--transition-smooth);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.tech-book-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-6);
}

.tech-book-placeholder i {
  font-size: 3.5rem;
  margin-bottom: var(--space-3);
  color: var(--accent-primary);
  opacity: 0.7;
}

.tech-book-placeholder .placeholder-text {
  font-size: var(--font-size-sm);
  font-weight: 600;
  opacity: 0.9;
  color: var(--text-secondary);
}

.tech-book-info {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Ensure proper spacing */
}
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.tech-book-content {
  flex: 1;
}

.tech-book-title {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tech-book-author {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  font-weight: 500;
}

.tech-book-meta {
  margin-top: auto;
}

.tech-category-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tech-category-badge i {
  color: var(--accent-primary);
}

/* Technical Pagination */
.tech-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-12);
  padding: var(--space-6) 0;
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.pagination-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  transform: translateY(-1px);
}

.pagination-info {
  padding: var(--space-3) var(--space-5);
  color: var(--text-secondary);
  font-weight: 600;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
}

/* Technical Empty State */
.tech-empty-state {
  text-align: center;
  padding: var(--space-8) 0;
  animation: fadeIn 0.8s ease-out;
}

.empty-icon {
  width: 120px;
  height: 120px;
  background: var(--bg-surface);
  border: 2px solid var(--border-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  animation: pulse 2s ease-in-out infinite;
}

.empty-icon i {
  font-size: 3rem;
  color: var(--accent-primary);
}

.tech-empty-state h3 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.tech-empty-state p {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ========================================
   RESPONSIVE DESIGN FOR TECHNICAL PLATFORM
======================================== */

@media (max-width: 768px) {
  .navbar-content {
    padding: 0 var(--space-3);
  }
  
  .navbar-nav {
    gap: var(--space-1);
  }
  
  .nav-link {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
  }
  
  .tech-header {
    flex-direction: column;
    gap: var(--space-6);
    text-align: center;
    padding: var(--space-4) 0 var(--space-6) 0;
  }
  
  .tech-header-actions {
    margin-left: 0;
    order: 1;
    flex-direction: column;
    gap: var(--space-3);
    width: 100%;
  }
  
  .tech-header-actions .tech-search {
    max-width: 100%;
  }
  
  .tech-header-actions .btn {
    width: 100%;
    justify-content: center;
  }
  
  .tech-icon-group {
    justify-content: center;
  }
  
  .tech-books-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-6);
  }
  
  .tech-book-card {
    height: 400px;
  }
  
  .tech-book-cover {
    height: 240px;
  }
  
  .tech-pagination {
    flex-direction: column;
    gap: var(--space-3);
  }
}

@media (max-width: 480px) {
  .navbar-brand {
    font-size: var(--font-size-base);
  }
  
  .navbar-nav {
    display: none;
  }
  
  .tech-title {
    font-size: var(--font-size-2xl);
  }
  
  .tech-icon-group {
    gap: var(--space-2);
  }
  
  .tech-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  
  .tech-books-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-4);
  }
  
  .tech-book-card {
    height: 360px;
  }
  
  .tech-book-cover {
    height: 200px;
  }
  
  .tech-book-info {
    padding: var(--space-4);
  }
  
  .category-scroll {
    gap: var(--space-2);
  }
  
  .tech-category-item {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
  }
}
  }
}

/* Technical Library Specific Styles */
.tech-book-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.tech-added-date {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-primary);
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.tech-added-date i {
  color: var(--accent-primary);
}

/* Technical Book Meta */
.tech-book-meta {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

/* Technical Book Title */
.tech-book-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  line-height: 1.3;
}

.tech-book-title a:hover {
  color: var(--accent-primary);
  transition: color var(--transition-fast);
}

/* Technical Book Author */
.tech-book-author {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
}

/* Enhanced Tech Book Actions for Books Index */
.tech-book-actions {
  margin-top: auto;
  padding-top: var(--space-3);
}

.tech-book-actions .btn {
  width: 100%;
  justify-content: center;
}

/* Ensure proper button spacing and sizing */
.tech-book-actions .btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

/* Loading state for buttons */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn:disabled:hover {
  transform: none;
}

/* Clean remove button styling for My Library */
.library-remove-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-2);
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
  font-size: var(--font-size-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
}

.tech-book-card:hover .library-remove-btn {
  opacity: 1;
}

.library-remove-btn:hover {
  background: rgba(239, 68, 68, 1);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.library-remove-btn:active {
  transform: scale(0.95);
}

.library-remove-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.library-remove-btn:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ========================================
   CRITICAL OVERRIDE - RIGHT ALIGNMENT FIX
======================================== */

/* Force right alignment for header actions - FINAL OVERRIDE */
.container .tech-header .tech-header-actions,
.tech-header-section .tech-header .tech-header-actions {
  margin-left: auto !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
}

/* Ensure search and buttons are properly aligned */
.tech-header-actions .tech-search,
.tech-header-actions .btn {
  flex-shrink: 0 !important;
}

/* Force header to use flexbox properly */
.container .tech-header,
.tech-header-section .tech-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
}