/* Main styles for BirbalBot */

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

/* Import navigation component styles */
@import url('./components/navigation.css');

/* CSS Variables for consistent theming */
:root {
  --primary-color: #ff6b35;
  --secondary-color: #004e89;
  --accent-color: #ffd23f;
  --neutral-color: #f5f5f5;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --border-radius: 0.5rem;
  --transition: all 0.3s ease;
}

/* Base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--neutral-color);
}

/* Typography */
.font-display {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

/* Utility classes */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-size: 0.875rem;
}

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

.btn-primary:hover {
  background-color: #e55a2b;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
  background-color: #003d6b;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

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

/* Card styles */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

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

.card-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background-color: #fafafa;
}

.card-body {
  padding: 1rem;
}

.card-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background-color: #fafafa;
}

/* Form styles */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Add form input error styling */
.form-input-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-input-error:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.form-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: white;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

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

/* Navigation styles */
.navbar {
  background: white;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--secondary-color);
  text-decoration: none;
}

.navbar-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

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

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

/* Hero section styles */
.hero {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
  color: white;
  padding: 5rem 0;
  text-align: center;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }
}

/* Search bar styles */
.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  padding-right: 120px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 210, 63, 0.3);
}

.search-button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.search-button:hover {
  background: #e55a2b;
}

/* Filter styles */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.filter-select {
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.875rem;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
}

.filter-select option {
  background: var(--secondary-color);
  color: white;
}

