/* Blog Dashboard Styles v20260213a */

.blog-dashboard {
    padding: 24px;
    max-width: 1200px;
}

/* ─── Page Header ─────────────────────────────── */

.blog-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.blog-dashboard-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.blog-dashboard-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #FF6B35;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.blog-btn-primary:hover {
    background: #e55a28;
}

.blog-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    color: #374151;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.blog-btn-secondary:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
}

.blog-btn-sm {
    padding: 4px 10px;
    font-size: 13px;
}

.blog-btn-danger {
    color: #DC2626;
    border-color: #FCA5A5;
}

.blog-btn-danger:hover {
    background: #FEF2F2;
}

/* ─── Share Dropdown ─────────────────────────── */

.blog-share-wrapper {
    position: relative;
}

.blog-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.blog-share-dropdown {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    min-width: 180px;
    z-index: 1000;
    padding: 4px;
}

.blog-share-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    text-decoration: none;
    font-family: inherit;
    transition: background 0.1s;
}

.blog-share-option:hover {
    background: #F3F4F6;
}

/* ─── Tabs ────────────────────────────────────── */

.blog-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 20px;
}

.blog-tab {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s;
}

.blog-tab:hover {
    color: #374151;
}

.blog-tab.active {
    color: #FF6B35;
    border-bottom-color: #FF6B35;
}

.blog-tab .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    background: #F3F4F6;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
}

.blog-tab.active .badge {
    background: #FFF7ED;
    color: #FF6B35;
}

/* ─── Search ──────────────────────────────────── */

.blog-search-bar {
    margin-bottom: 16px;
}

.blog-search-bar input {
    width: 100%;
    max-width: 360px;
    padding: 8px 12px 8px 36px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") 10px center no-repeat;
}

.blog-search-bar input:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* ─── Posts Table ──────────────────────────────── */

.blog-posts-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    overflow: hidden;
}

.blog-posts-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}

.blog-posts-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: middle;
}

.blog-posts-table tr:last-child td {
    border-bottom: none;
}

.blog-posts-table tr:hover td {
    background: #FAFAFA;
}

.blog-post-title-cell {
    font-weight: 500;
    color: #111827;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.blog-post-title-cell a {
    color: inherit;
    text-decoration: none;
}

.blog-post-title-cell a:hover {
    color: #FF6B35;
}

/* ─── Status Badge ────────────────────────────── */

.blog-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.blog-status-badge.draft {
    background: #FEF3C7;
    color: #92400E;
}

.blog-status-badge.published {
    background: #D1FAE5;
    color: #065F46;
}

.blog-status-badge.archived {
    background: #F3F4F6;
    color: #6B7280;
}

/* ─── Post Editor ─────────────────────────────── */

.blog-editor {
    display: none;
}

.blog-editor.active {
    display: block;
}

.blog-editor-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.blog-editor-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-editor-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* AI Prompt Bar */
.blog-ai-prompt {
    background: linear-gradient(135deg, #FFF7ED 0%, #FFFBEB 100%);
    border: 1px solid #FDE68A;
    border-radius: 12px;
    padding: 16px;
}

.blog-ai-prompt-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #92400E;
    margin-bottom: 10px;
}

.blog-ai-prompt-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.blog-ai-prompt-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.blog-ai-prompt-input:focus {
    outline: none;
    border-color: #F59E0B;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.blog-ai-prompt select {
    padding: 8px 12px;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.blog-ai-generate-btn {
    padding: 8px 16px;
    background: #F59E0B;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.blog-ai-generate-btn:hover {
    background: #D97706;
}

.blog-ai-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.blog-ai-loading {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
    color: #92400E;
}

.blog-ai-loading.active {
    display: flex;
}

.blog-ai-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #FDE68A;
    border-top-color: #F59E0B;
    border-radius: 50%;
    animation: blog-spin 0.6s linear infinite;
}

@keyframes blog-spin {
    to { transform: rotate(360deg); }
}

/* Editor Fields */
.blog-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.blog-field label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.blog-field input,
.blog-field textarea,
.blog-field select {
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.blog-field input:focus,
.blog-field textarea:focus,
.blog-field select:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.blog-title-input {
    font-size: 20px;
    font-weight: 600;
    padding: 12px;
}

.blog-slug-display {
    font-size: 12px;
    color: #9CA3AF;
    margin-top: 2px;
}

.blog-slug-display code {
    background: #F3F4F6;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 12px;
}

/* Hero Image */
.blog-hero-upload {
    border: 2px dashed #D1D5DB;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    background: #FAFAFA;
}

.blog-hero-upload:hover {
    border-color: #FF6B35;
    background: #FFF7ED;
}

.blog-hero-upload.has-image {
    border-style: solid;
    padding: 0;
    overflow: hidden;
}

.blog-hero-upload img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.blog-hero-upload-text {
    color: #6B7280;
    font-size: 14px;
}

.blog-hero-upload-text strong {
    color: #FF6B35;
}

/* Body Editor */
.blog-body-editor {
    position: relative;
}

.blog-body-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}

.blog-preview-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
}

