/* public/css/comments.css - Add this to your stylesheet */

/* ========================================
   NESTED COMMENTS STYLING
   ======================================== */

/* Base comment box */
.comment-box {
  background: rgba(31, 41, 55, 0.5);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}


.comment-boxs {
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.comment-box:hover {
  background: rgba(31, 41, 55, 0.7);
  transform: translateY(-2px);
}

/* Nested reply styling */
.nested-reply {
  position: relative;
  padding-left: 0.75rem;
  transition: all 0.3s ease;
}

/* Visual connection lines for nested replies */
.nested-reply::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, 
    rgba(249, 115, 22, 0.3) 0%, 
    rgba(249, 115, 22, 0.1) 100%);
}

/* Different colors for different nesting levels */
.nested-reply[data-level="1"]::before {
  background: linear-gradient(to bottom, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.1));
}

.nested-reply[data-level="2"]::before {
  background: linear-gradient(to bottom, rgba(236, 72, 153, 0.3), rgba(236, 72, 153, 0.1));
}

.nested-reply[data-level="3"]::before {
  background: linear-gradient(to bottom, rgba(168, 85, 247, 0.3), rgba(168, 85, 247, 0.1));
}

.nested-reply[data-level="4"]::before {
  background: linear-gradient(to bottom, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.1));
}

/* Reply section styling */
.reply-section {
  margin-top: 0.75rem;
  animation: slideDown 0.3s ease-out;
}

.reply-section.hidden {
  display: none;
}

/* Reply input styling */
.reply-input {
  width: 100%;
  background: rgba(55, 65, 81, 0.8);
  border: 1px solid rgba(75, 85, 99, 0.5);
  border-radius: 8px;
  padding: 0.75rem;
  color: white;
  font-size: 0.875rem;
  resize: vertical;
  transition: all 0.2s ease;
}

.reply-input:focus {
  outline: none;
  border-color: rgba(249, 115, 22, 0.5);
  background: rgba(55, 65, 81, 1);
}

.reply-username,
.reply-email {
  background: rgba(55, 65, 81, 0.8);
  border: 1px solid rgba(75, 85, 99, 0.5);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: white;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.reply-username:focus,
.reply-email:focus {
  outline: none;
  border-color: rgba(249, 115, 22, 0.5);
  background: rgba(55, 65, 81, 1);
}

/* Main comment input */
.comment-input {
  width: 100%;
  min-height: 100px;
  background: rgba(55, 65, 81, 0.8);
  border: 1px solid rgba(75, 85, 99, 0.5);
  border-radius: 8px;
  padding: 0.75rem;
  color: white;
  font-size: 0.875rem;
  resize: vertical;
  transition: all 0.2s ease;
}

.comment-input:focus {
  outline: none;
  border-color: rgba(249, 115, 22, 0.5);
  background: rgba(55, 65, 81, 1);
}

/* Button styling */
.submit-btn,
.post-reply-btn {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 9px; 
}

        @media (min-width: 768px) {
            .submit-btn,
            .post-reply-btn {
                padding: 0.5rem 1.5rem;
                font-size: 0.875rem;
            }
        }

.submit-btn:hover,
.post-reply-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.submit-btn:active,
.post-reply-btn:active {
  transform: translateY(0);
}

.cancel-reply {
  background: rgba(55, 65, 81, 0.8);
  color: white;
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.cancel-reply:hover {
  background: rgba(75, 85, 99, 0.8);
}

/* Like and Reply buttons */
.like-btn,
.reply-toggle {
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
}

.like-btn:hover,
.reply-toggle:hover {
  transform: scale(1.05);
}

/* Replies container */
.replies-container {
  margin-top: 0.5rem;
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}

/* Responsive margins for nested levels */
@media (max-width: 768px) {
  .nested-reply {
    padding-left: 0.5rem;
  }
  
  .ml-4 { margin-left: 1rem; }
  .ml-8 { margin-left: 1.5rem; }
  .ml-12 { margin-left: 2rem; }
}

@media (min-width: 769px) {
  .ml-4 { margin-left: 1rem; }
  .ml-8 { margin-left: 2rem; }
  .ml-12 { margin-left: 3rem; }
}

/* Level badges */
[data-level] {
  position: relative;
}

/* Smooth transitions for all interactive elements */
* {
  transition: color 0.2s ease, background-color 0.2s ease;
}

/* Loading spinner */
.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Toast notifications positioning */
.fixed {
  z-index: 9999;
}

/* Hover effects for comment boxes */
.comment-box:hover .like-btn,
.comment-box:hover .reply-toggle {
  opacity: 1;
}

.like-btn,
.reply-toggle {
  opacity: 0.7;
}

/* Text selection styling */
::selection {
  background: rgba(249, 115, 22, 0.3);
  color: white;
}

/* Scrollbar styling */
.replies-container::-webkit-scrollbar {
  width: 4px;
}

.replies-container::-webkit-scrollbar-track {
  background: rgba(31, 41, 55, 0.5);
  border-radius: 4px;
}

.replies-container::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.5);
  border-radius: 4px;
}

