/* =========================================================
 *  Damalion Blog AI — Admin CSS v2
 *  Progress bar modal + dashboard + logs
 * ========================================================= */

/* ── Status banner ── */
.dba-status-banner {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-left: 4px solid #0073aa;
    padding: 16px 20px;
    margin: 15px 0;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: center;
}
.dba-status-banner .dba-stat { font-size: 14px; }
.dba-status-banner .dba-stat strong { color: #0073aa; }

/* ── Quick actions ── */
.dba-actions {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 16px 20px;
    margin: 15px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.dba-actions .button { min-width: 140px; text-align: center; }

/* ── Sections ── */
.dba-section {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 20px;
    margin: 20px 0;
}
.dba-section h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* ── Log table ── */
.dba-log-table { border-collapse: collapse; width: 100%; }
.dba-log-table th,
.dba-log-table td { padding: 8px 12px; border: 1px solid #e5e5e5; font-size: 13px; vertical-align: top; }
.dba-log-table th { background: #f5f5f5; text-align: left; }
.dba-log-table .status-published { color: #46b450; font-weight: 600; }
.dba-log-table .status-draft { color: #f0b849; font-weight: 600; }
.dba-log-table .status-future { color: #0073aa; font-weight: 600; }
.dba-log-table .status-failed { color: #dc3232; font-weight: 600; }
.dba-log-table .status-generating { color: #826eb4; font-weight: 600; }

/* ── Notices ── */
.dba-notice-success { border-left: 4px solid #46b450; background: #ecf7ed; padding: 12px; margin: 10px 0; }
.dba-notice-error { border-left: 4px solid #dc3232; background: #fbeaea; padding: 12px; margin: 10px 0; }

/* ── Theme list ── */
.dba-theme-list { column-count: 3; column-gap: 20px; list-style: none; margin: 10px 0; padding: 0; }
.dba-theme-list li { padding: 4px 0; font-size: 13px; break-inside: avoid; }

/* =========================================================
 *  PROGRESS BAR MODAL
 * ========================================================= */

#dba-progress-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.65);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#dba-progress-modal {
    background: #fff;
    border-radius: 12px;
    width: 640px;
    max-width: 95vw;
    max-height: 85vh;
    padding: 28px 32px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

#dba-progress-title {
    margin: 0 0 16px 0;
    font-size: 20px;
    color: #1d2327;
}

/* Progress info row */
.dba-progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #50575e;
}
#dba-progress-percent {
    font-weight: 700;
    color: #0073aa;
    font-size: 16px;
}

/* Bar */
.dba-progress-bar-outer {
    height: 28px;
    background: #e5e5e5;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 18px;
    position: relative;
}
.dba-progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    border-radius: 14px;
    transition: width 0.6s ease;
    min-width: 0;
}
.dba-progress-bar-inner.dba-bar-success {
    background: linear-gradient(90deg, #46b450, #7ad03a) !important;
}
.dba-progress-bar-inner.dba-bar-error {
    background: linear-gradient(90deg, #dc3232, #e25050) !important;
}

/* Current step */
.dba-current-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: #f0f6fc;
    border: 1px solid #c3d4e6;
    border-radius: 8px;
    margin-bottom: 14px;
    min-height: 48px;
}
.dba-step-icon { font-size: 22px; flex-shrink: 0; }
.dba-step-text { font-size: 14px; line-height: 1.5; }
.dba-step-text strong { color: #1d2327; }
.dba-step-detail { color: #646970; font-size: 13px; }

/* Steps log */
.dba-steps-log {
    flex: 1;
    overflow-y: auto;
    max-height: 260px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 8px;
    background: #fafafa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin-bottom: 14px;
}
.dba-log-entry {
    padding: 5px 8px;
    font-size: 12px;
    line-height: 1.6;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 6px;
    align-items: baseline;
    flex-wrap: wrap;
}
.dba-log-entry:last-child { border-bottom: none; }
.dba-log-time { color: #8c8f94; font-family: monospace; font-size: 11px; white-space: nowrap; }
.dba-log-name { font-weight: 600; white-space: nowrap; }
.dba-log-detail { color: #646970; }

/* Log status colors */
.dba-log-done .dba-log-name { color: #2e7d32; }
.dba-log-failed .dba-log-name { color: #c62828; }
.dba-log-warning .dba-log-name { color: #e65100; }
.dba-log-running .dba-log-name { color: #0073aa; }
.dba-log-skipped .dba-log-name { color: #8c8f94; }
.dba-log-retry .dba-log-name { color: #826eb4; }

/* Footer */
.dba-progress-footer {
    text-align: center;
    padding-top: 10px;
}
.dba-progress-footer .button { min-width: 120px; }

/* Success / error text */
.dba-success { color: #2e7d32 !important; }
.dba-error { color: #c62828 !important; }

/* ── Responsive ── */
@media (max-width: 768px) {
    #dba-progress-modal { padding: 18px 16px; width: 96vw; }
    .dba-status-banner { flex-direction: column; gap: 8px; }
    .dba-actions { flex-direction: column; }
    .dba-theme-list { column-count: 2; }
}
