/* Blog Editor Styles - Sistema Centralizado */

/* ===== Article Body Content Styles (Interlineado y formato de párrafo) ===== */
#articleBodyContent {
    font-size: 17px;
    line-height: 1.8;
    color: #1f2937;
}

#articleBodyContent p {
    margin: 0 0 1.15em 0;
    line-height: 1.8;
}

/* Inline content image styling */
#articleBodyContent .content-image {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Figure and figcaption for inline images with captions */
#articleBodyContent figure {
    margin: 20px auto;
    padding: 0;
}

#articleBodyContent figcaption {
    font-style: italic;
    color: #6b7280;
    font-size: 14px;
    margin-top: 8px;
    text-align: center;
    line-height: 1.5;
}

/* Image wrapper divs inserted by the editor */
#articleBodyContent>div[style*="text-align: center"] {
    margin: 25px auto;
}

/* Image description paragraphs (italic text after images) */
#articleBodyContent>div[style*="text-align: center"]>p {
    font-style: italic;
    color: #666;
    font-size: 0.9em;
    margin-top: 10px;
    margin-bottom: 0;
}

/* Edit Buttons Standardized Styles */
.article-content-edit-btn-page,
.article-image-edit-btn-page,
.article-body-edit-btn-page,
#editBodyBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 8px 14px !important;
    border-radius: 18px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.3s ease !important;
    z-index: 1001 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    margin: 5px 0 !important;
}

.article-content-edit-btn-page:hover,
.article-image-edit-btn-page:hover,
.article-body-edit-btn-page:hover,
#editBodyBtn:hover {
    transform: translateX(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%) !important;
}

/* Editor Container */
.editor-container {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 400px;
    max-height: 70vh;
    overflow-y: auto;
    position: sticky;
    top: 20px;
}

/* Layout de dos columnas cuando el editor está activo */
.article-content-wrapper.editor-active {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: flex-start;
}

.article-content-wrapper.editor-active .article-content {
    flex: 1;
    min-width: 0;
}

.article-content-wrapper.editor-active .editor-container {
    flex: 0 0 400px;
    margin: 0;
}

.editor-content {
    min-height: 300px;
    padding: 15px;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
}

/* Toolbar Styles */
.editor-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px 8px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.toolbar-group {
    display: flex;
    gap: 2px;
    margin-right: 10px;
    padding-right: 10px;
    border-right: 1px solid #ddd;
}

.toolbar-group:last-child {
    border-right: none;
    margin-right: 0;
}

.toolbar-btn {
    background: white;
    border: 1px solid #ccc;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 36px;
    justify-content: center;
}

.toolbar-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.toolbar-btn.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Format Select */
.format-select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

/* Editor Content Area */
.editor-content {
    min-height: 300px;
    padding: 20px;
    border: none;
    outline: none;
    font-family: 'Georgia', serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    resize: vertical;
}

.editor-content:focus {
    outline: none;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Form Elements in Modals */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #007bff;
    color: white;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.2s;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #007bff;
    background: #e3f2fd;
}

.file-upload-area.dragover {
    border-color: #007bff;
    background: #e3f2fd;
}

.file-upload-icon {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 10px;
}

.file-upload-text {
    color: #6c757d;
    margin-bottom: 10px;
}

.file-upload-input {
    display: none;
}

/* Progress Bar */
.progress {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background: #007bff;
    transition: width 0.3s;
    border-radius: 10px;
}

/* Image Preview */
.image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    margin: 10px 0;
    border: 1px solid #ddd;
}

/* Link Preview */
.link-preview {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

.link-preview-title {
    font-weight: 600;
    color: #007bff;
    margin-bottom: 5px;
}

.link-preview-url {
    color: #6c757d;
    font-size: 12px;
    word-break: break-all;
}

/* Responsive Design */
@media (max-width: 768px) {
    .editor-toolbar {
        padding: 8px;
    }

    .toolbar-btn {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 32px;
    }

    .editor-content {
        padding: 15px;
        font-size: 14px;
    }

    .modal {
        margin: 10px;
        width: calc(100% - 20px);
    }

    .modal-footer {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        margin-bottom: 5px;
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Success/Error Messages */
.message {
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Loading Spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

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

    100% {
        transform: rotate(360deg);
    }
}