/* ============================================
   TOOL VIDEO PLAYER
   ============================================ */

.video-player-scrim {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    z-index: 200;
    pointer-events: none;
    animation: videoFadeIn 0.3s ease;
}

@keyframes videoFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Controls bar — sticky top, overlays page header */
.video-player-controls {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 210;
    background: #1f2937;
    border-radius: 12px 12px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.video-player-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
    width: 100%;
    order: 1;
}

.video-player-progress-fill {
    height: 100%;
    background: #4F46E5;
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 0 2px 2px 0;
}

.video-player-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
}

.video-ctrl-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}

.video-ctrl-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.video-segment-indicator {
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    margin: 0 auto;
    letter-spacing: 0.5px;
}

.video-close-btn {
    margin-left: auto;
}


/* ============================================
   CONTENT ENGINE
   ============================================ */

/* --- States --- */
.ce-state {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.ce-state.hidden {
    display: none;
}

/* --- Sample Watermark --- */
.ce-sample-watermark {
    text-align: center;
    padding: 8px 16px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 16px;
}

.ce-sample-watermark.hidden {
    display: none;
}

/* --- Toolbar --- */
.ce-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.ce-toolbar-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-secondary, #6b7280);
    transition: all 0.15s ease;
}

.ce-toolbar-btn:hover {
    background: #f3f4f6;
    color: var(--color-text, #1a1a1a);
}

/* --- Score Header --- */
.ce-score-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

.ce-score-circle {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.ce-score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 700;
}

.ce-score-info {
    flex: 1;
}

.ce-score-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text, #1a1a1a);
    margin-bottom: 4px;
}

