/* Editor Styles */
.editor-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.editor-header h1 {
    color: black;
    margin: 0;
}

.editor-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.editor-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 5px;
}

.editor-toolbar button {
    background: none;
    border: 1px solid transparent;
    padding: 8px 10px;
    border-radius: 3px;
    cursor: pointer;
    color: #555;
    transition: all 0.3s ease;
}

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

.editor-toolbar button.active {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

/* Content Editable */
.editor-content {
    border: 1px solid #ddd;
    border-radius: 0 0 5px 5px;
    min-height: 400px;
    background: white;
}

.content-editable {
    min-height: 400px;
    padding: 20px;
    line-height: 1.6;
    font-size: 16px;
    outline: none;
}

.content-editable:focus {
    border-color: #4a90e2;
}

.content-editable h1,
.content-editable h2,
.content-editable h3 {
    color: #4a90e2;
    margin: 20px 0 10px 0;
}

.content-editable h1 { font-size: 24px; }
.content-editable h2 { font-size: 20px; }
.content-editable h3 { font-size: 18px; }

.content-editable blockquote {
    border-left: 4px solid #4a90e2;
    margin: 15px 0;
    padding: 10px 20px;
    background: #f8f9fa;
    font-style: italic;
    color: #555;
}

.content-editable pre {
    background: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 15px;
    margin: 15px 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.content-editable code {
    background: #f4f4f4;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.content-editable ul,
.content-editable ol {
    margin: 15px 0;
    padding-left: 30px;
}

.content-editable li {
    margin: 5px 0;
}

.content-editable a {
    color: #007bff;
    text-decoration: underline;
}

.content-editable a:hover {
    color: #0056b3;
}

/* Image Preview */
.image-preview {
    margin-top: 10px;
}

.image-preview img {
    max-width: 300px;
    max-height: 200px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* Auto Tags */
.auto-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.tag-suggestion {
    background: #e9ecef;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.tag-suggestion:hover {
    background: #4a90e2;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-content.large {
    max-width: 800px;
}

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

.modal-header h3 {
    margin: 0;
    color: #4a90e2;
}

.close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

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

/* Editor Buttons */
.editor-actions .btn-primary {
    background: black;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.editor-actions .btn-primary:hover {
    background: #357ab8;
}

.editor-actions .btn-secondary {
    background: black;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

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

/* Preview Styles */
#previewContent {
    line-height: 1.6;
}

#previewContent h1 {
    color: #4a90e2;
    margin-bottom: 15px;
    font-size: 28px;
}

#previewContent h2 {
    color: #4a90e2;
    margin: 25px 0 15px 0;
    font-size: 22px;
}

#previewContent h3 {
    color: #4a90e2;
    margin: 20px 0 10px 0;
    font-size: 18px;
}

#previewContent blockquote {
    border-left: 4px solid #4a90e2;
    margin: 20px 0;
    padding: 15px 20px;
    background: #f8f9fa;
    font-style: italic;
    color: #555;
}

#previewContent pre {
    background: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
}

#previewContent ul,
#previewContent ol {
    margin: 15px 0;
    padding-left: 30px;
}

#previewContent li {
    margin: 8px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .editor-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .editor-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .editor-toolbar {
        gap: 2px;
    }
    
    .editor-toolbar button {
        padding: 6px 8px;
    }
    
    .content-editable {
        padding: 15px;
        font-size: 16px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}
