/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.loader-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9998;
}

.loader-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg2);
    border: 1px solid var(--border);
    padding: 20px 28px;
    border-radius: 12px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text);
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loader-text {
    font-size: 13px;
    color: var(--muted);
}

/* ── Scrape Console Styles ─────────────────────────────────── */
.scrape-console-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    font-family: inherit;
}

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

.console-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.console-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text);
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    display: inline-block;
    transition: background 0.3s;
}

.pulse-indicator.pulse-active {
    background: var(--pos);
    box-shadow: 0 0 8px var(--pos);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.console-progress-text {
    font-size: 12px;
    color: var(--muted);
    font-family: 'DM Mono', monospace;
}

.console-progress-bar {
    background: var(--bg3);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.console-progress-fill {
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.console-sources-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.console-source-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg3);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.console-source-row:hover {
    border-color: var(--border);
}

.source-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.source-status-text {
    font-size: 12px;
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
    padding: 2px 8px;
    border-radius: 4px;
}

.status-pending {
    color: var(--muted);
    background: rgba(100, 116, 139, 0.1);
}

.status-running {
    color: var(--accent2);
    background: rgba(99, 102, 241, 0.15);
}

.status-done {
    color: var(--pos);
    background: rgba(34, 197, 94, 0.15);
}

.status-failed {
    color: var(--neg);
    background: rgba(239, 68, 68, 0.15);
}

.console-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.dot-pending {
    background: var(--muted);
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.console-spinner {
    width: 10px;
    height: 10px;
    border: 2px solid rgba(129, 140, 248, 0.3);
    border-top: 2px solid var(--accent2);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.console-check {
    font-weight: bold;
}

.console-cross {
    font-weight: bold;
}
