/**
 * Archive Pages Styles for SpeedRead Theme
 * Professional styling for ebook category, author archives, and blog archives
 * Two distinct archive types: Blog Posts and Ebooks
 */

/* Archive Page Container - Full Width */
.archive-container {
  max-width: 100%;
  margin: 0;
  padding: 2rem 1rem;
}

/* Full Width Archive Content */
.archive-content-full-width {
  width: 100%;
  margin: 0;
  padding: 2rem 1rem;
  background: transparent;
}

/* Center the grid content within full width */
.archive-content-full-width .universal-cards-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Center archive stats within full width */
.archive-content-full-width .archive-stats {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Center pagination within full width */
.archive-content-full-width .pagination {
  max-width: 1200px;
  padding: 0 1rem;
}

/* Archive Title */
.archive-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
  padding-bottom: 1rem;
}

.archive-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px;
}

/* Archive Description */
.archive-description {
  text-align: center;
  color: #64748b;
  font-size: 1.1rem;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* Ebook in Blog Grid Wrapper */
.ebook-in-blog-grid {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.ebook-in-blog-grid .universal-book-card {
    max-width: 300px;
    width: 100%;
}

/* Blog Post in Search Results */
.blog-post-in-search {
    grid-column: 1 / -1; /* Full width in grid */
    max-width: 600px;
    margin: 0 auto 2rem;
}

.blog-post-in-search .blog-post-card {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.blog-post-in-search .blog-post-thumbnail {
    flex-shrink: 0;
    width: 150px;
}

.blog-post-in-search .blog-post-content {
    flex: 1;
}

/* No Results Found */
.no-ebooks-found {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 12px;
  margin: 2rem 0;
  border: 1px solid #e2e8f0;
}

.no-ebooks-found::before {
  content: '📚';
  display: block;
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-ebooks-found p {
  font-size: 1.2rem;
  color: #64748b;
  margin: 0;
  font-weight: 500;
}

/* Archive Stats */
.archive-stats {
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  text-align: center;
}

.archive-stats h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: #475569;
  font-weight: 600;
}

.archive-stats .stats-number {
  font-size: 2rem;
  font-weight: 700;
  color: #667eea;
  display: block;
}

/* Pagination Styling */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 4rem 0 2rem;
  flex-wrap: wrap;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0.5rem 1rem;
  background: white;
  color: #64748b;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers:focus {
  background: #667eea;
  color: white;
  border-color: #667eea;
  transform: translateY(-1px);
}

.pagination .page-numbers.current {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next {
  padding: 0.5rem 1.5rem;
  font-weight: 600;
}

.pagination .page-numbers.dots {
  background: none;
  border: none;
  cursor: default;
}

.pagination .page-numbers.dots:hover {
  background: none;
  color: #64748b;
  transform: none;
}

/* Archive Filter Bar */
.archive-filters {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.archive-filters .filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.archive-filters label {
  font-weight: 600;
  color: #374151;
  font-size: 0.9rem;
}

.archive-filters select {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  color: #374151;
  font-size: 0.9rem;
  min-width: 120px;
}

.archive-filters select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Archive Breadcrumbs */
.archive-breadcrumbs {
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.archive-breadcrumbs ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.archive-breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #64748b;
  font-size: 0.9rem;
}

.archive-breadcrumbs li:not(:last-child)::after {
  content: '→';
  color: #cbd5e0;
  font-weight: 600;
}

.archive-breadcrumbs a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.archive-breadcrumbs a:hover {
  color: #764ba2;
}

/* Responsive Design */
@media (max-width: 768px) {
  .archive-container {
    padding: 1rem 0.75rem;
  }
  
  .archive-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }
  
  .archive-description {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
  
  .archive-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .archive-filters .filter-group {
    justify-content: space-between;
  }
  
  .pagination {
    gap: 0.25rem;
  }
  
  .pagination .page-numbers {
    min-width: 40px;
    height: 40px;
    padding: 0.25rem 0.75rem;
    font-size: 0.9rem;
  }
  
  .no-ebooks-found {
    padding: 3rem 1rem;
  }
  
  .no-ebooks-found::before {
    font-size: 3rem;
  }
}

@media (max-width: 480px) {
  .archive-title {
    font-size: 1.75rem;
  }
  
  .archive-stats {
    padding: 1rem;
  }
  
  .archive-stats .stats-number {
    font-size: 1.5rem;
  }
  
  .pagination .page-numbers.prev,
  .pagination .page-numbers.next {
    padding: 0.25rem 1rem;
  }
}

/* Loading States */
.archive-loading {
  text-align: center;
  padding: 4rem 2rem;
}

.archive-loading::before {
  content: '';
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Archive Header Enhancement */
.archive-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 0;
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.archive-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="90" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

.archive-header .container {
  position: relative;
  z-index: 1;
}

.archive-header h1 {
  font-size: 3rem;
  font-weight: 800;
  margin: 0 0 1rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.archive-header p {
  font-size: 1.2rem;
  opacity: 0.9;
  margin: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Extra Small Mobile (320px and below) */
@media (max-width: 320px) {
  .archive-container {
    padding: 0.8rem 0.5rem;
  }
  
  .archive-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .archive-description {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  
  .archive-stats {
    padding: 0.8rem;
  }
  
  .archive-stats .stats-number {
    font-size: 1.2rem;
  }
  
  .pagination .page-numbers {
    min-width: 32px;
    height: 32px;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
  }
  
  .pagination .page-numbers.prev,
  .pagination .page-numbers.next {
    padding: 0.2rem 0.8rem;
  }
  
  .no-ebooks-found {
    padding: 2rem 0.8rem;
  }
  
  .no-ebooks-found::before {
    font-size: 2.5rem;
  }
  
  .archive-header {
    padding: 2rem 0;
  }
  
  .archive-header h1 {
    font-size: 2rem;
  }
  
  .archive-header p {
    font-size: 1rem;
  }
}

/* ====================================
   ENHANCED ARCHIVE HEADERS
   ==================================== */

/* Professional Archive Header for Ebooks */
.archive-header-enhanced {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.archive-header-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.archive-header-enhanced .container {
  position: relative;
  z-index: 1;
}

.archive-header-enhanced h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 0 4px 8px rgba(0,0,0,0.3);
  background: linear-gradient(45deg, #ffffff, #f0f9ff, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.archive-header-enhanced .archive-description {
  font-size: 1.3rem;
  opacity: 0.95;
  font-weight: 400;
  background: rgba(255,255,255,0.15);
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  display: inline-block;
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255,255,255,0.2);
  margin-top: 1rem;
  max-width: 600px;
}

.archive-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
}

.stat-item {
  background: rgba(255,255,255,0.1);
  padding: 1rem 2rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  display: block;
  color: #ffffff;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Simple Archive Book Count */
.archive-book-count {
  margin-top: 1.5rem;
  text-align: center;
}

.archive-book-count span {
  background: rgba(255,255,255,0.15);
  padding: 0.8rem 2rem;
  border-radius: 25px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 1.1rem;
  font-weight: 500;
  color: #ffffff;
  display: inline-block;
}

/* ====================================
   BLOG ARCHIVE STYLES
   ==================================== */

/* Blog Archive Header */
.blog-archive-header {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
  color: white;
  padding: 3rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.blog-archive-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
}

.blog-archive-header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.blog-archive-header .archive-description {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 500px;
  margin: 0 auto;
}

/* Blog Posts Grid */
.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.blog-post-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
}

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

.blog-post-thumbnail {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.blog-post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.blog-post-card:hover .blog-post-thumbnail img {
  transform: scale(1.05);
}

.blog-post-content {
  padding: 1.5rem;
}

.blog-post-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.blog-post-title a {
  color: #1f2937;
  text-decoration: none;
  transition: color 0.2s;
}

.blog-post-title a:hover {
  color: #3b82f6;
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.blog-post-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.blog-post-excerpt {
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.blog-read-more:hover {
  color: #1d4ed8;
  transform: translateX(4px);
}

.blog-read-more::after {
  content: '→';
  transition: transform 0.2s;
}

.blog-read-more:hover::after {
  transform: translateX(2px);
}

/* Blog Archive No Posts */
.no-blog-posts {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 20px;
  margin: 3rem 0;
}

.no-blog-posts::before {
  content: '📝';
  font-size: 4rem;
  display: block;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

.no-blog-posts h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1rem;
}

.no-blog-posts p {
  font-size: 1.1rem;
  color: #6b7280;
  max-width: 400px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

/* ====================================
   RESPONSIVE DESIGN ENHANCEMENTS
   ==================================== */

@media (max-width: 768px) {
  .archive-header-enhanced h1 {
    font-size: 2.5rem;
  }
  
  .archive-header-enhanced .archive-description {
    font-size: 1.1rem;
    padding: 0.6rem 1.2rem;
  }
  
  .archive-stats {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  
  .stat-item {
    padding: 0.8rem 1.5rem;
  }
  
  .blog-archive-header h1 {
    font-size: 2.2rem;
  }
  
  .blog-posts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .blog-post-content {
    padding: 1.2rem;
  }
}

@media (max-width: 480px) {
  .archive-header-enhanced {
    padding: 2.5rem 0;
  }
  
  .archive-header-enhanced h1 {
    font-size: 2rem;
  }
  
  .blog-archive-header {
    padding: 2rem 0;
  }
  
  .blog-archive-header h1 {
    font-size: 1.8rem;
  }
  
  .blog-post-thumbnail {
    height: 160px;
  }
  
  .blog-post-content {
    padding: 1rem;
  }
  
  .blog-post-title {
    font-size: 1.1rem;
  }
  
  .no-blog-posts {
    padding: 2.5rem 1rem;
  }
  
  .no-blog-posts::before {
    font-size: 3rem;
  }
}

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