/* styles.css */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Poppins:wght@300;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #FF6FD8 0%, #3813C2 100%);
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

input[type="text"] {
  color: #333;
}

.container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.logo {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}

.btn {
  background-color: #fff;
  color: #3813C2;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn:hover {
  background-color: #e0e0e0;
}

main {
  flex: 1;
  padding: 2rem;
}

.posts-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post {
  position: relative;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  transition: transform 0.3s ease;
}

.post:hover {
  transform: translateY(-10px);
}

.post-content {
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;

  /* Add these */
  white-space: pre-wrap; /* Preserves line breaks and spacing */
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
}

/* Add this for paragraph spacing */
.post-content p {
  margin-bottom: 1rem;
}

/* Add this to ensure emojis stand out */
.post-content p:first-child {
  font-size: 1.1em;
}

.post-content a {
  word-break: break-word;
  overflow-wrap: break-word;
  display: inline-block;
  max-width: 100%;
}

.social-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.video-url {
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  display: block;
  font-size: 0.75rem;
  color: #a0a0a0;
  justify-content: right;
}

.social-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.share-buttons {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.download-button {
  white-space: nowrap;
}

.post-video {
  margin-top: 1rem;
  width: 100%;
  border-radius: 10px;
  outline: none;
}

.post button[title="Copy post text and video URL"] {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
}

.post button[title="Copy post text and video URL"]:hover {
  color: #FF6FD8;
}

.share-buttons a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fff;
}

.share-buttons a:hover {
  color: #FF6FD8;
}

/* Enhanced progress indicator styles */
.progress-indicator {
  display: block !important; /* Force display */
  margin-bottom: 0.5rem;
  color: #FFD700; /* Already in your CSS */
  text-align: center;
  width: 100%;
  font-size: 0.875rem;
}

/* Ensure progress bar is visible across all viewports */
.bg-gray-700 {
  background-color: rgba(55, 65, 81, 0.7);
  height: 0.5rem;
  border-radius: 9999px;
  width: 100%;
  margin-bottom: 0.5rem;
}

.bg-blue-500 {
  background-color: #3B82F6;
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.history-container {
  margin-top: 3rem;
}

.date-header {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #FF6FD8;
  margin-bottom: 1rem;
  border-bottom: 2px solid #FF6FD8;
  padding-bottom: 0.5rem;
}

.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 300px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.notification {
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: auto;
  position: relative;
}

.notification.success {
  background-color: rgba(40, 167, 69, 0.9);
}

.notification.error {
  background-color: rgba(220, 53, 69, 0.9);
}

.notification.info {
  background-color: rgba(23, 162, 184, 0.9);
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
}

.notification .close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.notification .close-btn:hover {
  color: #ddd;
}

.line-clamp {
  display: -webkit-box; /* For older WebKit browsers */
  display: flex; /* For modern browsers */
  -webkit-line-clamp: 3; /* Non-standard but widely supported */
  line-clamp: 3; /* Standard property, though not widely supported */
  -webkit-box-orient: vertical; /* For older WebKit browsers */
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.6em * 2); /* Adjust based on line height */
  max-lines: 3;
}

/* Optional: Smooth transition for expanding/collapsing */
.post-content {
  transition: max-height 0.3s ease;
}

.rtl-text {
  direction: rtl !important;
  text-align: right !important;
}

.rtl-text .post-content {
  text-align: right !important;
}

.rtl-text .share-buttons {
  justify-content: flex-end !important;
}

.post:not(.rtl-text) {
  direction: ltr !important;
  text-align: left !important;
}

.post:not(.rtl-text) .post-content {
  text-align: left !important;
}

footer {
  text-align: center;
  padding: 1rem 0;
  background-color: rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
}

@media (min-width: 769px) {
  .social-buttons-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .video-url {
    flex: 1;
    margin-right: 1rem;
    margin-bottom: 1rem; /* Add this line */
  }
  
  .social-actions {
    flex-shrink: 0;
  }

  .history-post {
    display: block;
  }

  .show-more-history {
    display: none;
  }
}

@media (max-width: 768px) {
  .social-buttons-container {
    flex-direction: column;
    align-items: stretch;
  }

  .social-actions {
    flex-direction: column;
    align-items: center;
  }

  .share-buttons {
    justify-content: center;
  }

  .download-button {
    margin: 0;
    text-align: center;
    width: 100%;
  }

  .video-url {
    text-align: left;
    margin-bottom: 1rem;
  }

  .history-post {
    display: none;
  }

  .history-post.show {
    display: block;
  }

  .show-more-history {
    display: block;
    margin-top: 1rem;
    text-align: center;
    cursor: pointer;
    color: #FF6FD8;
    font-weight: bold;
  }
}

/* Add these to your styles.css file */

/* Past Posts Container specific styles */
.past-posts-container {
  position: relative;
  transition: max-height 0.5s ease-in-out;
}

/* Gradient overlay styling */
.gradient-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(147, 51, 234, 0.5) 50%,
    rgb(147, 51, 234) 100%
  );
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Expand/Collapse button styling */
.expand-collapse-btn {
  display: block;
  margin: 1rem auto;
  padding: 0.5rem 1.5rem;
  background-color: #3813C2;
  color: white;
  border: none;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  position: relative;
}

.expand-collapse-btn:hover {
  background-color: #db2777;
  transform: translateY(-1px);
}

/* Container transition states */
.past-posts-collapsed {
  max-height: 24rem; /* 384px - matches Tailwind's h-96 */
  overflow: hidden;
}

.past-posts-expanded {
  max-height: none;
}

/* Add smooth transition for height changes */
.past-posts-transition {
  transition: all 0.5s ease-in-out;
}

/* Space between posts */
.past-posts-container > .post {
  margin-bottom: 1rem;
}

/* Ensure gradient doesn't interfere with post interaction */
.past-posts-container .post {
  position: relative;
  z-index: 1;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .past-posts-collapsed {
    max-height: 20rem; /* Slightly smaller on mobile */
  }
  
  .gradient-overlay {
    height: 80px;
  }
}