/* ==========================================================================
   blog.css - Premium Styling for Intelligent OD Blog and Article Editor
   ========================================================================== */

/* --- ADMIN & FLOATING CONTROLS --- */
.admin-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.admin-btn {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.admin-btn.edit {
    color: var(--primary-accent);
}

.admin-btn.edit:hover {
    background: rgba(11, 25, 44, 0.05);
    border-color: var(--primary-accent);
}

.admin-btn.delete {
    color: #e53e3e;
}

.admin-btn.delete:hover {
    background: rgba(229, 62, 62, 0.05);
    border-color: #e53e3e;
}

.write-article-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2rem;
    max-width: 1400px;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.write-article-btn {
    background-color: var(--primary-accent);
    color: white;
    font-family: var(--heading-font);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(11, 25, 44, 0.15);
    transition: all var(--transition-fast);
}

.write-article-btn:hover {
    background-color: var(--primary-accent-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 198, 84, 0.25);
}

/* --- DYNAMIC POST VIEW PAGE --- */
.article-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem var(--spacing-xl);
}

.article-header {
    margin-bottom: 2.5rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.article-meta .category {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-meta .date {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.article-title {
    font-size: 2.75rem;
    font-family: var(--heading-font);
    font-weight: 800;
    color: var(--text-secondary);
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.article-author-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.2rem;
    background-image: linear-gradient(135deg, var(--primary-accent), var(--accent-cyan));
}

.author-info h4 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.author-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.article-cover {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-subtle);
}

/* Article Body Content */
.article-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #2d3748;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2 {
    font-size: 1.8rem;
    margin: 2.5rem 0 1rem;
    color: var(--text-secondary);
}

.article-content h3 {
    font-size: 1.4rem;
    margin: 2rem 0 1rem;
    color: var(--text-secondary);
}

.article-content blockquote {
    border-left: 4px solid var(--primary-accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.25rem;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-content ul {
    list-style-type: disc;
}

.article-content ol {
    list-style-type: decimal;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content img, .article-content video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    display: block;
    box-shadow: var(--shadow-subtle);
}

/* Floating Share Bar */
.share-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 3rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0a66c2; /* LinkedIn color */
    color: white;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.share-btn:hover {
    background: #004182;
    color: white;
    transform: translateY(-1px);
}

/* LinkedIn Discussion Callout */
.linkedin-discussion-cta {
    background-color: #f3f6f8;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--border-color);
}

.linkedin-discussion-cta p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.linkedin-discussion-cta .cta-btn {
    background: transparent;
    color: #0a66c2;
    border: 2px solid #0a66c2;
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.linkedin-discussion-cta .cta-btn:hover {
    background: rgba(10, 102, 194, 0.04);
    border-color: #004182;
    color: #004182;
}

/* --- LINKEDIN STYLE EDITOR --- */
.editor-layout {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.editor-header-bar {
    position: sticky;
    top: 0;
    background: white;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.editor-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-logo span {
    font-family: var(--heading-font);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.editor-status {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: opacity var(--transition-fast);
}

.editor-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-btn {
    font-family: var(--heading-font);
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.editor-btn.cancel {
    background: transparent;
    color: var(--text-muted);
}

.editor-btn.cancel:hover {
    background: rgba(0,0,0,0.03);
    color: var(--text-secondary);
}

.editor-btn.publish {
    background-color: var(--primary-accent);
    color: white;
}

.editor-btn.publish:hover {
    background-color: var(--primary-accent-hover);
    box-shadow: 0 4px 12px rgba(67, 198, 84, 0.2);
}

.editor-btn.publish:disabled {
    background-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.editor-workspace {
    padding: 2.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Cover Image Dropzone */
.cover-dropzone {
    width: 100%;
    height: 220px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background-color: #f9fbfd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.cover-dropzone:hover {
    border-color: var(--primary-accent);
    background-color: #f1f5f9;
}

.cover-dropzone.has-preview {
    border: none;
    background-color: transparent;
}

.cover-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.cover-dropzone-content {
    text-align: center;
    color: var(--text-muted);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cover-dropzone-content svg {
    color: var(--primary-accent);
}

.remove-cover-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background var(--transition-fast);
}

.remove-cover-btn:hover {
    background: rgba(229, 62, 62, 0.9);
}

/* Metadata Panel */
.meta-panel {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.meta-field {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-field label {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.meta-field select, .meta-field input, .meta-field textarea {
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: var(--font-family);
    outline: none;
    transition: border-color var(--transition-fast);
}

.meta-field select:focus, .meta-field input:focus, .meta-field textarea:focus {
    border-color: var(--primary-accent);
}

/* Title Input */
.editor-title-container {
    margin-bottom: 1.5rem;
}

.editor-title-input {
    width: 100%;
    border: none;
    outline: none;
    font-family: var(--heading-font);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-secondary);
    line-height: 1.2;
    resize: none;
    height: auto;
}

.editor-title-input::placeholder {
    color: #cbd5e1;
}

/* Formatting Toolbar */
.editor-toolbar {
    position: sticky;
    top: 73px; /* aligns below header */
    background: white;
    z-index: 90;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.toolbar-btn {
    background: transparent;
    border: none;
    border-radius: 4px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: bold;
    font-size: 0.95rem;
    transition: background var(--transition-fast);
}

.toolbar-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.toolbar-btn.active {
    background: rgba(11, 25, 44, 0.08);
    color: var(--primary-accent);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background-color: var(--border-color);
    align-self: center;
    margin: 0 4px;
}

/* Content Editable Area */
.editor-body-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.editor-body {
    flex-grow: 1;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #2d3748;
    outline: none;
    min-height: 350px;
}

.editor-body[contenteditable="true"]:empty:before {
    content: attr(placeholder);
    color: #cbd5e1;
    cursor: text;
}

/* Editor embedded assets styling */
.editor-body img, .editor-body video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    display: block;
    border: 2px dashed transparent;
    transition: border-color var(--transition-fast);
}

.editor-body img:hover, .editor-body video:hover {
    border-color: var(--accent-cyan);
}

.editor-body h2 {
    font-size: 1.8rem;
    margin: 2.2rem 0 1rem;
    color: var(--text-secondary);
}

.editor-body h3 {
    font-size: 1.4rem;
    margin: 1.8rem 0 1rem;
    color: var(--text-secondary);
}

.editor-body blockquote {
    border-left: 4px solid var(--primary-accent);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.25rem;
}

.editor-body ul, .editor-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.editor-body ul {
    list-style-type: disc;
}

.editor-body ol {
    list-style-type: decimal;
}

.editor-body li {
    margin-bottom: 0.5rem;
}

/* --- SECURITY BAR / ERROR PAGE --- */
.security-alert-box {
    text-align: center;
    padding: 3rem;
    max-width: 500px;
    margin: 10vh auto;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.security-alert-box h2 {
    color: #e53e3e;
    font-family: var(--heading-font);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.security-alert-box p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Spinner */
.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .article-title {
        font-size: 2.1rem;
    }
    
    .editor-workspace {
        padding: 1.5rem;
    }
    
    .editor-title-input {
        font-size: 2rem;
    }
    
    .cover-dropzone {
        height: 150px;
    }
}
