body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f9f9f9;
  color: #333;
  width: 100%;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

.blog-view-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

.blog-post {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: slideInUp 0.6s ease-out;
}

.post-header {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, #2d5a27 0%, #1a4018 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(45, 90, 39, 0.2);
}

.post-title {
  margin: 0 0 15px 0 !important;
  font-size: 2.5rem;
  font-weight: 700;
  animation: slideInDown 0.6s ease-out;
  color: white;
  text-align: left;
}

.post-meta {
  display: flex;
  justify-content: left;
  gap: 2rem;
  font-size: 1rem;
  opacity: 0.9;
  animation: fadeIn 0.8s ease-out;
}

.post-author {
  font-weight: 600;
}

.post-date {
  opacity: 0.8;
}

.back-btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: #333;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  margin-bottom: 2rem;
}

.back-btn:hover {
  background: #555;
}

.edit-btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: #4caf50;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  margin-left: 1rem;
}

.edit-btn:hover {
  background: #45a049;
}

/* Image preview styles */
.image-preview-container {
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.image-preview {
  max-width: 300px;
  max-height: 300px;
  object-fit: contain;
  border-radius: 5px;
  display: none;
  margin-top: 1rem;
  border: 2px solid #ddd;
}

.preview-placeholder {
  width: 300px;
  height: 200px;
  background-color: #f0f0f0;
  border: 2px dashed #ccc;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.9rem;
  margin-top: 1rem;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  overflow: auto;
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
}

.close-modal {
  position: absolute;
  right: 35px;
  top: 15px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

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

/* Animation */
.modal-content {
  animation: zoom 0.3s ease-in-out;
}

@keyframes zoom {
  from {
    transform: scale(0.1);
  }
  to {
    transform: scale(1);
  }
}

/* Blog actions container */
.blog-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
}

/* Save button styles */
.save-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  background: #fff;
  color: #333;
  border: 2px solid #333;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.save-btn:hover {
  background: #f0f0f0;
}

.save-btn.saved {
  background: #333;
  color: #fff;
}

.save-btn i {
  font-size: 1.1rem;
}

/* Alert message styles */
.alert-message {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 1rem 2rem;
  border-radius: 5px;
  color: white;
  font-weight: 500;
  display: none;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.alert-message.success {
  background-color: #4caf50;
}

.alert-message.error {
  background-color: #f44336;
}

/* Responsive styles */
@media (max-width: 768px) {
  .blog-actions {
    flex-wrap: wrap;
  }

  .back-btn,
  .save-btn,
  .edit-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .alert-message {
    left: 20px;
    right: 20px;
    text-align: center;
  }
}

.post-image {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 0;
}

.post-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-image:hover img {
  transform: scale(1.05);
}

.post-content {
  padding: 2rem;
  background: white;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #555;
  text-align: justify;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: #2d5a27;
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: 600;
}

.post-content h1 {
  font-size: 2rem;
  border-bottom: 3px solid #2d5a27;
  padding-bottom: 10px;
}

.post-content h2 {
  font-size: 1.5rem;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 8px;
}

.post-content h3 {
  font-size: 1.3rem;
}

.post-content p {
  font-size: 1rem;
  line-height: 1.7;
  text-align: justify;
  white-space: pre-line;
  margin-bottom: 15px;
}

.post-content strong {
  color: #2d5a27;
  font-weight: 600;
}

.post-content em {
  color: #666;
  font-style: italic;
}

/* Animation Keyframes */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .blog-view-container {
    padding: 15px;
  }

  .post-header {
    padding: 30px 20px;
  }

  .post-title {
    font-size: 2rem;
  }

  .post-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .post-content {
    padding: 30px 20px;
    font-size: 1rem;
  }

  .post-image img {
    height: 250px;
  }
}

@media (max-width: 480px) {
  .blog-view-container {
    padding: 10px;
  }

  .post-header {
    padding: 25px 15px;
  }

  .post-title {
    font-size: 1.8rem;
  }

  .post-content {
    padding: 25px 15px;
  }

  .post-image img {
    height: 200px;
  }
}

.blog-container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 0;
}

.blog-section {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.blog-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.blog-section img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-section:hover img {
  transform: scale(1.05);
}

.section-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 15px;
  text-align: center;
}

.section-title span {
  font-size: 1.2em;
  font-weight: bold;
}
