/**
 * Content Edit Styles
 * Styles for content editing functionality
 */

/* Edit buttons */
.edit-post-btn,
.edit-comment-btn,
.edit-contest-btn {
    background: transparent;
    border: 1px solid #d29fee;
    color: #3d1540;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.edit-post-btn:hover,
.edit-comment-btn:hover,
.edit-contest-btn:hover {
    background: #d29fee;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(210, 159, 238, 0.3);
}

/* Edit indicators */
.edited-indicator {
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
    margin-left: 4px;
}

.edit-info-badge {
    background: #f8f1f9;
    border-left: 3px solid #d29fee;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Comment inline editor */
.comment-edit-wrapper {
    background: linear-gradient(135deg, #f8f1f9 0%, #f3e8f5 100%);
    padding: 16px;
    border-radius: 12px;
    margin-top: 12px;
    border: 2px solid #d29fee;
    box-shadow: 0 4px 12px rgba(210, 159, 238, 0.15);
    transition: all 0.3s ease;
}

.comment-edit-wrapper:hover {
    box-shadow: 0 6px 20px rgba(210, 159, 238, 0.25);
}

.comment-edit-textarea {
    min-height: 100px;
    resize: vertical;
    border: 1px solid #d29fee;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.comment-edit-textarea:focus {
    border-color: #c77dff;
    box-shadow: 0 0 0 0.2rem rgba(210, 159, 238, 0.25);
}

.comment-form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-edit-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.comment-edit-buttons .btn {
    padding: 8px 16px;
    font-size: 0.875rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 100px;
}

.comment-edit-buttons .btn-primary {
    background: linear-gradient(135deg, #d29fee 0%, #c77dff 100%);
    border: none;
    color: white;
}

.comment-edit-buttons .btn-primary:hover {
    background: linear-gradient(135deg, #c77dff 0%, #b366ff 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(210, 159, 238, 0.4);
}

.comment-edit-buttons .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.comment-edit-buttons .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    transform: translateY(-1px);
}

.anonymous-comment-option {
    margin-bottom: 0;
    padding: 8px 12px;
    background: rgba(210, 159, 238, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(210, 159, 238, 0.3);
}

.anonymous-comment-option .form-check-input {
    margin-top: 0.2em;
}

.anonymous-comment-option .form-check-label {
    font-size: 0.9rem;
    color: #3d1540;
    cursor: pointer;
}

.anonymous-comment-option .help-icon {
    color: #d29fee;
    cursor: help;
}

/* Edit modals */
#postEditModal .modal-header,
#contestEditModal .modal-header {
    background: linear-gradient(135deg, #d29fee 0%, #c77dff 100%);
    color: white;
    border-bottom: none;
}

#postEditModal .modal-title,
#contestEditModal .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

#postEditModal .btn-close,
#contestEditModal .btn-close {
    color: white;
    opacity: 0.8;
}

#postEditModal .btn-close:hover,
#contestEditModal .btn-close:hover {
    opacity: 1;
}

/* Time limit warning */
.edit-time-warning {
    display: inline-block;
    background: #ffc107;
    color: #000;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.edit-time-warning.expiring {
    background: #dc3545;
    color: white;
    animation: pulse 1s infinite;
}

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

/* Edit count badge */
.edit-count-badge {
    background: #3d1540;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 8px;
    display: inline-block;
}

/* Toast notifications */
.toast-container {
    z-index: 9999;
}

/* Summernote adjustments for edit mode */
.comment-edit-wrapper .note-editor {
    border: 1px solid #d29fee;
}

.comment-edit-wrapper .note-editor.note-frame {
    margin-bottom: 0;
}

.comment-edit-wrapper .note-toolbar {
    background: #f8f1f9;
    border-bottom: 1px solid #d29fee;
}

/* Edit button visibility based on time */
.edit-expired {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .edit-post-btn,
    .edit-comment-btn,
    .edit-contest-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .comment-edit-actions {
        flex-direction: column;
    }

    .comment-edit-actions .btn {
        width: 100%;
    }
}

/* Loading states */
.edit-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.edit-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #d29fee;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Edit history tooltip */
.edit-history-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.edit-history-tooltip:hover::after {
    content: attr(data-history);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #3d1540;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 4px;
}

.edit-history-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #3d1540;
    margin-bottom: -4px;
}
