/* Modern Comments Public Styles */

.modern-comments-container {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Comment Form */
.mc-comment-form {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mc-comment-form h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
}

.mc-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.mc-form-group {
    flex: 1;
}

.mc-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #4a5568;
    font-size: 14px;
}

.mc-form-group input,
.mc-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #fff;
}

.mc-form-group input:focus,
.mc-form-group textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.mc-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Image Upload */
.mc-image-upload {
    margin: 16px 0;
}

.mc-upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f7fafc;
}

.mc-upload-area:hover {
    border-color: #4299e1;
    background: #ebf8ff;
}

.mc-upload-area.dragover {
    border-color: #4299e1;
    background: #ebf8ff;
}

.mc-upload-icon {
    font-size: 24px;
    color: #a0aec0;
    margin-bottom: 8px;
}

.mc-upload-text {
    color: #718096;
    font-size: 14px;
}

.mc-image-preview {
    margin-top: 16px;
    position: relative;
    display: inline-block;
}

.mc-image-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.mc-remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form Actions */
.mc-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.mc-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

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

.mc-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.mc-form-info {
    font-size: 12px;
    color: #718096;
}

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

.mc-comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.mc-comments-count {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
}

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

.mc-sort-select {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

/* Comment Item */
.mc-comment {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.mc-comment:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.mc-comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid #e2e8f0;
}

.mc-comment-meta {
    flex: 1;
}

.mc-comment-author {
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 2px;
}

.mc-comment-date {
    font-size: 12px;
    color: #718096;
}

.mc-comment-content {
    margin: 12px 0;
    line-height: 1.6;
    color: #2d3748;
}

.mc-comment-image {
    margin: 12px 0;
}

.mc-comment-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Comment Actions */
.mc-comment-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.mc-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #718096;
}

.mc-action-btn:hover {
    background: #f7fafc;
    color: #4a5568;
}

.mc-action-btn.active {
    background: #ebf8ff;
    color: #3182ce;
}

.mc-like-btn.liked {
    color: #38a169;
    background: #f0fff4;
}

.mc-dislike-btn.disliked {
    color: #e53e3e;
    background: #fed7d7;
}

/* Reactions - Facebook Style */
.mc-reactions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    position: relative;
}

.mc-reaction-trigger {
    position: relative;
    display: inline-block;
}

.mc-reaction-picker {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    display: none;
    background: #fff;
    border-radius: 25px;
    padding: 8px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid #e1e5e9;
    z-index: 1000;
    white-space: nowrap;
    animation: reactionPopup 0.2s ease-out;
}

.mc-reaction-picker::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
}

.mc-reaction-picker.show {
    display: flex;
    gap: 4px;
}

.mc-reaction-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.15s ease;
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-reaction-btn:hover {
    transform: scale(1.3);
    background: rgba(0, 0, 0, 0.05);
}

.mc-reaction-btn.active {
    background: #e3f2fd;
    transform: scale(1.1);
}

/* Reaction tooltip */
.mc-reaction-btn::after {
    content: attr(data-name);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1001;
}

.mc-reaction-btn:hover::after {
    opacity: 1;
}

.mc-reaction-counts {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mc-reaction-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #65676b;
    background: #f0f2f5;
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mc-reaction-count:hover {
    background: #e4e6ea;
}

.mc-reaction-count.user-reacted {
    background: #e3f2fd;
    color: #1877f2;
}

.mc-reaction-emoji {
    font-size: 16px;
}

.mc-reaction-number {
    font-weight: 500;
    min-width: 12px;
}

/* Like button with reaction trigger */
.mc-like-btn-wrapper {
    position: relative;
    display: inline-block;
}

.mc-like-btn.has-reactions {
    position: relative;
}

.mc-like-btn.has-reactions:hover + .mc-reaction-picker,
.mc-reaction-picker:hover {
    display: flex;
}

/* Animation for reaction popup */
@keyframes reactionPopup {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-8px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(-8px) scale(1);
    }
}

/* Reaction summary bar */
.mc-reaction-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 0;
    border-top: 1px solid #f0f2f5;
}

.mc-reaction-summary-icons {
    display: flex;
    align-items: center;
    gap: -2px;
}

.mc-reaction-summary-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-left: -2px;
    position: relative;
    z-index: 1;
}

.mc-reaction-summary-icon:first-child {
    margin-left: 0;
}

.mc-reaction-summary-text {
    font-size: 13px;
    color: #65676b;
    cursor: pointer;
}

.mc-reaction-summary-text:hover {
    text-decoration: underline;
}

/* Replies */
.mc-replies {
    margin-left: 40px;
    margin-top: 16px;
    border-left: 2px solid #e2e8f0;
    padding-left: 20px;
}

/* Reply Form */
.mc-reply-form {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    animation: slideDown 0.3s ease-out;
}

.mc-reply-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.mc-reply-header strong {
    color: #1a202c;
    font-size: 14px;
}

.mc-reply-user-fields {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.mc-reply-user-fields input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.mc-reply-user-fields input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.1);
}

.mc-reply-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s ease;
}

.mc-reply-textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.1);
}

.mc-reply-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.mc-reply-submit {
    background: #4299e1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mc-reply-submit:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.mc-reply-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.mc-reply-cancel {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mc-reply-cancel:hover {
    background: #cbd5e0;
}

/* Loading States */
.mc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #718096;
}

.mc-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notifications */
.mc-notification {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.mc-notification.success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #276749;
}

.mc-notification.error {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    color: #c53030;
}

.mc-notification.info {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    color: #2c5282;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mc-form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .mc-comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mc-comment-avatar {
        width: 40px;
        height: 40px;
        margin-bottom: 8px;
    }
    
    .mc-replies {
        margin-left: 20px;
        padding-left: 12px;
    }
    
    .mc-comment-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .mc-reactions {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .modern-comments-container {
        margin: 10px 0;
    }
    
    .mc-comment-form,
    .mc-comment {
        padding: 16px;
        border-radius: 8px;
    }
    
    .mc-replies {
        margin-left: 0;
        border-left: none;
        border-top: 1px solid #e2e8f0;
        padding-left: 0;
        padding-top: 16px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .modern-comments-container {
        color: #e2e8f0;
    }
    
    .mc-comment-form,
    .mc-comment {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .mc-form-group input,
    .mc-form-group textarea {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .mc-upload-area {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .mc-action-btn {
        color: #a0aec0;
    }
    
    .mc-action-btn:hover {
        background: #4a5568;
        color: #e2e8f0;
    }
}

/* Animation Classes */
.mc-fade-in {
    animation: fadeIn 0.3s ease-in;
}

.mc-slide-down {
    animation: slideDown 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

