/* Modern Comments System Styling */

/* Container */
.comments-section-embedded {
    background: rgba(20, 22, 35, 0.4);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 30px rgba(0,0,0,0.2);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Comment Card (Glassmorphism) */
.comment-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(5px);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08); /* Slightly lighter border */
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.comment-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

/* Header Grid */
.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.comment-header-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Avatar Styling */
.comment-avatar-small, .user-avatar, .user-avatar-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(59, 130, 246, 0.4); /* Blue-ish border */
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.user-avatar-placeholder {
  background: #1e293b;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
}

/* Metadata */
.comment-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.3;
}

.comment-author {
  color: var(--primary); /* Blue */
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.3px;
}

.comment-date {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
  font-weight: 500;
}

/* Badges */
.pinned-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 5px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 2px 5px rgba(245, 158, 11, 0.3);
}

/* Body Text */
.comment-body {
  color: #e2e8f0;
  line-height: 1.6;
  font-size: 0.95rem;
  padding-left: calc(42px + 1rem); /* Align with text start */
  overflow-wrap: break-word;
}

/* Actions Bar */
.comment-actions {
  padding-left: calc(42px + 1rem);
  display: flex;
  gap: 1rem;
  margin-top: 0.2rem;
}

.reply-btn, .pin-comment-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
}

.reply-btn:hover, .pin-comment-btn:hover {
    background: rgba(255,255,255,0.05);
    color: var(--highlight);
    border-color: rgba(255, 255, 255, 0.1);
}

.pin-comment-btn.active {
    color: #f59e0b; /* Golden/Amber */
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.05);
}

.pin-comment-btn.active:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.5);
}

.comment-card.pinned {
    border: 1.5px solid rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, rgba(20, 22, 35, 0.6), rgba(245, 158, 11, 0.05));
    box-shadow: 0 4px 20px rgba(0,0,0,0.3), inset 0 0 15px rgba(245, 158, 11, 0.05);
    position: relative;
    overflow: hidden;
}

.comment-card.pinned::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* Delete Button */
.delete-comment-btn {
  background: transparent;
  color: #ef4444; /* Red */
  border: 1px solid rgba(239, 68, 68, 0.3);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.delete-comment-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  transform: scale(1.05);
}

/* Input Forms */
.comment-form-box {
  background: rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-form-box {
    animation: fadeInDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.comment-form-box h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
}

textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  color: white;
  margin-bottom: 1rem;
  outline: none;
  font-family: inherit;
  min-height: 100px;
  resize: vertical;
  transition: border-color 0.3s, box-shadow 0.3s;
}

textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.comment-submit-btn, .reply-submit-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.comment-submit-btn:hover, .reply-submit-btn:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

.comment-submit-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.reply-submit-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.reply-cancel-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.reply-cancel-btn:hover {
    background: rgba(255,255,255,0.05);
    color: white;
    border-color: white;
}

/* Auth UI */
.auth-user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(59, 130, 246, 0.1);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  margin-bottom: 1.5rem;
}

.logout-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.8);
}

.login-wall-prompt {
  text-align: center;
  padding: 2.5rem;
  background: rgba(59, 130, 246, 0.03);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: inset 0 0 40px rgba(59, 130, 246, 0.05);
}

.login-wall-prompt p {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.toggle-comments-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  color: #000000;
  border: 2px solid #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.85rem;
  font-family: 'Exo 2', sans-serif;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.toggle-comments-btn:hover {
  background: transparent;
  color: #ffffff;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.toggle-comments-btn svg {
    transition: transform 0.3s ease;
}

.toggle-comments-btn:hover svg {
    transform: rotate(15deg) scale(1.1);
}

.view-all-comments-btn {
    background: transparent;
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--primary);
    padding: 0.6rem 2rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-all-comments-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.google-btn, .google-btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ffffff;
  color: #000000;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  text-transform: uppercase;
  font-size: 0.8rem;
  font-family: 'Exo 2', sans-serif;
}

.google-btn:hover, .google-btn-small:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2);
}

.google-btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
}

/* Replies Indentation */
.comment-replies {
    margin-left: 2rem;
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reply-card {
    background: rgba(255,255,255,0.02);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.reply-form-container {
    margin-top: 1rem;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    animation: fadeIn 0.3s ease;
}

.reply-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
}

/* Responsive */
@media (max-width: 600px) {
    .comments-section-embedded {
        padding: 0rem;
    }
    .comment-card {
        padding: 0.75rem;
        gap: 0rem;
    }
    
    .comment-body {
        padding-left: 0; 
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .comment-actions {
        padding-left: 0;
        gap: 0.5rem;
    }

    .comment-header-main {
        gap: 0.6rem;
    }
    
    .comment-avatar-small {
        width: 32px;
        height: 32px;
    }
    
    .comment-author {
        font-size: 0.9rem;
    }

    .comment-date {
        font-size: 0.7rem;
    }

    .comment-replies {
        margin-left: 0.5rem;
        padding-left: 0.4rem;
    }
}