/* Book grid styles */
.books-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Centered responsive grid for book cards */
.books-grid-centered {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.books-grid-centered > * {
  width: 100%;
  max-width: 280px;
  flex: 0 0 auto;
}

.book-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.book-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.book-cover {
  aspect-ratio: 4/5;
  background: #f3f4f6;
  position: relative;
  overflow: hidden;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.book-badge {
  position: absolute;
  top: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.badge-class {
  left: 0.5rem;
  background: var(--secondary-color);
}

.badge-branch {
  right: 0.5rem;
  background: var(--primary-color);
}

.book-info {
  padding: 1rem;
}

.book-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.book-author {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

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

.book-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.book-tag {
  background: #f3f4f6;
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

.chat-button {
  width: 100%;
  background: var(--primary-color);
  color: white;
  padding: 0.75rem;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
  display: block;
}

.chat-button:hover {
  background: #e55a2b;
  transform: translateY(-1px);
}

/* Features section styles */
.features {
  padding: 4rem 0;
  background: #fafafa;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  text-align: center;
  padding: 2rem;
}

.feature-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: white;
}

.feature-icon.primary {
  background: var(--primary-color);
}

.feature-icon.secondary {
  background: var(--secondary-color);
}

.feature-icon.accent {
  background: var(--accent-color);
  color: var(--text-primary);
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

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

/* Footer styles */
.footer {
  background: var(--secondary-color);
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

/* Responsive design */
@media (min-width: 640px) {
  .books-grid-centered {
    gap: 2rem;
  }

  .books-grid-centered > * {
    max-width: 300px;
  }
}

@media (min-width: 768px) {
  .books-grid-centered > * {
    max-width: 280px;
  }
}

@media (min-width: 1024px) {
  .books-grid {
    gap: 2rem;
  }

  .books-grid-centered > * {
    max-width: 300px;
  }
}

@media (min-width: 1280px) {
  .books-grid-centered > * {
    max-width: 320px;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 2rem 0;
  }
  
  .hero-title {
    font-size: 2rem;
    line-height: 1.1;
  }
  
  .hero-subtitle {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
  }

  .filters {
    flex-direction: column;
    align-items: center;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .search-input {
    padding: 0.75rem 1rem;
    padding-right: 90px;
    font-size: 1rem; /* Prevent zoom on iOS */
  }
  
  .search-button {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  
  .book-info {
    padding: 1rem;
  }
  
  .book-title {
    font-size: 1rem;
    line-height: 1.25;
  }
  
  .book-author,
  .book-description {
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 1.5rem 0;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-subtitle {
    font-size: 0.8125rem;
  }
  
  .search-input {
    padding: 0.625rem 0.875rem;
    padding-right: 80px;
    font-size: 1rem;
  }

  .search-button {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }

  .books-grid-centered > * {
    max-width: 100%;
  }

  .book-info {
    padding: 0.875rem;
  }
  
  .book-title {
    font-size: 0.9375rem;
  }
  
  .book-author,
  .book-description {
    font-size: 0.75rem;
  }
}

/* Ensure cards don't stretch beyond their content */
.book-card {
  width: 100%;
  max-width: 100%;
}

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

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Notification styles */
.notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  max-width: 300px;
  animation: slideIn 0.3s ease-out;
}

.notification.success {
  background: #10b981;
  color: white;
}

.notification.error {
  background: #ef4444;
  color: white;
}

.notification.warning {
  background: #f59e0b;
  color: white;
}

.notification.info {
  background: #3b82f6;
  color: white;
}

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

/* Accessibility improvements */
.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 better accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-secondary: #000000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* Modern Filter Interface Styles */
.filter-group {
    position: relative;
}

/* Search input in filter interface */
.filter-select-modern[type="text"] {
    background: transparent;
    color: #1f2937;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: text;
}

.filter-select-modern[type="text"]:focus {
    color: #ff6b35;
}

.filter-select-modern[type="text"]::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.filter-label {
    display: flex;
    align-items: center;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.filter-select-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-select-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.filter-select-wrapper:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.2), 0 12px 40px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.filter-select-modern {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    border: none;
    background: transparent;
    color: #1f2937;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    outline: none;
    transition: all 0.3s ease;
}

.filter-select-modern:focus {
    color: #ff6b35;
}

.filter-select-modern option {
    background: white;
    color: #1f2937;
    padding: 0.5rem;
    font-weight: 500;
}

.filter-select-modern option:checked {
    background: #ff6b35;
    color: white;
}

.filter-select-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
    transition: all 0.3s ease;
}

.filter-select-wrapper:hover .filter-select-icon {
    color: #ff6b35;
    transform: translateY(-50%) scale(1.1);
}

.filter-select-wrapper:focus-within .filter-select-icon {
    color: #ff6b35;
    transform: translateY(-50%) rotate(180deg);
}

/* Filter Tags */
.filter-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

/* Filter Action Buttons */
.filter-action-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.filter-action-btn:active {
    transform: translateY(0);
}

/* Quick Filter Tags */
.quick-filter-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.quick-filter-tag:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.quick-filter-tag:active {
    transform: translateY(0) scale(1.02);
}

.quick-filter-tag.active {
    background: rgba(255, 107, 53, 0.9);
    border-color: rgba(255, 107, 53, 1);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

/* Filter Results Counter */
.filter-results-counter {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: pulse-glow 2s infinite;
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 210, 63, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 210, 63, 0.6);
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .filter-select-wrapper {
        margin-bottom: 1rem;
    }
    
    .filter-action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .quick-filter-tag {
        font-size: 0.7rem;
        padding: 0.375rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .filter-group {
        margin-bottom: 1.5rem;
    }
    
    .filter-select-modern {
        padding: 0.875rem 2.5rem 0.875rem 0.875rem;
        font-size: 0.8rem;
    }
}

/* Filter Animation Effects */
.filter-slide-in {
    animation: filterSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes filterSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.filter-bounce {
    animation: filterBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

/* Enhanced Search Suggestions */
#search-suggestions {
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb #f9fafb;
}

#search-suggestions::-webkit-scrollbar {
  width: 6px;
}

#search-suggestions::-webkit-scrollbar-track {
  background: #f9fafb;
  border-radius: 3px;
}

#search-suggestions::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 3px;
}

#search-suggestions::-webkit-scrollbar-thumb:hover {
  background: #d1d5db;
}

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

.suggestion-item {
  animation: fadeInUp 0.3s ease-out forwards;
  opacity: 0;
  transform: translateY(10px);
  background: transparent;
  color: #374151;
  border-color: #f3f4f6;
}

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

.suggestion-item:hover {
  background: #fef3f0;
  color: #1f2937;
  border-color: #ff6b35;
}

.suggestion-item svg {
  color: #9ca3af;
}

.suggestion-item:hover svg {
  color: #ff6b35;
}

.suggestion-item span {
  color: #374151;
}

.suggestion-item:hover span {
  color: #1f2937;
  font-weight: 600;
}

/* Active suggestion state for keyboard navigation */
.suggestion-item.active {
  background: linear-gradient(135deg, #ff6b35 0%, #e55a2b 100%) !important;
  color: white !important;
}

.suggestion-item.active svg {
  color: white !important;
}

.suggestion-item.active span {
  color: white !important;
}

/* Enhanced focus states for accessibility */
.suggestion-item:focus {
  outline: 2px solid #ff6b35;
  outline-offset: -2px;
  background: linear-gradient(135deg, #ff6b35 0%, #e55a2b 100%);
  color: white;
}

.suggestion-item:focus svg {
  color: white;
}

.suggestion-item:focus span {
  color: white;
}

/* Loading state for suggestions */
.suggestions-loading {
  padding: 1rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
}

.suggestions-loading::after {
  content: '';
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #ff6b35;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 0.5rem;
}

/* No suggestions state */
.no-suggestions {
  padding: 1rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
  font-style: italic;
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
  #search-suggestions {
    margin-top: 0.5rem;
    border-radius: 1rem;
    max-height: 300px;
    left: 1rem;
    right: 1rem;
    width: calc(100% - 2rem);
  }
  
  .suggestion-item {
    padding: 1rem;
    font-size: 0.9rem;
    min-height: 3rem;
    touch-action: manipulation;
  }
  
  .suggestion-item svg:first-child {
    width: 1.25rem;
    height: 1.25rem;
  }
  
  .suggestion-item svg:last-child {
    width: 1.25rem;
    height: 1.25rem;
  }
}

@media (max-width: 480px) {
  #search-suggestions {
    left: 0.5rem;
    right: 0.5rem;
    width: calc(100% - 1rem);
    border-radius: 0.75rem;
  }
  
  .suggestion-item {
    padding: 0.875rem;
    font-size: 0.875rem;
  }
}

/* Enhanced Mobile Search Form Styles */
@media (max-width: 768px) {
  /* Search container adjustments */
  .max-w-4xl {
    max-width: calc(100vw - 2rem);
    margin-left: 1rem;
    margin-right: 1rem;
  }
  
  /* Search form mobile optimization */
  #search-form .relative.group {
    margin: 0;
  }
  
  #search-form .absolute.inset-0 {
    border-radius: 1rem; /* Smaller border radius for mobile */
  }
  
  #search-form .relative.bg-white {
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); /* Reduced shadow */
  }
  
  /* Input field mobile styles */
  #search-input {
    font-size: 1rem !important; /* Prevent zoom on iOS */
    padding: 0.875rem 0.75rem 0.875rem 2.5rem !important;
    line-height: 1.25;
    min-height: 3rem;
  }
  
  #search-input::placeholder {
    font-size: 0.9rem;
    color: #9ca3af;
  }
  
  /* Search icon mobile sizing */
  #search-form svg {
    width: 1rem !important;
    height: 1rem !important;
    left: 0.875rem !important;
  }
  
  /* Search button mobile optimization */
  #search-form button[type="submit"] {
    padding: 0.75rem 1rem !important;
    font-size: 0.875rem !important;
    border-radius: 0.75rem !important;
    margin-right: 0.5rem !important;
    min-height: 2.75rem;
    white-space: nowrap;
  }
  
  /* Search suggestions mobile styles */
  #search-suggestions {
    margin-top: 0.5rem;
    border-radius: 1rem;
    max-height: 300px;
    left: 1rem;
    right: 1rem;
    width: calc(100% - 2rem);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }
  
  .suggestion-item {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    min-height: 3rem;
    touch-action: manipulation;
  }
  
  .suggestion-item svg:first-child {
    width: 1rem;
    height: 1rem;
  }
  
  .suggestion-item svg:last-child {
    width: 1rem;
    height: 1rem;
  }
}

