/* ==========================================================================
   SNAPIMAGE AI ARTICLE STUDIO & PUBLISHER (V2)
   ========================================================================== */

.editor-app-wrapper {
    background-color: #f8fafc;
    min-height: 100vh;
    padding-top: 86px;
    padding-bottom: 60px;
}

.studio-topbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 24px;
    position: sticky;
    top: 66px;
    z-index: 1010;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.slug-preview-pill {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12.5px;
    color: #475569;
}

.slug-preview-pill input {
    border: none;
    background: transparent;
    color: #2563eb;
    font-weight: 700;
    font-size: 12.5px;
    outline: none;
    width: 175px;
}

.slug-preview-pill input:disabled {
    color: #64748b;
    cursor: not-allowed;
}

.slug-status-badge {
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
}
.slug-ok { background: #dcfce7; color: #15803d; }
.slug-taken { background: #fee2e2; color: #b91c1c; }

/* Panels */
.editor-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    margin-bottom: 20px;
}

.panel-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Unified Cover Image Studio (Upload OR AI Generate, Mutually Replaceable) */
.cover-studio-box {
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    padding: 20px;
    margin-bottom: 24px;
    transition: border-color 0.2s ease;
}

.cover-studio-box:hover {
    border-color: #93c5fd;
}

.cover-preview-wrapper {
    position: relative;
    margin-bottom: 14px;
    display: none;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.cover-preview-img {
    width: 100%;
    max-height: 340px;
    object-fit: cover;
    display: block;
}

.cover-source-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(15, 23, 42, 0.78);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.cover-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 38, 38, 0.9);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.cover-controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Voice Dictation Bar */
.voice-assistant-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.voice-assistant-bar.listening {
    background: #fef2f2;
    border-color: #fca5a5;
}

.btn-voice {
    background: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-voice.active {
    background: #dc2626;
    animation: pulseMic 1.4s infinite;
}

@keyframes pulseMic {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
    70% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Rich Formatting Toolbar */
.rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 16px;
    position: sticky;
    top: 132px;
    z-index: 1005;
}

.tool-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tool-btn:hover {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}

.tool-divider {
    width: 1px;
    background: #cbd5e1;
    margin: 2px 4px;
}

/* Title & Lead Inputs */
.article-title-input {
    width: 100%;
    border: none;
    font-size: 2.05rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    outline: none;
    margin-bottom: 10px;
    background: transparent;
}

.article-subtitle-input {
    width: 100%;
    border: none;
    font-size: 1.08rem;
    color: #64748b;
    outline: none;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
    background: transparent;
}

/* Editable Canvas */
.article-canvas {
    min-height: 500px;
    outline: none;
    font-size: 1.08rem;
    line-height: 1.8;
    color: #1e293b;
    padding: 10px 4px;
}

.article-canvas:empty:before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
}

.article-canvas.theme-serif { font-family: Georgia, 'Times New Roman', serif; font-size: 1.14rem; }
.article-canvas.theme-tech { font-family: 'Inter', system-ui, sans-serif; letter-spacing: -0.01em; }

.article-canvas h2 { font-size: 1.6rem; font-weight: 800; color: #0f172a; margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 2px solid #f1f5f9; }
.article-canvas h3 { font-size: 1.3rem; font-weight: 700; color: #1e293b; margin: 22px 0 10px; }
.article-canvas blockquote { border-left: 4px solid #2563eb; background: #eff6ff; padding: 16px 20px; border-radius: 0 10px 10px 0; font-style: italic; color: #1e3a8a; margin: 20px 0; }
.article-canvas table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.95rem; }
.article-canvas th, .article-canvas td { border: 1px solid #cbd5e1; padding: 10px 14px; }
.article-canvas th { background: #f1f5f9; font-weight: 700; }

/* Multi-Tag Chips */
.tags-chip-box {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    min-height: 42px;
    align-items: center;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
}

.tag-chip button {
    border: none;
    background: transparent;
    color: #2563eb;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.tag-input-inline {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    flex: 1;
    min-width: 110px;
}

.preset-tag-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}
.preset-tag-btn:hover { background: #e2e8f0; color: #0f172a; }

/* AI Action Chips */
.ai-chip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ai-action-chip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ai-action-chip:hover { background: #eff6ff; border-color: #2563eb; color: #2563eb; }

.published-success-banner {
    display: none;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    color: #065f46;
}