/* static/css/comments.css */

/* ========================= */
/*      COMMENTS CONTAINER   */
/* ========================= */

.comments-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background-color: #f8f9fa; /* Light background for contrast */
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* ========================= */
/*         COMMENT           */
/* ========================= */

.comment-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
    max-width: 100%; /* Ensure comment doesn't exceed container */
}

.comment-item.reply {
    margin-left: 40px; /* Indent replies */
    background-color: #f1f1f1;
}

/* ========================= */
/*       COMMENT AVATAR      */
/* ========================= */

.comment-avatar {
    width: 50px;
    height: 50px;
    background-color: #17a2b8; /* Primary color for avatar background */
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    flex-shrink: 0;
    text-transform: uppercase;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* ========================= */
/*      COMMENT CONTENT      */
/* ========================= */

.comment-content {
    flex: 1;
}

.comment-author {
    font-weight: bold;
    color: #17a2b8;
    margin-bottom: 5px;
}

.comment-text {
    font-size: 1em;
    color: #333333;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap; /* Preserve line breaks */
    margin-bottom: 10px;
}

.comment-meta {
    font-size: 0.85em;
    color: #6c757d;
}

/* ========================= */
/*      COMMENT FORM         */
/* ========================= */

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.comment-form textarea {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ced4da;
    resize: vertical;
    min-height: 80px;
    font-size: 1em;
}

.btn-submit-comment {
    align-self: flex-end;
    background-color: #17a2b8;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1em;
}

.btn-submit-comment:hover {
    background-color: #138496;
}

/* ========================= */
/*      RESPONSIVE DESIGN     */
/* ========================= */

@media (max-width: 768px) {
    .comments-container {
        padding: 15px;
    }

    .comment-item {
        padding: 10px;
    }

    .comment-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }

    .comment-item.reply {
        margin-left: 20px;
    }

    .comment-author {
        font-size: 0.95em;
    }

    .comment-text {
        font-size: 0.95em;
    }

    .comment-meta {
        font-size: 0.75em;
    }

    .btn-edit-comment {
        font-size: 0.75em;
    }

    .btn-submit-comment {
        padding: 8px 16px;
        font-size: 0.95em;
    }
}
