/* Blog Card Styles */

/* Loading and Error States */
.loading-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  min-height: 300px;
  grid-column: 1 / -1; /* Span full width */
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color, #ff6f61);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

.loading-state p, .error-state p {
  font-size: 1.1rem;
  color: #666;
  margin: 0;
}

.retry-btn {
  background: var(--primary-color, #ff6f61);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1rem;
  transition: background-color 0.3s ease;
}

.retry-btn:hover {
  background: #e55a4d;
  transform: translateY(-1px);
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2.5rem;
  margin-bottom: 4rem;
  animation: fadeInGrid 1s ease-out;
}

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

/* Staggered animation for cards */
.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.4s; }
.blog-card:nth-child(5) { animation-delay: 0.5s; }
.blog-card:nth-child(6) { animation-delay: 0.6s; }

.blog-card {
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e9ecef;
  position: relative;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.clickable-card {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.clickable-card:hover {
  transform: translateY(-12px) rotateX(5deg) rotateY(2deg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 8px 30px rgba(255, 111, 97, 0.15);
}

.clickable-card:hover .card-image {
  transform: scale(1.1);
}

.clickable-card:hover .card-shine {
  opacity: 1;
  transform: translateX(100%);
}

.clickable-card:hover .read-arrow {
  transform: translateX(5px);
}

.clickable-card:active {
  transform: translateY(-8px) scale(0.98);
  transition: all 0.1s ease;
}

/* Card Shine Effect */
.card-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  opacity: 0;
  transition: all 0.6s ease;
  z-index: 1;
}

.blog-card-image {
  position: relative;
  height: 12rem;
  overflow: hidden;
}

.blog-card-image img,
.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.1) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.blog-card:hover .image-overlay {
  opacity: 1;
}

.bookmark-btn,
.like-btn {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.bookmark-btn:hover,
.like-btn:hover {
  background: white;
  transform: scale(1.1);
}

.bookmark-btn.bookmarked {
  background: var(--warning-color);
  color: white;
}

.like-btn.liked {
  background: var(--danger-color);
  color: white;
}

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

.blog-card-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
  line-height: 1.3;
}

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

.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.meta-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
}

.meta-tag {
  background-color: #e5e7eb;
  color: #1f2937;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  text-decoration: none;
  margin-left: 0.25rem;
  transition: background-color 0.3s ease;
}

.meta-tag:hover {
  background-color: #d1d5db;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.read-more {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.read-arrow {
  transition: transform 0.3s ease;
}

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

.action-btn {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  background: #f3f4f6;
  color: var(--primary-color);
}

.share-btn {
  position: relative;
}

.share-dropdown {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  padding: 0.5rem;
  display: none;
  z-index: 10;
}

.share-dropdown.show {
  display: block;
}

.share-option {
  display: block;
  padding: 0.5rem 1rem;
  color: #374151;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.share-option:hover {
  background: #f3f4f6;
}

/* Category Tags */
.blog-categories {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.category-tag {
  background-color: #e5e7eb;
  color: #1f2937;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.3s;
}

.category-tag:hover {
  background-color: var(--primary-color);
  color: white;
}

.category-tag.active {
  background-color: var(--primary-color);
  color: white;
}
