/* Reset and Base Styles */
:root {
  --primary-color: #0ea5e9;
  --secondary-color: #0284c7;
  --text-color: #0f172a;
  --light-text: #64748b;
  --background: #ffffff;
  --page-bg: #f1f5f9;
  --sidebar-width: 280px;
  --card-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: 70px;
  --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text-color);
  background: var(--page-bg);
  line-height: 1.6;
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  z-index: 1000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.logo {
  margin-bottom: 2rem;
}

.logo a {
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-color);
}

.logo-accent {
  color: var(--primary-color);
}

.nav-list {
  list-style: none;
}

.nav-list li {
  margin-bottom: 0.5rem;
}

.nav-list a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-color);
  border-radius: var(--card-radius);
  transition: var(--transition);
}

.nav-list a:hover,
.nav-list a.active {
  background: var(--primary-color);
  color: white;
}

.nav-list i {
  margin-right: 1rem;
  font-size: 1.2rem;
}

.social-links {
  position: absolute;
  bottom: 2rem;
  display: flex;
  gap: 1rem;
}

.social-link {
  color: var(--light-text);
  font-size: 1.2rem;
  transition: var(--transition);
}

.social-link:hover {
  color: var(--primary-color);
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 2rem;
  min-height: 100vh;
  transition: var(--transition);
}

/* Search Section */
.search-container {
  max-width: 600px;
  margin: 0 auto 2rem;
  display: flex;
  gap: 1rem;
}

.search-input {
  flex: 1;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--card-radius);
  font-size: 1rem;
  transition: var(--transition);
  background: #fff;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.search-btn {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--card-radius);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.search-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Books Grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
  min-height: 200px;
}

.book-card {
  background: var(--background);
  border-radius: var(--card-radius);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  margin: 0 auto;
}

.book-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-md);
}

.book-cover {
  position: relative;
  aspect-ratio: 3/4;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
  padding: 1rem;
}

.book-card:hover .book-overlay {
  opacity: 1;
}

.book-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn i {
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  backdrop-filter: blur(5px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.book-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
}

.book-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-color);
}

.book-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--light-text);
}

.load-more {
  text-align: center;
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border-radius: var(--card-radius);
  text-decoration: none;
  transition: var(--transition);
}

.btn-load-more:hover {
  background: var(--secondary-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 15px;
  right: 1.5rem;
  z-index: 1001;
  background: var(--page-bg);
  border: 1px solid #e2e8f0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  color: var(--text-color);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-menu-toggle:hover {
  background: var(--primary-color);
  color: white;
}

.mobile-menu-toggle.active {
  transform: rotate(180deg);
}

.mobile-menu-toggle i {
  transition: transform 0.3s ease;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 240px;
  }

  .main-content {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }

  body {
    padding-top: var(--header-height);
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
  }

  .sidebar.active {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .search-container {
    padding: 0 1rem;
  }

  .mobile-header {
    z-index: 1002;
  }

  .mobile-menu-toggle {
    z-index: 1003;
  }

  .book-card {
    max-width: 150px;
  }

  /* Overlay styles */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 576px) {
  .search-container {
    flex-direction: column;
    gap: 0.75rem;
  }

  .search-input {
    padding: 0.75rem;
  }

  .search-btn {
    width: 100%;
    padding: 0.75rem;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
  }

  .book-card {
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    max-width: 130px;
  }

  .book-title {
    font-size: 0.8rem;
  }

  .book-meta {
    font-size: 0.7rem;
  }

  .book-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn {
    width: 100%;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .book-info {
    padding: 0.5rem;
    gap: 0.2rem;
  }

  .book-author {
    font-size: 0.7rem;
  }
}

/* Add styles for mobile header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--background);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  z-index: 999;
  padding: 0 1rem;
  align-items: center;
}

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
    justify-content: center;
  }

  .mobile-header .logo {
    margin: 0;
  }
}

/* Add overlay for mobile menu */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }
}