@media (max-width: 480px) {
  /* Extra small mobile devices */
  .max-w-4xl {
    max-width: calc(100vw - 1rem);
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }
  
  #search-input {
    font-size: 1rem !important;
    padding: 0.75rem 0.625rem 0.75rem 2.25rem !important;
    min-height: 2.75rem;
  }
  
  #search-input::placeholder {
    font-size: 0.875rem;
  }
  
  #search-form svg {
    width: 0.875rem !important;
    height: 0.875rem !important;
    left: 0.75rem !important;
  }
  
  #search-form button[type="submit"] {
    padding: 0.625rem 0.875rem !important;
    font-size: 0.8125rem !important;
    border-radius: 0.625rem !important;
    margin-right: 0.375rem !important;
    min-height: 2.5rem;
  }
  
  #search-suggestions {
    left: 0.5rem;
    right: 0.5rem;
    width: calc(100% - 1rem);
    border-radius: 0.875rem;
  }
  
  .suggestion-item {
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
    min-height: 2.75rem;
  }
}

/* Touch-friendly improvements */
@media (max-width: 768px) {
  /* Ensure proper touch targets */
  #search-form button[type="submit"] {
    min-width: 4rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  
  #search-input {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Improve focus states for mobile */
  #search-input:focus {
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.3);
    border-color: transparent;
  }
  
  /* Better button hover states for touch devices */
  #search-form button[type="submit"]:active {
    transform: scale(0.98);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
  }
  
  /* Prevent text selection on buttons */
  #search-form button[type="submit"] {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
  }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
  #search-input {
    padding: 0.625rem 0.75rem 0.625rem 2.25rem !important;
    min-height: 2.5rem;
  }
  
  #search-form button[type="submit"] {
    padding: 0.625rem 0.875rem !important;
    min-height: 2.5rem;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  #search-form svg {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Accessibility improvements for mobile */
@media (max-width: 768px) {
  /* Larger focus indicators for touch devices */
  #search-input:focus {
    outline: 3px solid rgba(255, 107, 53, 0.5);
    outline-offset: 2px;
  }
  
  #search-form button[type="submit"]:focus {
    outline: 3px solid rgba(255, 107, 53, 0.5);
    outline-offset: 2px;
  }
  
  /* Better contrast for mobile screens */
  #search-input::placeholder {
    color: #6b7280;
    opacity: 1;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  #search-form .group:hover .absolute.inset-0 {
    transition: none;
  }
  
  #search-form button[type="submit"]:hover {
    transform: none;
  }
}

/* Print styles */
@media print {
  .navbar,
  .footer,
  .search-container,
  .filters,
  .chat-button {
    display: none;
  }

  .book-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .hero {
    background: none;
    color: black;
  }
}
