/**
 * FEATURE: Comments Section Styles
 * File: viralgrid/assets/css/feature-comments.css
 */

.comments-area {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

/* --- Form --- */
.comment-form-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 30px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.form-textarea textarea,
.form-input input {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 1rem;
    color: #334155;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-textarea textarea:focus,
.form-input input:focus {
    background: #fff;
    border-color: #cbd5e1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.comment-form-cookies-consent {
    font-size: 0.9rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: -10px;
}

.submit-btn {
    background: #1e293b;
    color: #fff;
    border: none;
    padding: 14px 35px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    align-self: flex-end;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.submit-btn:hover { opacity: 0.9; transform: translateY(-1px); }


/* --- Comments List --- */
.comments-list-wrapper { margin-top: 60px; }
.comments-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 30px; color: #1e293b; }

/* Reset List Styles */
.comment-list, 
.comment-list .children {
    list-style: none;
    padding: 0;
    margin: 0;
}

.viralgrid-comment-item { margin-bottom: 30px; }

.comment-body {
    display: flex;
    gap: 15px;
    width: 100%;
}

/* --- DESKTOP ONLY: Add margin to comment body --- */
@media (min-width: 601px) {
    .comment-body {
        margin: 15px;
    }
}

.comment-avatar img {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    background: #e2e8f0;
    flex-shrink: 0;
}

/* Bubble Content */
.comment-bubble {
    background: #f1f5f9;
    border-radius: 16px;
    padding: 20px;
    flex-grow: 1;
    position: relative;
    min-width: 0; 
    width: 100%;
}

.comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between; 
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment-author b { font-size: 1rem; color: #1e293b; font-weight: 700; }
.comment-metadata a { text-decoration: none; color: #94a3b8; font-size: 0.8rem; }

.comment-content p {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: #475569;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.reply a {
    font-size: 0.85rem;
    font-weight: 700;
    color: #6366f1;
    text-decoration: none;
    text-transform: uppercase;
}

/* --- Nested Comments Indentation --- */
.comment-list .children {
    margin-left: 50px; 
    margin-top: 20px;
    border-left: 2px solid #f1f5f9; 
}

/* --- Dark Mode --- */
body.dark-mode .comments-area { border-color: #334155; }
body.dark-mode .comment-form-title, body.dark-mode .comments-title, body.dark-mode .comment-author b { color: #f8fafc; }
body.dark-mode .form-textarea textarea, body.dark-mode .form-input input { background: #1e293b; color: #f8fafc; border-color: #334155; }
body.dark-mode .form-textarea textarea:focus, body.dark-mode .form-input input:focus { border-color: #6366f1; }
body.dark-mode .comment-bubble { background: #1e293b; border: 1px solid #334155; }
body.dark-mode .comment-content p { color: #cbd5e1; }
body.dark-mode .submit-btn { background: #4f46e5; color: #fff; }
body.dark-mode .comment-list .children { border-color: #334155; }


/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
    .comments-area { margin-left: 20px; margin-right: 20px; }
    .comment-form-title { font-size: 1.5rem; }

    .comment-body { gap: 10px; }
    .comment-avatar img { width: 36px; height: 36px; }
    .comment-bubble { padding: 15px; }

    .comment-list .children {
        margin-left: 15px; 
        padding-left: 0;
        border-left: 1px solid #e2e8f0;
    }
    
    .comment-list .children .children {
        margin-left: 0;
        border-left: none;
    }
}

/* Dark mode adjustments for mobile borders */
@media (max-width: 600px) {
    body.dark-mode .comment-list .children {
        border-color: #334155;
    }
}