.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease forwards;
}

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

.blog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.blog-header h1 {
  margin-bottom: 0 !important;
  font-size: 2em;
  font-weight: 700;
  color: #444;
  text-shadow: 1px 1px 2px #6c6c6c;
}

.create-post-btn {
  font-size: 16px;
  color: white;
  cursor: "pointer";
  width: 150px;
  text-align: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #0f5132;
  text-decoration: none;
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

.create-post-btn:hover {
  color: white;
  background: #0a5c36;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

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

.blog-post {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.blog-post:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(111, 78, 55, 0.25);
}

.post-header {
  padding: 1rem;
  border-bottom: 1px solid #eee;
}

.user-info {
  height: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.username {
  font-weight: 500;
  font-size: 14px;
  color: #333;
}

.actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  position: relative;
}

.action-btn {
  cursor: pointer;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #6c757d;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.action-btn:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
  color: #495057;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.action-box {
  width: 120px;
  display: none;
  position: absolute;
  right: 0;
  top: 35px;
  z-index: 100;
  background: white;
  border: 1px solid #e0e0e0;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  overflow: hidden;
  animation: slideDown 0.2s ease-out;
}

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

.edit-btn,
.delete-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  text-decoration: none;
  border: none;
  background: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

.edit-btn:last-child,
.delete-btn:last-child {
  border-bottom: none;
}

.edit-btn {
  color: #495057;
}

.edit-btn:hover {
  background: #f8f9fa;
  color: #0f5132;
  transform: none;
}

.edit-btn svg {
  margin-right: 8px;
  flex-shrink: 0;
}

.delete-btn {
  color: #dc3545;
}

.delete-btn:hover {
  background: #f8d7da;
  color: #721c24;
  transform: none;
}

.delete-btn svg {
  margin-right: 8px;
  flex-shrink: 0;
}

.post-date {
  color: #666;
  font-size: 14px;
}

.post-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-content {
  padding: 1rem;
}

.post-title {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 18px;
  text-align: justify;
}

.post-excerpt {
  color: #666;
  margin-bottom: 0;
  line-height: 1.6;
  font-size: 14px;
  text-align: justify;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

.read-more {
  color: #2e4e30;
  text-decoration: none;
  font-weight: 500;
}

.read-more:hover {
  text-decoration: underline;
}

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

.pagination a {
  padding: 0.5rem 1rem;
  background: white;
  color: #333;
  text-decoration: none;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.pagination a:hover {
  background: #f0f0f0;
}

.pagination a.current {
  background: #406843;
  color: white;
}

.no-posts {
  text-align: center;
  padding: 3rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.no-posts h2 {
  color: #333;
  margin-bottom: 1rem;
}

.no-posts p {
  color: #666;
  margin-bottom: 1.5rem;
}

.no-posts a {
  color: #406843;
  text-decoration: none;
}

.no-posts a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .blog-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .blog-header h1 {
    font-size: 2rem;
  }

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

  .blog-grid {
    grid-template-columns: 1fr;
  }
}

/* Blog Modal Styles */
.blog-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  overflow-y: auto;
}

.modal-content {
  position: relative;
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  width: 80%;
  max-width: 800px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.close-modal {
  position: absolute;
  right: 20px;
  top: 10px;
  font-size: 28px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  z-index: 1;
}

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

.modal-blog-image-container {
  width: 100%;
  height: 400px;
  overflow: hidden;
}

.modal-blog-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-blog-content {
  padding: 2rem;
}

.modal-blog-content h2 {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 2rem;
}

.modal-post-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  color: #666;
  font-size: 1rem;
}

.modal-blog-content p {
  color: #555;
  line-height: 1.8;
  font-size: 1.1rem;
  margin: 0;
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10% auto;
  }

  .modal-blog-image-container {
    height: 250px;
  }

  .modal-blog-content h2 {
    font-size: 1.5rem;
  }

  .modal-blog-content p {
    font-size: 1rem;
  }
}

/* BACK BUTTON */
.cta {
  border: none;
  background: none;
  cursor: pointer;
  align-self: flex-start;
  margin: 20px 30px;
}

.cta span {
  padding-bottom: 7px;
  letter-spacing: 1px;
  font-size: 18px;
  font-weight: 500;
  padding-right: 15px;
  text-transform: uppercase;
}

.cta svg {
  transform: translateX(0);
  transition: all 0.3s ease;
}

.cta:hover svg {
  transform: translateX(-8px);
}

.cta:active svg {
  transform: scale(0.9);
}

.hover-underline-animation {
  position: relative;
  color: black;
  padding-bottom: 20px;
  padding-left: 5px;
}

.hover-underline-animation:after {
  content: "";
  position: absolute;
  width: 85%;
  transform: scaleX(0);
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary-color);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}

.cta:hover .hover-underline-animation:after {
  transform: scaleX(1);
  transform-origin: bottom left;
}
