/* comments/comments.css */

:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --badge-bg: #e0f2fe;
    --badge-text: #0369a1;
}

/* Base Wrapper styles */
.comment-section {
    max-width: 800px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
}

.comment-section-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

/* Alert Box */
.comment-alert-box {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}
.comment-alert-box.alert-error {
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}
.comment-alert-box.alert-success {
    background-color: #f0fdf4;
    border-left: 4px solid #22c55e;
    color: #166534;
}

/* Form Styles */
.comment-form-container {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.comment-form-container textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-form-container textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.textarea-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

#char-counter {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-form-container button[type="submit"] {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
}

.comment-form-container button[type="submit"]:hover {
    background-color: #1a252f;
}

.comment-form-container button[type="submit"]:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* Required Guest login Notice */
.login-required-notice {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
}

.login-required-notice a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.login-required-notice a:hover {
    text-decoration: underline;
}

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

.comment-card {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    user-select: none;
}

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

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

.comment-author {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.badge-you {
    background-color: var(--badge-bg);
    color: var(--badge-text);
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 600;
}

.comment-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.comment-body {
    font-size: 0.95rem;
    color: #334155;
    word-break: break-word;
}


/* Pagination styles */
.comment-pagination {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

#load-more-comments-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

#load-more-comments-btn:hover {
    background-color: var(--bg-light);
    border-color: #cbd5e1;
}

/* Notices states */
.empty-comments-notice {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Responsiveness settings */
@media (max-width: 600px) {
    .comment-card {
        gap: 0.75rem;
    }
    
    .comment-avatar {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .comment-section-header h3 {
        font-size: 1.25rem;
    }
}