.blog-preview-toggle.active {
    background: #FF6B35;
    border-color: #FF6B35;
    color: white;
}

.blog-body-textarea {
    width: 100%;
    min-height: 400px;
    padding: 16px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    tab-size: 2;
}

.blog-body-preview {
    display: none;
    min-height: 400px;
    padding: 24px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    background: white;
    line-height: 1.7;
    font-size: 15px;
    color: #1F2937;
    overflow-y: auto;
}

.blog-body-preview.active {
    display: block;
}

.blog-body-preview h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 24px 0 12px 0;
    color: #111827;
}

.blog-body-preview h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 8px 0;
    color: #1F2937;
}

.blog-body-preview p {
    margin: 0 0 16px 0;
}

.blog-body-preview ul, .blog-body-preview ol {
    margin: 0 0 16px 0;
    padding-left: 24px;
}

.blog-body-preview li {
    margin-bottom: 4px;
}

.blog-body-preview blockquote {
    border-left: 3px solid #FF6B35;
    margin: 16px 0;
    padding: 12px 16px;
    background: #FFF7ED;
    color: #374151;
    border-radius: 0 8px 8px 0;
}

/* ─── Preview: AI-Generated Components ─────── */

.blog-body-preview .blog-intro {
    font-size: 16px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 20px;
}

.blog-body-preview .blog-key-points-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.blog-body-preview .blog-key-point-card {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 14px;
}

.blog-body-preview .blog-key-point-number {
    width: 28px;
    height: 28px;
    background: #FF6B35;
    color: white;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 8px;
}

.blog-body-preview .blog-key-point-card h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.blog-body-preview .blog-key-point-card p {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
    line-height: 1.4;
}

.blog-body-preview .blog-callout {
    background: #FFF7ED;
    border-left: 3px solid #FF6B35;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin: 16px 0;
}

.blog-body-preview .blog-callout-title {
    font-weight: 700;
    color: #FF6B35;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.blog-body-preview .blog-callout p {
    color: #92400E;
    font-size: 14px;
    margin: 0;
}

.blog-body-preview .blog-stats-row {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}

.blog-body-preview .blog-stat-item {
    flex: 1;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.blog-body-preview .blog-stat-item .blog-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #FF6B35;
}

.blog-body-preview .blog-stat-item .blog-stat-label {
    font-size: 11px;
    color: #6B7280;
}

.blog-body-preview .blog-cta-box {
    background: linear-gradient(135deg, #FF6B35 0%, #F59E0B 100%);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: white;
    margin: 20px 0;
}

.blog-body-preview .blog-cta-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: white;
}

.blog-body-preview .blog-cta-box p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
    color: white;
}

/* Sidebar Cards */
.blog-sidebar-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px;
}

.blog-sidebar-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
}

/* SEO Preview */
.blog-seo-preview {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}

.blog-seo-preview-title {
    font-size: 16px;
    color: #1A0DAB;
    font-weight: 400;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.blog-seo-preview-url {
    font-size: 12px;
    color: #006621;
    margin-bottom: 4px;
}

.blog-seo-preview-desc {
    font-size: 13px;
    color: #545454;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tags Input */
.blog-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    min-height: 38px;
    cursor: text;
}

.blog-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #F3F4F6;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
}

.blog-tag-remove {
    cursor: pointer;
    color: #9CA3AF;
    font-size: 14px;
    line-height: 1;
}

.blog-tag-remove:hover {
    color: #DC2626;
}

.blog-tags-input {
    border: none;
    outline: none;
    padding: 2px 4px;
    font-size: 13px;
    min-width: 80px;
    flex: 1;
}

/* ─── Comments View ───────────────────────────── */

.blog-comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blog-comment-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px;
}

.blog-comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.blog-comment-author {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.blog-comment-meta {
    font-size: 12px;
    color: #9CA3AF;
}

.blog-comment-body {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 12px;
}

.blog-comment-post {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 12px;
}

.blog-comment-actions {
    display: flex;
    gap: 8px;
}

/* ─── Empty State ─────────────────────────────── */

.blog-empty {
    text-align: center;
    padding: 60px 24px;
    color: #6B7280;
}

.blog-empty svg {
    margin-bottom: 16px;
    color: #D1D5DB;
}

.blog-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.blog-empty p {
    font-size: 14px;
    margin: 0 0 20px 0;
}

/* ─── Analytics Cards ─────────────────────────── */

.blog-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.blog-analytics-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px;
}

.blog-analytics-card .label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    margin-bottom: 4px;
}

.blog-analytics-card .value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

/* ─── Version Badge ───────────────────────────── */

.blog-version-badge {
    position: fixed;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 9999;
    pointer-events: none;
}

/* ─── Responsive ──────────────────────────────── */

@media (max-width: 768px) {
    .blog-dashboard {
        padding: 16px;
    }

    .blog-editor-layout {
        grid-template-columns: 1fr;
    }

    .blog-ai-prompt-row {
        flex-direction: column;
    }

    .blog-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .blog-posts-table {
        display: block;
        overflow-x: auto;
    }
}
