/**
 * Comments Section Styling
 * CSSDad.com
 */

/* Container Setup */
.comments-section-container {
    width: 100%;
    max-width: 100%;
    margin: 4rem auto 2rem;
    padding-top: 3rem;
    border-top: 1px solid #e2e8f0;
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    box-sizing: border-box;
}

/* Header */
.comments-header {
    margin-bottom: 2.5rem;
}

.comments-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.025em;
}

.comments-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

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

.comment-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comment-card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03), 0 1px 3px rgba(15, 23, 42, 0.02);
}

.comment-main {
    display: flex;
    gap: 1rem;
}

/* Avatars */
.comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.comment-body {
    flex-grow: 1;
}

.comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.comment-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

.admin-badge {
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 9999px;
    letter-spacing: 0.025em;
    display: inline-block;
}

.comment-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
    word-break: break-word;
}

/* Actions (Reply trigger) */
.comment-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 1rem;
}

.reply-trigger-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.reply-trigger-btn:hover {
    color: #4f46e5;
    background-color: #f1f5f9;
}

.reply-trigger-btn svg {
    transition: transform 0.2s ease;
}

.reply-trigger-btn:hover svg {
    transform: translateX(-2px);
}

/* Threaded Replies Styling */
.comment-replies-wrapper {
    margin-left: 3rem;
    margin-top: 1rem;
    padding-left: 1.25rem;
    border-left: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.reply-card {
    border-color: #f1f5f9;
    background: #f8fafc;
    padding: 1rem;
}

/* Loading Trigger Section */
.comments-loading-container {
    text-align: center;
    margin: 2rem 0;
}

.load-more-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 0.75rem 1.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Fallback message */
.no-comments-fallback {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}

.no-comments-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.7;
}

.no-comments-fallback p {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
}

/* Form Container Styling */
.comment-form-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.comment-form-container h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.25rem 0;
}

.form-helper-text {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 1.5rem 0;
}

/* Form Layout */
.comment-submission-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.form-group input,
.form-group textarea {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #4f46e5;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    outline: none;
}

.form-group textarea {
    resize: vertical;
}

/* Reply Active Bar */
.reply-active-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #eef2ff;
    border: 1px solid #c7d2fe;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #4f46e5;
}

.cancel-reply-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

.cancel-reply-btn:hover {
    text-decoration: underline;
}

/* Submit Button & Spinners */
.submit-comment-btn {
    align-self: flex-start;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #ffffff;
    border: none;
    padding: 0.85rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.submit-comment-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
    background: linear-gradient(135deg, #5c54f2 0%, #493fdb 100%);
}

.submit-comment-btn:active {
    transform: translateY(0);
}

/* Notification Banners */
.comment-form-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.comment-form-message.success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.comment-form-message.error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Spinners animations */
.spinner, .btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 0.6s linear infinite;
}

.load-more-btn .spinner {
    color: #475569;
}

.submit-comment-btn .btn-spinner {
    color: #ffffff;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive queries */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .comment-replies-wrapper {
        margin-left: 1.5rem;
        padding-left: 0.75rem;
    }
    
    .submit-comment-btn {
        width: 100%;
        justify-content: center;
    }
    
    .comments-header h2 {
        font-size: 1.5rem;
    }
}
