/* Comments Component Styles */

/* Global Comments Floating Action Button */
.global-comments-fab {
    position: fixed;
    bottom: 15px;
    left: 100px;
    z-index: 1050;
}

.global-comments-fab button:hover {
    transform: scale(1.1);
}

.global-comments-fab button:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Comments Container */
.comments-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    height: 500px;
}

.comments-list {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 1rem;
    min-height: 300px;
    padding-right: 0.5rem;
}

.comments-list::-webkit-scrollbar {
    width: 6px;
}

.comments-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Comment Item */
.comment-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

.comment-item:hover {
    background-color: #e9ecef;
}

.comment-item.own-comment {
    background-color: #e3f2fd;
    margin-left: auto;
    margin-right: 0;
    max-width: 80%;
}

.comment-item.own-comment:hover {
    background-color: #bbdefb;
}

.comment-item:focus-within {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Comment Header */
.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.comment-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #666;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.comment-username {
    font-weight: 500;
    color: #333;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Comment Actions */
.comment-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-shrink: 0;
}

.comment-actions button {
    border: none;
    background: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: #666;
    font-size: 0.875rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.comment-actions button:hover {
    color: #000;
    background-color: rgba(0, 0, 0, 0.05);
}

.comment-actions button:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.comment-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-actions .btn-like.active {
    color: #0d6efd;
}

.comment-actions .btn-dislike.active {
    color: #dc3545;
}

.comment-actions .btn-report:hover {
    color: #dc3545;
}

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

/* Comment Text */
.comment-text {
    margin: 0;
    word-wrap: break-word;
    word-break: break-word;
    color: #333;
    line-height: 1.5;
    white-space: pre-wrap;
}

.comment-time {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
}

/* Comment Input */
.comment-input {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
    flex-shrink: 0;
}

.comment-input .input-group {
    margin-bottom: 0.5rem;
}

.comment-input input:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    border-color: #0d6efd;
}

.comment-input button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading State */
.comments-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
    min-height: 200px;
}

.comments-loading .spinner-border {
    margin-bottom: 1rem;
}

.comments-loading-text {
    font-size: 0.875rem;
}

/* Error State */
.comments-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #dc3545;
    min-height: 200px;
    text-align: center;
}

.comments-error-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.comments-error-message {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.comments-error-retry {
    margin-top: 0.5rem;
}

/* Empty State */
.comments-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
    min-height: 200px;
    text-align: center;
}

.comments-empty-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.comments-empty-message {
    font-size: 0.875rem;
}

/* Rating Display */
.comment-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #ffc107;
}

.comment-rating .star {
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 576px) {
    .comment-item.own-comment {
        max-width: 90%;
    }
    
    .global-comments-fab {
        bottom: 15px;
        right: 15px;
    }
    
    .global-comments-fab button {
        width: 48px;
        height: 48px;
    }
    
    .comments-container {
        height: 400px;
    }
}

/* Accessibility - Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-item {
    animation: fadeIn 0.3s ease;
}
