/* ==========================================================================
   EDITOR STYLES - Article Writing Interface
   ========================================================================== */

.editor-container {
    min-height: 100vh;
    background: linear-gradient(to bottom right, #f8fafc 0%, #e0e7ff 50%, #fce7f3 100%);
    background-attachment: fixed;
}

.editor-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.editor-header h1 {
    font-size: 1.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.editor-content {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Article Meta Form */
.article-meta {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.article-meta:hover {
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #334155;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
    background: white;
}

.image-upload-group {
    display: flex;
    gap: 0.75rem;
}

.image-upload-group input[type="text"] {
    flex: 1;
}

.image-preview {
    margin-top: 1.5rem;
    display: none;
    animation: fadeIn 0.4s ease;
}

.image-preview.show {
    display: block;
}

.image-preview img {
    max-width: 100%;
    max-height: 350px;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.image-preview img:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Quill Editor Wrapper */
.editor-wrapper {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.editor-wrapper:hover {
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.15);
}

#toolbar {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
    padding: 1rem;
}

#editor {
    min-height: 500px;
    font-size: 1rem;
    line-height: 1.8;
}

/* Quill Editor Customizations */
.ql-container {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.125rem;
}

.ql-editor {
    padding: 2.5rem;
    min-height: 500px;
    background: rgba(255, 255, 255, 0.5);
}

.ql-editor h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 1.5rem 0 1rem;
    line-height: 1.2;
}

.ql-editor h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 1.25rem 0 0.875rem;
    line-height: 1.3;
}

.ql-editor h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1rem 0 0.75rem;
}

.ql-editor p {
    margin-bottom: 1rem;
}

.ql-editor blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #64748b;
}

.ql-editor code {
    background-color: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875em;
}

.ql-editor pre {
    background-color: #1e293b;
    color: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.ql-editor pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.ql-editor ul,
.ql-editor ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.ql-editor li {
    margin-bottom: 0.5rem;
}

/* Toolbar Styling */
.ql-snow .ql-picker {
    font-size: 0.875rem;
}

.ql-snow .ql-stroke {
    stroke: #475569;
}

.ql-snow .ql-fill {
    fill: #475569;
}

.ql-snow .ql-picker-label:hover,
.ql-snow .ql-picker-label.ql-active,
.ql-snow button:hover,
.ql-snow button.ql-active {
    color: #667eea;
}

.ql-snow button:hover .ql-stroke,
.ql-snow button.ql-active .ql-stroke {
    stroke: #667eea;
}

.ql-snow button:hover .ql-fill,
.ql-snow button.ql-active .ql-fill {
    fill: #667eea;
}

.ql-toolbar.ql-snow {
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ql-toolbar.ql-snow .ql-formats {
    margin-right: 1rem;
}

.ql-toolbar.ql-snow button {
    transition: all 0.2s ease;
}

.ql-toolbar.ql-snow button:hover {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 0.375rem;
    transform: scale(1.1);
}

.ql-container.ql-snow {
    border: none;
}

/* Editor Footer */
.editor-footer {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    padding: 2rem 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    margin-top: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.stats {
    display: flex;
    gap: 2.5rem;
    font-size: 0.875rem;
    color: #64748b;
    flex-wrap: wrap;
}

.stats span {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 2rem;
    transition: all 0.3s ease;
}

.stats span:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .editor-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .header-actions .btn {
        flex: 1;
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .image-upload-group {
        flex-direction: column;
    }
    
    .ql-editor {
        padding: 1rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #toolbar {
        padding: 0.5rem;
    }
    
    .ql-toolbar.ql-snow .ql-formats {
        margin-right: 8px;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Messages */
.message {
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInDown 0.4s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.message.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 2px solid #6ee7b7;
}

.message.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 2px solid #fca5a5;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
