/*
 * Component: Custom Comments
 * Purpose: Styles the WordPress comment form and list for the "Codes by You" tab.
 */

/* The new wrapper for the intro text and the form */
.bfwt-user-submission-area {
    background-color: var(--color-background-soft);
    padding: clamp(20px, 4vw, 30px);
    border-radius: var(--border-radius-base);
    border: 1px solid var(--color-border-light);
    margin-bottom: 30px;
}

/* The intro text block inside the new wrapper */
.bfwt-user-codes-intro {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--color-border-light);
}
.bfwt-user-codes-intro h4 {
    margin: 0 0 5px 0;
    color: var(--color-text-base);
    font-size: var(--font-size-lg);
}
.bfwt-user-codes-intro p {
    margin: 0;
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
}

/* --- Comment Form Styling --- */
#user-codes .comment-respond {
    background-color: transparent;
    padding: 0;
    border: none;
    margin: 0;
}

#user-codes .logged-in-as {
    text-align: center;
    font-size: var(--font-size-xs);
    background: var(--color-background);
    padding: 8px;
    border-radius: var(--border-radius-small);
}

#user-codes .comment-form-field-textarea {
    margin: 0;
}

#user-codes textarea#comment {
    width: 100%;
    background-color: var(--color-background);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--border-radius-small);
    padding: 12px;
    font-size: var(--font-size-base);
    color: var(--color-text-base);
    min-height: 100px;
}
#user-codes textarea#comment:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
    outline: none;
}

#user-codes .form-submit {
    margin: 15px 0 0 0;
    padding: 0;
    text-align: center;
}

#user-codes #submit {
    width: 100%;
    max-width: 250px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius-small);
    background-color: var(--color-primary);
    color: var(--color-background) !important;
    font-size: var(--font-size-base);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
#user-codes #submit:hover {
    background-color: var(--color-secondary);
    transform: scale(1.05);
}

/* --- Comment List Styling --- */
#user-codes .ct-comments-title {
    text-align: center;
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    margin-bottom: 20px;
    font-style: italic;
}

#user-codes .ct-comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#user-codes .ct-comment-inner {
    background-color: var(--color-background);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-base);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#user-codes .ct-comment-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border-light);
}

#user-codes .ct-media-container img {
    border-radius: 50%;
    width: 40px !important;
    height: 40px !important;
}

#user-codes .ct-comment-author {
    margin: 0;
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--color-text-base);
    flex-grow: 1;
}

#user-codes .ct-comment-meta-data {
    font-size: var(--font-size-xs);
    color: var(--color-text-subtle);
    text-align: right;
    white-space: nowrap;
}
#user-codes .ct-comment-meta-data a { color: var(--color-text-muted); }
#user-codes .ct-comment-meta-data a:hover { color: var(--color-primary); }

#user-codes .ct-comment-content {
    line-height: 1.6;
    word-break: break-word;
}
#user-codes .ct-comment-content p:first-child { margin-top: 0; }
#user-codes .ct-comment-content p:last-child { margin-bottom: 0; }