/* ============================================
   BLOG EDITOR STYLES
   Professional blog post editor layout
   ============================================ */

/* ==============================================
   BLOG LIST - PILL NAV BADGES
   ============================================== */

.pill-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    margin-left: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text-medium);
    background: rgba(0, 0, 0, 0.06);
    border-radius: 9999px;
}

.pill-nav-item.active .pill-nav-badge {
    background: rgba(255, 169, 77, 0.2);
    color: var(--honey-dark);
}

.pill-nav-badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.pill-nav-badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.pill-nav-badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}

/* ==============================================
   BLOG LIST TABLE STYLES
   ============================================== */

.blog-posts-table {
    width: 100%;
    border-collapse: collapse;
}

.blog-posts-table th {
    text-align: left;
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-medium);
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.blog-posts-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

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

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

.blog-post-title-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.blog-post-thumbnail {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
}

.blog-post-thumbnail-placeholder {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #f5f5f5 0%, #efefef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.blog-post-thumbnail-placeholder i {
    font-size: 1.25rem;
    color: #d1d5db;
}

.blog-post-info {
    min-width: 0;
}

.blog-post-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-post-slug {
    font-size: 0.8125rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-post-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-post-actions .btn-icon-secondary,
.blog-post-actions .btn-icon-success,
.blog-post-actions .btn-icon-warning,
.blog-post-actions .btn-icon-danger {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-icon-success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.btn-icon-success:hover {
    background: rgba(34, 197, 94, 0.2);
}

.btn-icon-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.btn-icon-warning:hover {
    background: rgba(245, 158, 11, 0.2);
}

.btn-icon-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ==============================================
   BLOG EDITOR LAYOUT
   ============================================== */

.blog-editor-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
}

.blog-editor-content {
    flex: 1;
    overflow-y: auto;
}

.editor-tab-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

/* ==============================================
   TAB CONTENT AREAS
   ============================================== */

.blog-editor-main {
    min-height: 600px;
}

.blog-editor-tab {
    display: none;
    animation: fadeInUp 0.3s ease-out;
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================================
   FORM SECTIONS
   ============================================== */

.blog-form-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.blog-form-section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.blog-form-section-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.25rem;
}

.blog-form-section-header p {
    font-size: 0.875rem;
    color: var(--text-medium);
    margin: 0;
}

.blog-form-group {
    margin-bottom: 1.5rem;
}

.blog-form-group:last-child {
    margin-bottom: 0;
}

.blog-form-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.blog-form-label .required {
    color: #ef4444;
    margin-left: 0.25rem;
}

.blog-form-hint {
    font-size: 0.8125rem;
    color: var(--text-medium);
    margin-top: 0.375rem;
    display: block;
}

.blog-form-error {
    font-size: 0.8125rem;
    color: #ef4444;
    margin-top: 0.375rem;
    display: none;
}

.blog-form-error.active {
    display: block;
}

/* ==============================================
   QUILL EDITOR CONTAINER
   ============================================== */

.blog-quill-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
}

.blog-quill-toolbar {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem;
}

.blog-quill-editor {
    min-height: 500px;
    font-size: 1rem;
    line-height: 1.75;
}

.ql-container {
    font-family: inherit;
    font-size: inherit;
}

.ql-editor {
    padding: 1.5rem;
    min-height: 500px;
}

.ql-editor.ql-blank::before {
    color: var(--text-light);
    font-style: normal;
}

/* ==============================================
   PREVIEW SIDEBAR (STICKY)
   ============================================== */

.blog-editor-preview {
    position: sticky;
    top: 2rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

.preview-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.preview-featured-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #f5f5f5 0%, #efefef 100%);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.preview-featured-image i {
    font-size: 3rem;
    color: var(--text-light);
}

.preview-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 1rem;
    line-height: 1.4;
}

.preview-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.preview-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-medium);
}

.preview-meta-item i {
    color: var(--honey);
}

.preview-excerpt {
    font-size: 0.9375rem;
    color: var(--text-medium);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.preview-stat {
    text-align: center;
}

.preview-stat i {
    display: block;
    font-size: 1.25rem;
    color: var(--honey);
    margin-bottom: 0.25rem;
}

.preview-stat span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-medium);
}

.preview-stat span:first-of-type {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preview-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--honey-light);
    color: var(--honey-dark);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ==============================================
   FEATURED IMAGE UPLOADER
   ============================================== */

.blog-image-uploader {
    border: 2px dashed #e5e7eb;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: #fafafa;
}

.blog-image-uploader:hover {
    border-color: var(--honey);
    background: var(--honey-light);
}

.blog-image-uploader.dragover {
    border-color: var(--honey);
    background: var(--honey-light);
}

.blog-image-uploader-icon {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.blog-image-uploader-text {
    font-size: 0.9375rem;
    color: var(--text-medium);
    margin-bottom: 0.5rem;
}

.blog-image-uploader-hint {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.blog-image-preview-container {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #f5f5f5;
}

.blog-image-preview {
    width: 100%;
    height: auto;
    display: block;
}

.blog-image-remove {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.blog-image-remove:hover {
    background: #ef4444;
}

/* ==============================================
   TAG INPUT
   ============================================== */

.blog-tag-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
}

.blog-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--honey-light);
    color: var(--honey-dark);
    border-radius: 9999px;
    font-size: 0.875rem;
}

.blog-tag-remove {
    cursor: pointer;
    color: var(--honey-dark);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.blog-tag-remove:hover {
    opacity: 1;
}

.blog-tag-input {
    flex: 1;
    min-width: 150px;
    border: none;
    outline: none;
    font-size: 0.9375rem;
    padding: 0.375rem;
}

/* ==============================================
   SLUG FIELD
   ============================================== */

.blog-slug-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.blog-slug-prefix {
    font-size: 0.9375rem;
    color: var(--text-medium);
    white-space: nowrap;
}

.blog-slug-input {
    flex: 1;
}

/* ==============================================
   HISTORY TIMELINE
   ============================================== */

.blog-history-timeline {
    position: relative;
    padding-left: 2rem;
}

.blog-history-item {
    position: relative;
    padding-bottom: 2rem;
}

.blog-history-item:last-child {
    padding-bottom: 0;
}

.blog-history-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: var(--honey);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--honey-light);
}

.blog-history-item::after {
    content: '';
    position: absolute;
    left: -1.1875rem;
    top: 1.25rem;
    width: 2px;
    height: calc(100% - 0.75rem);
    background: #e5e7eb;
}

.blog-history-item:last-child::after {
    display: none;
}

.blog-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.blog-history-action {
    font-weight: 600;
    color: var(--text-dark);
}

.blog-history-time {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.blog-history-user {
    font-size: 0.875rem;
    color: var(--text-medium);
    margin-bottom: 0.5rem;
}

.blog-history-changes {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-size: 0.875rem;
}

.blog-history-change-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.blog-history-change-item:last-child {
    margin-bottom: 0;
}

.blog-history-change-label {
    font-weight: 500;
    color: var(--text-dark);
}

.blog-history-change-value {
    color: var(--text-medium);
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */

@media (max-width: 1280px) {
    .editor-tab-wrapper {
        grid-template-columns: 1fr;
    }

    .blog-editor-preview {
        position: relative;
        top: 0;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .blog-form-section {
        padding: 1.5rem;
    }

    .blog-quill-editor {
        min-height: 400px;
    }

    .preview-stats {
        grid-template-columns: 1fr;
    }
}