/* Improve touch targets for mobile */
@media (max-width: 768px) {
  .nav-list a {
    padding: 1rem;
  }

  .social-link {
    padding: 0.5rem;
  }

  .btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Add these styles for the author name */
.book-author {
  font-size: 0.8rem;
  color: var(--light-text);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Add loading spinner styles */
.loading-spinner {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  color: var(--light-text);
}

.loading-spinner.active {
  display: flex;
}

.loading-spinner i {
  font-size: 1.5rem;
}

/* Section Header Styles */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
}

.update-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: var(--background);
  color: var(--text-color);
  border-radius: var(--card-radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-color);
  color: white;
}

/* Update Badge */
.update-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: var(--card-radius);
  font-size: 0.75rem;
  z-index: 1;
}

.update-time {
  font-size: 0.8rem;
  color: var(--light-text);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .update-filter {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .filter-btn {
    white-space: nowrap;
  }
}

@media (max-width: 576px) {
  .section-title {
    font-size: 1.25rem;
  }

  .filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .update-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
}

/* About Page Styles */
.about-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.about-header {
  text-align: center;
  margin-bottom: 3rem;
}

.about-title {
  font-size: 2.5rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.about-subtitle {
  font-size: 1.2rem;
  color: var(--light-text);
}

.about-content {
  display: grid;
  gap: 3rem;
}

.about-image {
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.about-image img {
  width: 100%;
  height: auto;
  display: block;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about-text h2 {
  font-size: 1.5rem;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.about-text p {
  color: var(--light-text);
  line-height: 1.8;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 1rem 0;
}

.feature-card {
  background: var(--background);
  padding: 1.5rem;
  border-radius: var(--card-radius);
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.feature-card i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--light-text);
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Responsive styles for about page */
@media (max-width: 768px) {
  .about-section {
    padding: 1rem;
  }

  .about-title {
    font-size: 2rem;
  }

  .about-subtitle {
    font-size: 1rem;
  }

  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
  }

  .feature-card {
    padding: 1rem;
  }

  .feature-card i {
    font-size: 1.5rem;
  }

  .cta-buttons {
    flex-direction: column;
  }
}

@media (max-width: 576px) {
  .about-title {
    font-size: 1.75rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .about-text h2 {
    font-size: 1.25rem;
  }
}

/* Contact Page Styles */
.contact-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.contact-header {
  text-align: center;
  margin-bottom: 3rem;
}

.contact-title {
  font-size: 2.5rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.contact-subtitle {
  font-size: 1.2rem;
  color: var(--light-text);
}

.contact-content {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr 2fr;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-card {
  background: var(--background);
  padding: 1.5rem;
  border-radius: var(--card-radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.info-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.info-card i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.info-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.info-card p {
  color: var(--light-text);
  font-size: 0.9rem;
  line-height: 1.6;
}

.contact-form {
  background: var(--background);
  padding: 2rem;
  border-radius: var(--card-radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--card-radius);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group textarea {
  height: 150px;
  resize: vertical;
}

.submit-btn {
  width: 100%;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.submit-btn i {
  font-size: 1.1rem;
}

/* Responsive styles for contact page */
@media (max-width: 992px) {
  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-info {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .info-card {
    flex: 1;
    min-width: 250px;
  }
}

@media (max-width: 768px) {
  .contact-section {
    padding: 1rem;
  }

  .contact-title {
    font-size: 2rem;
  }

  .contact-subtitle {
    font-size: 1rem;
  }

  .contact-form {
    padding: 1.5rem;
  }
}

@media (max-width: 576px) {
  .contact-title {
    font-size: 1.75rem;
  }

  .info-card {
    min-width: 100%;
  }

  .form-group input,
  .form-group textarea {
    font-size: 0.9rem;
  }

  .submit-btn {
    font-size: 0.9rem;
  }
}

/* Footer Styles */
.footer {
  margin-top: 2rem;
  padding: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--light-text);
  border-top: 1px solid #e2e8f0;
}

.footer p:first-child {
  margin-bottom: 0.5rem;
}