/**
 * Enhanced Blog Styles with Pagination and Modal
 */

.posts-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.post-card {
  background: #fff;
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border-left: 4px solid #007bff;
}

.post-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.post-header {
  margin-bottom: 20px;
}

.post-card h2 {
  margin: 0 0 12px 0;
  font-size: 24px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.post-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: #666;
  margin: 0;
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.post-meta i {
  color: #007bff;
  font-size: 12px;
}

.post-excerpt {
  color: #555;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 4px;
}

.read-more:hover {
  color: #0056b3;
  background-color: rgba(0, 123, 255, 0.1);
  transform: translateX(4px);
}

.read-more i {
  font-size: 12px;
}

/* Loading Shimmer */
.post-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  pointer-events: none;
}

.post-placeholder-title {
  height: 28px;
  border-radius: 4px;
  margin-bottom: 12px;
  width: 70%;
}

.post-placeholder-date {
  height: 14px;
  border-radius: 4px;
  margin-bottom: 20px;
  width: 200px;
}

.post-placeholder-content {
  height: 14px;
  border-radius: 4px;
  margin-bottom: 10px;
  width: 100%;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: calc(200% + 20px) 0;
  }
}

/* Pagination Controls */
.pagination-container {
  margin-top: 40px;
  padding: 20px 0;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
  background-color: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.pagination-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.5;
}

.pagination-info {
  font-size: 14px;
  color: #666;
  white-space: nowrap;
  background: white;
  padding: 8px 16px;
  border-radius: 4px;
}

.pagination-info .current-page,
.pagination-info .total-pages {
  font-weight: 600;
  color: #007bff;
}

/* Modal Styles */
.post-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.post-modal-overlay.visible {
  display: flex;
}

.post-modal-content {
  background: white;
  border-radius: 8px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideIn 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 32px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 1001;
}

.modal-close:hover {
  color: #333;
}

.modal-inner {
  padding: 40px;
}

.modal-title {
  margin: 0 0 20px 0;
  font-size: 32px;
  font-weight: 700;
  color: #333;
  line-height: 1.2;
}

.modal-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
  flex-wrap: wrap;
  font-size: 13px;
  color: #666;
}

.modal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.modal-meta i {
  color: #007bff;
  font-size: 12px;
}

.modal-content {
  font-size: 16px;
  line-height: 1.8;
  color: #555;
  margin-bottom: 30px;
}

.modal-content p {
  margin: 0 0 16px 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.modal-btn {
  padding: 10px 30px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-btn:hover {
  background-color: #0056b3;
}

/* No Posts */
.no-posts {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.no-posts p {
  font-size: 16px;
  margin: 0;
}

.no-posts i {
  font-size: 48px;
  margin-bottom: 20px;
  opacity: 0.5;
  display: block;
}

/* Error State */
.error {
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 4px;
  padding: 20px;
  text-align: center;
  color: #c33;
}

.error p {
  margin: 0;
  font-size: 16px;
}

.error i {
  margin-right: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .post-card {
    padding: 20px;
  }

  .post-card h2 {
    font-size: 20px;
  }

  .modal-inner {
    padding: 20px;
  }

  .modal-title {
    font-size: 24px;
  }

  .pagination-controls {
    flex-direction: column;
    gap: 15px;
  }

  .pagination-info {
    order: -1;
  }

  .pagination-btn {
    width: 100%;
    justify-content: center;
  }
}
