/* --- Base Styles --- */
body {
  background: #FEEFED;
  min-height: 100vh;
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  /*padding: 2rem 1rem;*/
  color: #5a3b38;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

* {
  box-sizing: border-box;
}

/* --- Header --- */
.header-flex {
  display: flex;
  justify-content: center;      /* Center children horizontally */
  align-items: center;
  width: 100%;
  max-width: 1100px;
  margin-bottom: 2rem;
  background: #FEEFED;
  padding: 1.5rem 2rem;
  border-radius: 1.5rem;
  box-shadow: 0 8px 32px rgba(210, 158, 153, 0.25);
  animation: floatIn 1s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  margin-top: 20px;
}



.header-flex h1 {
  margin: 0;
  color: #d29e99;
  font-weight: 700;
    text-align: center;
  flex: 1;
  letter-spacing: 1px;
}

.auth-btn-wrapper {
  display: flex;
  gap: 1rem;
}

.auth-btn {
  background: linear-gradient(90deg, #d29e99 0%, #eccdd1 100%);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
  box-shadow: 0 4px 16px rgba(210, 158, 153, 0.35);
  font-family: 'Montserrat', sans-serif;
}

.auth-btn:hover {
  background: linear-gradient(90deg, #eccdd1 0%, #d29e99 100%);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 20px rgba(210, 158, 153, 0.4);
}


/* --- Add Post Button --- */

.add-post-btn-wrapper {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  max-width: 1100px;
  margin-bottom: 2rem;
}

#add-post-btn {
  background: linear-gradient(90deg, #d29e99 0%, #eccdd1 100%);
  color: #fff;
  border: none;
  border-radius: 0.8rem;
  padding: 1rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
  box-shadow: 0 4px 16px rgba(210, 158, 153, 0.35);
  font-family: 'Montserrat', sans-serif;
}

#add-post-btn:hover {
  background: linear-gradient(90deg, #eccdd1 0%, #d29e99 100%);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 20px rgba(210, 158, 153, 0.4);
}

/* --- Blog Grid --- */
.blog-grid {
  max-width: 1100px;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 2rem;
  margin: 0 auto;
  padding: 0;
}

@media (max-width: 1000px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Blog Post --- */
.blog-post.insta-style {
  background: #fdf9f7;
  border-radius: 1.5rem;
  border: 1px solid #eccdd1;
  box-shadow: 0 8px 32px rgba(210, 158, 153, 0.25);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: floatIn 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.blog-post.insta-style:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(210, 158, 153, 0.3);
}

/* --- Post Header --- */
.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  background: #fdf9f7;
  border-bottom: 1px solid #eccdd1;
  font-family: 'Inter', Arial, sans-serif;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: 'Inter', Arial, sans-serif;
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 0.3rem;
  border: 1.5px solid #eccdd1;
  background: #fff;
}

.author-name {
  font-weight: 600;
  color: #d29e99;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
  font-family: 'Inter', Arial, sans-serif;
}

.post-time {
  margin-left: 1rem;
  font-size: 0.93rem;
  color: #bfa5a0;
  font-weight: 400;
  font-family: 'Inter', Arial, sans-serif;
}

.post-actions-admin {
  display: flex;
  gap: 1rem;
  margin-left: auto;
}

.post-actions-admin button {
  background: none;
  border: none;
  color: #d29e99;
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.2s, color 0.2s;
  font-family: 'Inter', Arial, sans-serif;
}

.post-actions-admin button:hover {
  transform: scale(1.2);
  color: #b96a6a;
}

/* --- Post Media --- */
.post-media {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  position: relative;
}

.post-media img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.post-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}
.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: #fff;
  pointer-events: none;
  opacity: 0.8;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* .post-media video {
  cursor: pointer;
  display: block;
} */

.play-icon.hidden {
  opacity: 0;
  display: none;
}

/* --- Post Actions --- */
.post-actions {
  padding: 1rem 1.5rem;
  display: flex;
  gap: 2rem;
  background: #fdf9f7;
}

.like-btn,
.comment-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  color: #d29e99;
  transition: transform 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.like-btn:hover,
.comment-btn:hover {
  transform: scale(1.1);
  color: #bf7e78;
}

.like-btn.liked {
  color: #ff6b6b;
}

.like-count,
.comment-count {
  font-size: 1rem;
  color: #bfa5a0;
  font-weight: 500;
}

/* --- Post Caption --- */
.post-caption {
  padding: 15px;
  font-size: 1rem;
  color: #5a3b38;
  line-height: 1.6;
  background: #fdf9f7;
}

.post-caption strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  color: #d29e99;
  font-weight: 600;
}

.post-tags {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.tag {
  color: #d29e99;
  font-weight: 500;
  font-size: 0.9rem;
  background: #fff0f1;
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  border: 1px solid #eccdd1;
  transition: background 0.2s, color 0.2s;
}

.tag:hover {
  background: #eccdd1;
  color: #fff;
}

/* --- Comments --- */
.comments-list {
  padding: 1rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #eccdd1;
  display: none;
}

.comment-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed #eccdd1;
}

.comment-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.comment-item strong {
  color: #d29e99;
  font-weight: 600;
}

.comment-item span {
  color: #5a3b38;
  font-size: 0.95rem;
}

.comment-box {
  padding: 1rem 1.5rem;
  background: #fff;
  border-top: 1px solid #eccdd1;
  display: none;
}

.comment-input-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.comment-input-row textarea {
  flex: 1;
  height: 3rem;
  padding: 0.8rem;
  border: 1px solid #eccdd1;
  border-radius: 0.8rem;
  background: #fff;
  font-size: 1rem;
  transition: border 0.3s, box-shadow 0.3s;
  resize: vertical;
  color: #5a3b38;
  font-family: 'Montserrat', sans-serif;
}

.comment-input-row textarea:focus {
  border: 1px solid #d29e99;
  outline: none;
  box-shadow: 0 0 0 2px rgba(210, 158, 153, 0.3);
}

.comment-input-row .submit-comment {
  background: linear-gradient(90deg, #d29e99 0%, #eccdd1 100%);
  color: #fff;
  border: none;
  border-radius: 0.8rem;
  padding: 0 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
  height: 3rem;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  min-width: 6rem;
}

.comment-input-row .submit-comment:hover {
  background: linear-gradient(90deg, #eccdd1 0%, #d29e99 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(210, 158, 153, 0.35);
}

@media (max-width: 600px) {
  .comment-input-row {
    flex-direction: column;
  }

  .comment-input-row textarea,
  .comment-input-row .submit-comment {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .comment-input-row .submit-comment {
    height: auto;
    padding: 0.8rem 0;
  }
}

/* --- No Posts --- */
.no-posts {
  text-align: center;
  color: #bfa5a0;
  font-size: 1.2rem;
  margin: 3rem 0;
  grid-column: 1 / -1;
}

/* --- Modal --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 999;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: #fff0f1;
  padding: 2.5rem;
  border-radius: 1.5rem;
  width: 80%;
  max-height: 80vh;
  max-width: 600px;
  box-shadow: 0 8px 32px rgba(210, 158, 153, 0.35);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal-content::-webkit-scrollbar {
  display: none;
}

.modal.active .modal-content {
  transform: translateY(0);
}

.close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 2rem;
  cursor: pointer;
  color: #d29e99;
  transition: color 0.2s;
}

.close:hover {
  color: #bf7e78;
}

/* --- Form Group --- */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.8rem;
  color: #d29e99;
  font-weight: 600;
  font-size: 1.1rem;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid #eccdd1;
  border-radius: 0.8rem;
  background: #fff;
  transition: border 0.3s, box-shadow 0.3s;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  color: #5a3b38;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  border: 1px solid #d29e99;
  outline: none;
  box-shadow: 0 0 0 2px rgba(210, 158, 153, 0.3);
}

.form-group textarea {
  min-height: 8rem;
}

/* --- Drag & Drop Area --- */
.drag-drop-area {
  background: #fff;
  border: 2px dashed #eccdd1;
  border-radius: 0.8rem;
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: border 0.3s, background 0.3s, transform 0.3s;
}

.drag-drop-area:hover {
  border: 2px dashed #d29e99;
  background: #fff9fa;
  transform: translateY(-2px);
}

.drag-drop-area.active {
  border: 2px dashed #d29e99;
  background: #fff9fa;
}

.drag-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.drag-drop-icon {
  font-size: 3rem;
  color: #d29e99;
  margin-bottom: 1rem;
}

.drag-drop-area p {
  margin: 0;
  color: #5a3b38;
  font-size: 1rem;
}

.drag-drop-area .small {
  font-size: 0.9rem;
  color: #bfa5a0;
}

.file-info {
  margin-top: 1rem;
  color: #d29e99;
  font-size: 0.95rem;
  text-align: center;
  font-weight: 500;
}

/* --- Submit Button --- */
.submit-btn {
  background: linear-gradient(90deg, #d29e99 0%, #eccdd1 100%);
  color: #fff;
  border: none;
  border-radius: 0.8rem;
  padding: 1rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
  width: 100%;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  box-shadow: 0 4px 16px rgba(210, 158, 153, 0.35);
}

.submit-btn:hover {
  background: linear-gradient(90deg, #eccdd1 0%, #d29e99 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(210, 158, 153, 0.4);
}

/* --- Animations --- */
@keyframes floatIn {
  0% {
    transform: translateY(40px) scale(0.95);
    opacity: 0;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.5rem;
    vertical-align: middle;
}

#toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.toast {
  min-width: 220px;
  max-width: 320px;
  background: #d29e99;
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 0.8rem;
  box-shadow: 0 4px 24px rgba(210, 158, 153, 0.18);
  font-family: 'Inter', Arial, sans-serif;
  font-size: 1rem;
  opacity: 0;
  transform: translateY(-20px);
  animation: toast-in 0.4s forwards, toast-out 0.4s 2.6s forwards;
  pointer-events: none;
}

@keyframes toast-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}


.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(44, 44, 44, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.modal-content1 {
  background: #fff;
  border-radius: 1.2rem;
  padding: 2rem 2.5rem 1.5rem 2.5rem;
  box-shadow: 0 8px 32px rgba(210, 158, 153, 0.18);
  text-align: center;
  min-width: 320px;
  max-width: 320px;
  font-family: 'Inter', Arial, sans-serif;
}

.modal-content1 h3 {
  margin-top: 0;
  color: #b96a6a;
  font-size: 18px;
  font-weight: 700;
}

.modal-content1 p {
  color: #473c38;
  margin: 1rem 0 1.5rem 0;
  font-size: 16px;
}

.modal-actions {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
}

.modal-btn {
  padding: 0.5rem 1.4rem;
  border-radius: 0.7rem;
  border: none;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.modal-btn.cancel {
  background: #f3e9e7;
  color: #b96a6a;
}

.modal-btn.confirm {
  background: #d29e99;
  color: #fff;
}

.modal-btn.cancel:hover {
  background: #fdf9f7;
}

.modal-btn.confirm:hover {
  background: #b96a6a;
}