.replies-container::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 115, 22, 0.7);
}





/* APPLE THEME REPLY BOX CSS */

  .glass-effect {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  
  .apple-input {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .apple-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  }

  
  .apple-button {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .apple-button:active {
    transform: scale(0.96);
  }


  /* ========================================
   COLLAPSIBLE THREAD STYLING
   ======================================== */

/* Expand/Collapse button */
.expand-thread-btn {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.expand-thread-btn:hover {
  background: rgba(59, 130, 246, 0.1);
}

.expand-thread-btn svg {
  transition: transform 0.3s ease;
}

/* Collapsed state */
.replies-container.hidden {
  display: none;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
}

/* Expanded state */
.replies-container:not(.hidden) {
  display: block;
  opacity: 1;
  animation: expandThread 0.3s ease-out;
}

/* Expand animation */
@keyframes expandThread {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 5000px;
    transform: translateY(0);
  }
}

/* Collapse animation */
@keyframes collapseThread {
  from {
    opacity: 1;
    max-height: 5000px;
  }
  to {
    opacity: 0;
    max-height: 0;
  }
}

/* Thread indicator for collapsed state */
.nested-reply[data-level="2"],
.nested-reply[data-level="3"],
.nested-reply[data-level="4"] {
  position: relative;
}

/* Highlight effect when expanding */
.replies-container:not(.hidden) > .nested-reply:first-child {
  animation: highlightReply 0.5s ease-out;
}

@keyframes highlightReply {
  0% {
    background-color: rgba(59, 130, 246, 0.1);
  }
  100% {
    background-color: transparent;
  }
}

/* Reply count badge style */
.expand-thread-btn span {
  white-space: nowrap;
}

/* Smooth transitions for all collapsible elements */
.replies-container {
  transition: opacity 0.3s ease, max-height 0.3s ease;
}

/* ========================================
   MOBILE REPLY BOX OVERLAY (FULL WIDTH CENTERED)
   ======================================== */

@media (max-width: 767px) {
  /* Reply section as full-width centered overlay on mobile */
  .reply-section {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90vw !important;
    max-width: 500px !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
    margin: 0 !important;
    animation: mobileReplySlideIn 0.3s ease-out !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
  }

  /* Backdrop overlay */
  .reply-section::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: -1;
  }

  /* Glass effect enhancement for mobile */
  .reply-section .glass-effect {
    background: rgba(20, 20, 30, 0.95) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 1.25rem !important;
  }

  /* Mobile reply animation */
  @keyframes mobileReplySlideIn {
    from {
      opacity: 0;
      transform: translate(-50%, -45%);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%);
    }
  }

  /* Adjust inputs for mobile overlay */
  .reply-section .reply-input {
    font-size: 11px !important;
    padding: 0.75rem !important;
    max-height: 60px;
  }

  .reply-section .reply-username,
  .reply-section .reply-email {
    font-size: 11px !important;
    padding: 0.60rem !important;
    max-height: 30px;
  }

  /* Button adjustments for mobile */
  .reply-section .post-reply-btn,
  .reply-section .cancel-reply {
    font-size: 11px !important;
    padding: 0.60rem 0.80rem !important;
    max-height: 25px;
    text-align: center;
  }

  /* Close button enhancement */
  .reply-section .cancel-reply {
    background: #374151 !important;
    color: white !important;
  }

  .reply-section .cancel-reply:hover {
    background: #1F2937 !important;
  }

  /* Prevent body scroll when reply box is open */
  body.reply-open {
    overflow: hidden;
  }
}