/**
 * Comments Modal System CSS
 * Styles for the comments modal, editor, and related components
 */

/* Modal Overlay */
.comments-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.comments-modal-overlay.active {
    display: flex;
}

/* Modal Container */
.comments-modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.comments-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.comments-modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.comments-modal-entity {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 4px;
}

.comments-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.comments-modal-close:hover {
    opacity: 1;
}

/* Modal Body */
.comments-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

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

.comments-list-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.comments-list-empty i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 16px;
}

/* Individual Comment */
.comment-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #007bff;
    transition: box-shadow 0.2s;
}

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

.comment-item.own-comment {
    border-left-color: #28a745;
    background: #f0fff4;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-author i {
    color: #007bff;
}

.comment-timestamp {
    font-size: 0.85rem;
    color: #666;
}

.comment-content {
    color: #444;
    line-height: 1.6;
    word-wrap: break-word;
}

.comment-content p {
    margin: 0 0 8px 0;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-edited {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
    margin-top: 8px;
}

.comment-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
}

.comment-actions button {
    padding: 4px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.comment-edit-btn {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    color: #1976d2;
}

.comment-edit-btn:hover {
    background: #2196f3;
    color: white;
}

.comment-delete-btn {
    background: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
}

.comment-delete-btn:hover {
    background: #f44336;
    color: white;
}

/* Comment Editor */
.comment-editor {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e0e0e0;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px 6px 0 0;
    border-bottom: none;
}

.editor-btn {
    padding: 6px 10px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.editor-btn:hover {
    background: #e0e0e0;
}

.editor-btn:active {
    background: #d0d0d0;
}

.editor-separator {
    width: 1px;
    background: #ddd;
    margin: 0 4px;
}

.editor-textarea {
    min-height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 0 0 6px 6px;
    background: #fff;
    outline: none;
    line-height: 1.6;
}

.editor-textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.editor-textarea:empty:before {
    content: attr(placeholder);
    color: #999;
}

.editor-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.editor-voice-controls {
    display: flex;
    gap: 8px;
}

.voice-btn {
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.voice-btn:hover {
    background: #e0e0e0;
}

.voice-btn.recording {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.editor-submit-controls {
    display: flex;
    gap: 8px;
}

.editor-cancel-btn {
    padding: 10px 20px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.editor-cancel-btn:hover {
    background: #e0e0e0;
}

.editor-save-btn {
    padding: 10px 20px;
    background: #007bff;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.editor-save-btn:hover {
    background: #0056b3;
}

/* Quill Icon */
.quill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    vertical-align: middle;
}

.quill-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.quill-icon.has-comments {
    opacity: 1;
    position: relative;
}

.quill-icon.has-comments::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    border: 2px solid white;
}

/* Comments Button Styles */
.btn-comments {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.btn-comments:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-comments i {
    font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .comments-modal {
        width: 95%;
        max-height: 90vh;
        margin: 20px;
    }
    
    .comments-modal-header {
        padding: 16px;
    }
    
    .comments-modal-body {
        padding: 16px;
    }
    
    .editor-toolbar {
        padding: 6px;
    }
    
    .editor-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .editor-voice-controls,
    .editor-submit-controls {
        width: 100%;
        justify-content: center;
    }
}