.ce-score-trend {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.ce-score-trend.up { color: #059669; }
.ce-score-trend.down { color: #dc2626; }
.ce-score-trend.flat { color: #6b7280; }

.ce-score-date {
    font-size: 12px;
    color: var(--color-text-tertiary, #9ca3af);
}

/* --- KPI Grid --- */
.ce-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .ce-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ce-kpi-card {
    padding: 16px;
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.ce-kpi-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ce-kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.ce-kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text, #1a1a1a);
    margin-bottom: 4px;
}

.ce-kpi-trend {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ce-kpi-trend.up { color: #059669; }
.ce-kpi-trend.down { color: #dc2626; }
.ce-kpi-trend.flat { color: #6b7280; }

/* --- Sections --- */
.ce-section {
    margin-bottom: 24px;
}

.ce-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ce-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text, #1a1a1a);
}

.ce-section-filters {
    display: flex;
    gap: 4px;
}

.ce-filter-btn {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
    font-size: 12px;
    cursor: pointer;
    color: var(--color-text-secondary, #6b7280);
    transition: all 0.15s ease;
}

.ce-filter-btn:hover {
    background: #f3f4f6;
}

.ce-filter-btn.active {
    background: var(--color-primary, #2563eb);
    color: white;
    border-color: var(--color-primary, #2563eb);
}

.ce-view-all-btn {
    padding: 4px 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    font-size: 13px;
    cursor: pointer;
    color: var(--color-primary, #2563eb);
    font-weight: 500;
    transition: all 0.15s ease;
}

.ce-view-all-btn:hover {
    background: rgba(37, 99, 235, 0.06);
}

/* --- Calendar Table --- */
.ce-calendar-table {
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.ce-calendar-header,
.ce-calendar-row {
    display: grid;
    grid-template-columns: 2fr 72px 80px 100px 100px;
    align-items: center;
    padding: 10px 16px;
    gap: 8px;
}

.ce-calendar-header {
    background: #f9fafb;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary, #6b7280);
}

.ce-calendar-row {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 13px;
    transition: background 0.1s ease;
}

.ce-calendar-row:last-child {
    border-bottom: none;
}

.ce-calendar-row:hover {
    background: #f9fafb;
}

.ce-calendar-name {
    font-weight: 500;
    color: var(--color-text, #1a1a1a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ce-calendar-type {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    text-align: center;
}

.ce-calendar-type[data-type="blog"] { background: #dbeafe; color: #2563eb; }
.ce-calendar-type[data-type="guide"] { background: #ede9fe; color: #7c3aed; }
.ce-calendar-type[data-type="report"] { background: #fef3c7; color: #d97706; }
.ce-calendar-type[data-type="social"] { background: #d1fae5; color: #059669; }

.ce-calendar-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    text-align: center;
}

.ce-calendar-status[data-status="published"] { background: #d1fae5; color: #059669; }
.ce-calendar-status[data-status="scheduled"] { background: #dbeafe; color: #2563eb; }
.ce-calendar-status[data-status="draft"] { background: #f3f4f6; color: #6b7280; }

.ce-calendar-cell {
    text-align: center;
    color: var(--color-text-secondary, #6b7280);
    font-size: 13px;
}

/* --- Content Performance Table --- */
.ce-content-table {
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.ce-content-header,
.ce-content-row {
    display: grid;
    grid-template-columns: 2fr 72px 64px 72px 64px 56px 56px;
    align-items: center;
    padding: 10px 16px;
    gap: 8px;
}

.ce-content-header {
    background: #f9fafb;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary, #6b7280);
}

.ce-content-row {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 13px;
    transition: background 0.1s ease;
}

.ce-content-row:last-child {
    border-bottom: none;
}

.ce-content-row:hover {
    background: #f9fafb;
}

.ce-content-name {
    font-weight: 500;
    color: var(--color-text, #1a1a1a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ce-content-cell {
    text-align: center;
    color: var(--color-text-secondary, #6b7280);
}

.ce-content-seo-score {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    margin: 0 auto;
}

.ce-content-seo-score.good { background: #d1fae5; color: #059669; }
.ce-content-seo-score.fair { background: #fef3c7; color: #d97706; }
.ce-content-seo-score.poor { background: #fee2e2; color: #dc2626; }

/* --- Briefs Grid --- */
.ce-briefs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 900px) {
    .ce-briefs-grid {
        grid-template-columns: 1fr;
    }
}

.ce-briefs-grid-detail {
    grid-template-columns: repeat(2, 1fr);
}

.ce-brief-card {
    position: relative;
    padding: 16px;
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.ce-brief-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ce-brief-status {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ce-brief-status[data-status="suggested"] { background: #dbeafe; color: #2563eb; }
.ce-brief-status[data-status="in-progress"] { background: #fef3c7; color: #d97706; }
.ce-brief-status[data-status="completed"] { background: #d1fae5; color: #059669; }

.ce-brief-keyword {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #1a1a1a);
    margin-bottom: 4px;
    padding-right: 80px;
}

.ce-brief-title {
    font-size: 13px;
    color: var(--color-text-secondary, #6b7280);
    margin-bottom: 10px;
    line-height: 1.4;
}

.ce-brief-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.ce-brief-meta-item {
    font-size: 12px;
    color: var(--color-text-secondary, #6b7280);
}

.ce-brief-difficulty.easy { color: #059669; font-weight: 600; }
.ce-brief-difficulty.medium { color: #d97706; font-weight: 600; }
.ce-brief-difficulty.hard { color: #dc2626; font-weight: 600; }

.ce-brief-gap {
    font-size: 12px;
    color: var(--color-text-tertiary, #9ca3af);
    line-height: 1.4;
    font-style: italic;
}

/* --- Scoring Breakdown --- */
.ce-scoring-breakdown {
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 16px;
}

.ce-scoring-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.ce-scoring-item + .ce-scoring-item {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.ce-scoring-label {
    width: 140px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text, #1a1a1a);
}

.ce-scoring-bar-container {
    flex: 1;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.ce-scoring-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.ce-scoring-value {
    width: 40px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text, #1a1a1a);
}

/* --- Clusters Table --- */
.ce-clusters-table {
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.ce-clusters-header,
.ce-cluster-row {
    display: grid;
    grid-template-columns: 2fr 80px 80px 72px 80px;
    align-items: center;
    padding: 10px 16px;
    gap: 8px;
}

.ce-clusters-header {
    background: #f9fafb;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary, #6b7280);
}

.ce-cluster-row {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 13px;
    transition: background 0.1s ease;
}

.ce-cluster-row:last-child {
    border-bottom: none;
}

.ce-cluster-row:hover {
    background: #f9fafb;
}

.ce-cluster-name-cell {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ce-cluster-name {
    font-weight: 500;
    color: var(--color-text, #1a1a1a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ce-cluster-top-kw {
    font-size: 11px;
    color: var(--color-text-tertiary, #9ca3af);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ce-cluster-cell {
    text-align: center;
    color: var(--color-text-secondary, #6b7280);
}

.ce-cluster-coverage {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    text-align: center;
}

.ce-cluster-coverage.good { background: #d1fae5; color: #059669; }
.ce-cluster-coverage.partial { background: #fef3c7; color: #d97706; }
.ce-cluster-coverage.gap { background: #fee2e2; color: #dc2626; }

/* --- Actions List --- */
.ce-actions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ce-action-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-left: 3px solid;
    transition: all 0.15s ease;
}

.ce-action-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.ce-action-item[data-severity="critical"] { border-left-color: #dc2626; }
.ce-action-item[data-severity="warning"] { border-left-color: #f59e0b; }
.ce-action-item[data-severity="suggestion"] { border-left-color: #2563eb; }

.ce-action-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.ce-action-item[data-severity="critical"] .ce-action-icon { color: #dc2626; }
.ce-action-item[data-severity="warning"] .ce-action-icon { color: #f59e0b; }
.ce-action-item[data-severity="suggestion"] .ce-action-icon { color: #2563eb; }

.ce-action-content {
    flex: 1;
    min-width: 0;
}

.ce-action-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text, #1a1a1a);
    margin-bottom: 2px;
}

.ce-action-desc {
    font-size: 12px;
    color: var(--color-text-secondary, #6b7280);
    line-height: 1.4;
}

.ce-action-category {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f3f4f6;
    color: var(--color-text-secondary, #6b7280);
    flex-shrink: 0;
    align-self: center;
}

/* --- Detail Views --- */
.ce-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ce-detail-back-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--color-text, #1a1a1a);
}

.ce-detail-back-btn:hover {
    background: #f3f4f6;
}

.ce-detail-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text, #1a1a1a);
}

.ce-detail-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* ── Social Post Creator ────────────────────── */

.ce-social-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.ce-social-source {
    padding: 16px 20px;
}

.ce-social-source-card {
    background: var(--color-surface, #f9fafb);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    padding: 16px 20px;
}

.ce-social-source-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text, #1a1a1a);
    margin-bottom: 6px;
    line-height: 1.4;
}

.ce-social-source-meta a {
    font-size: 12px;
    color: var(--color-primary, #4f46e5);
    text-decoration: none;
}

.ce-social-source-meta a:hover {
    text-decoration: underline;
}

.ce-social-drafts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 0 20px 20px;
}

@media (width <= 900px) {
    .ce-social-drafts {
        grid-template-columns: 1fr;
    }
}

.ce-social-draft-panel {
    background: var(--color-surface, #f9fafb);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ce-social-platform-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ce-social-platform-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
}

.ce-social-linkedin-icon {
    background: #0a66c2;
}

.ce-social-x-icon {
    background: #000;
    font-size: 14px;
}

.ce-social-platform-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #1a1a1a);
}

.ce-social-textarea {
    width: 100%;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    padding: 12px;
    font-family: Inter, sans-serif;
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text, #1a1a1a);
    background: #fff;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}

.ce-social-textarea:focus {
    outline: none;
    border-color: var(--color-primary, #4f46e5);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.ce-social-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ce-social-char-count {
    font-size: 12px;
    color: var(--color-text-secondary, #6b7280);
}

.ce-social-char-count.over-limit {
    color: #dc2626;
    font-weight: 600;
}

.ce-social-copy-btn {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    background: #fff;
    color: var(--color-text, #1a1a1a);
    cursor: pointer;
    transition: all 0.15s ease;
}

.ce-social-copy-btn:hover {
    background: var(--color-primary, #4f46e5);
    color: #fff;
    border-color: var(--color-primary, #4f46e5);
}

/* Loading skeleton */
.ce-social-skeleton {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}

.ce-social-skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: ce-skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    width: 100%;
}

.ce-social-skeleton-line.short {
    width: 60%;
}

@keyframes ce-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Error state */
.ce-social-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-secondary, #6b7280);
}

.ce-social-error p {
    margin-bottom: 12px;
    font-size: 14px;
}

.ce-social-retry-btn {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    background: #fff;
    color: var(--color-text, #1a1a1a);
    cursor: pointer;
}

.ce-social-retry-btn:hover {
    background: var(--color-surface, #f9fafb);
}

