/* ============================================
   BusOva Comments System Styles
   ============================================ */

.comments-section {
    margin-top: 40px;
    padding: 30px;
    background: var(--bg-card, #fff);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: var(--text-main, #212529);
}

/* Dark theme specific shadow */
body.theme-dark .comments-section {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 10px 30px rgba(0, 0, 0, 0.6);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-subtle, #e9ecef);
}

.comments-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main, #2c3e50);
    margin: 0;
}

.comments-count {
    color: var(--text-muted, #6c757d);
    font-size: 14px;
}

.comments-sort {
    display: flex;
    gap: 10px;
    align-items: center;
}

.comments-sort label {
    font-size: 14px;
    color: var(--text-muted, #6c757d);
    font-weight: 500;
}

.comments-sort select {
    padding: 6px 12px;
    border: 1px solid var(--border-subtle, #ced4da);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-card, #fff);
    color: var(--text-main, #212529);
    cursor: pointer;
    transition: border-color 0.2s;
}

.comments-sort select:hover {
    border-color: var(--accent, #0d6efd);
}

.comments-sort select:focus {
    outline: none;
    border-color: var(--accent, #0d6efd);
    box-shadow: 0 0 0 0.2rem var(--accent-soft, rgba(13, 110, 253, .25));
}

/* Comment Form */
.comment-form {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-card-soft, #f8f9fa);
    border-radius: 6px;
    border: 1px solid var(--border-subtle, #dee2e6);
}

.comment-form-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main, #495057);
    margin-bottom: 15px;
}

.comment-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--border-subtle, #ced4da);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg-card, #fff);
    color: var(--text-main, #212529);
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--accent, #0d6efd);
    box-shadow: 0 0 0 0.2rem var(--accent-soft, rgba(13, 110, 253, .25));
}

.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.character-count {
    font-size: 12px;
    color: var(--text-muted, #6c757d);
}

.character-count.warning {
    color: #ffc107;
}

.character-count.danger {
    color: #dc3545;
}

.comment-form-actions {
    display: flex;
    gap: 10px;
}

.btn-comment {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-comment-submit {
    background: var(--accent, #0d6efd);
    color: #fff;
}

.btn-comment-submit:hover {
    background: var(--accent-hover, #0b5ed7);
}

.btn-comment-submit:disabled {
    background: var(--text-muted, #6c757d);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-comment-cancel {
    background: var(--text-muted, #6c757d);
    color: #fff;
}

.btn-comment-cancel:hover {
    background: #5a6268;
}

/* Comments List */
.comments-list {
    margin-top: 20px;
}

.comment-item {
    padding: 20px;
    margin-bottom: 15px;
    background: var(--bg-card-soft, #fff);
    border: 1px solid var(--border-subtle, #e9ecef);
    border-radius: 6px;
    transition: box-shadow 0.2s;
}

.comment-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body.theme-dark .comment-item:hover {
    box-shadow: 0 2px 8px rgba(14, 155, 255, 0.2);
}

.comment-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
}

.comment-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
    border: 2px solid var(--border-subtle, #e9ecef);
}

.comment-avatar-default {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-right: 15px;
    background: var(--accent, #6c757d);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid var(--border-subtle, #e9ecef);
}

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

.comment-avatar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.comment-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.comment-username {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main, #2c3e50);
    text-decoration: none;
    transition: color 0.2s;
}

.comment-username:hover {
    color: var(--accent, #0d6efd);
}

.user-badge {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-admin {
    background: var(--accent, #0d6efd);
    color: #fff;
}

.badge-moderator {
    background: #ff9800;
    color: #000;
}

.badge-contributor {
    background: var(--accent, #0d6efd);
    color: #fff;
}

.comment-time {
    font-size: 13px;
    color: var(--text-muted, #6c757d);
    margin-top: 4px;
}

.comment-edited {
    font-size: 12px;
    color: var(--text-muted, #868e96);
    font-style: italic;
}

.comment-content {
    margin-top: 8px;
    margin-bottom: 12px;
}

.comment-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main, #495057);
    word-wrap: break-word;
    white-space: pre-wrap;
}

.comment-actions {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.comment-action-btn {
    background: none;
    border: none;
    color: var(--text-muted, #6c757d);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.comment-action-btn:hover {
    color: var(--accent, #0d6efd);
}

.comment-action-btn.delete:hover {
    color: #dc3545;
}

.comment-action-btn.report:hover {
    color: #ffc107;
}

.comment-action-btn i {
    font-size: 12px;
}

/* View Profile Button */
.btn-view-profile {
    padding: 3px 10px;
    background: var(--accent, #0d6efd);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.btn-view-profile:hover {
    background: var(--accent-hover, #0b5ed7);
    color: #fff;
    text-decoration: none;
}

/* Empty State */
.comments-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted, #6c757d);
}

.comments-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.comments-empty p {
    font-size: 16px;
    margin: 0;
}

/* Login Prompt */
.comment-login-prompt {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-card-soft, #f8f9fa);
    border-radius: 6px;
    border: 1px solid var(--border-subtle, #dee2e6);
}

.comment-login-prompt p {
    margin-bottom: 15px;
    color: var(--text-main, #495057);
}

.comment-login-prompt a {
    color: var(--accent, #0d6efd);
    text-decoration: none;
    font-weight: 500;
}

.comment-login-prompt a:hover {
    text-decoration: underline;
    color: var(--accent-hover, #0b5ed7);
}

/* Load More Button */
.load-more-comments {
    text-align: center;
    margin-top: 20px;
}

.btn-load-more {
    padding: 10px 30px;
    background: var(--bg-card, #fff);
    border: 2px solid var(--accent, #0d6efd);
    color: var(--accent, #0d6efd);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-load-more:hover {
    background: var(--accent, #0d6efd);
    color: #fff;
}

/* Toast Notifications */
.comment-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card, #fff);
    border-left: 4px solid #28a745;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
    min-width: 300px;
    color: var(--text-main, #212529);
}

body.theme-dark .comment-toast {
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.comment-toast.error {
    border-left-color: #dc3545;
}

.comment-toast.warning {
    border-left-color: #ffc107;
}

.comment-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comment-toast i {
    font-size: 20px;
}

.comment-toast.success i {
    color: #28a745;
}

.comment-toast.error i {
    color: #dc3545;
}

.comment-toast.warning i {
    color: #ffc107;
}

.comment-toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-main, #495057);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading indicator */
.loading-comments {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted, #6c757d);
}

.loading-comments i {
    font-size: 24px;
    margin-right: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .comments-section {
        padding: 20px 15px;
    }
    
    .comments-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .comment-item {
        padding: 15px;
    }
    
    .comment-avatar,
    .comment-avatar-default {
        width: 48px;
        height: 48px;
        margin-right: 12px;
    }
    
    .comment-avatar-default {
        font-size: 20px;
    }
    
    .comment-toast {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}
