.status-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
}

.status-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: #cbd5e1; 
    transition: background 0.4s ease;
}

.status-card.phase-scraping::before { background: #3b82f6;}
.status-card.phase-ai::before { background: #8b5cf6;}
.status-card.phase-complete::before { background: #10b981;}
.status-card.phase-error::before { background: #ef4444;}

.status-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
    position: relative;
}

.status-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #64748b;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 4px white, 0 0 0 5px #e2e8f0;
}

.phase-scraping .status-icon-box { background: #eff6ff; color: #3b82f6; box-shadow: 0 0 0 4px white, 0 0 0 5px #bfdbfe; }
.phase-ai .status-icon-box { background: #f5f3ff; color: #8b5cf6; box-shadow: 0 0 0 4px white, 0 0 0 5px #ddd6fe; }
.phase-complete .status-icon-box { background: #ecfdf5; color: #10b981; box-shadow: 0 0 0 4px white, 0 0 0 5px #bbf7d0; }

.status-headline {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.status-subtext {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.progress-container {
    width: 100%;
    max-width: 400px;
    margin-bottom: 2rem;
}

.progress-track {
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #3b82f6;
    border-radius: 4px;
    transition: width 0.5s ease, background-color 0.5s ease;
}

.phase-scraping .progress-fill { background: #3b82f6; }
.phase-ai .progress-fill { background: #8b5cf6; }
.phase-complete .progress-fill { background: #10b981; }

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.5rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    max-width: 500px;
    gap: 1rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 1.5rem;
    opacity: 0.5; 
    transition: opacity 0.3s;
}

.phase-scraping .stats-grid, 
.phase-ai .stats-grid, 
.phase-complete .stats-grid {
    opacity: 1;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #334155;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.usage-dashboard-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.usage-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.usage-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
}

.usage-main-numbers {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.usage-main-numbers h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.usage-divider {
    font-size: 1.2rem;
    color: #cbd5e1;
    font-weight: 400;
}

.usage-main-numbers h3 {
    font-size: 1.1rem;
    color: #94a3b8;
    margin: 0;
}

.plan-status-area {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.plan-badge-large {
    background: #f5f3ff;
    color: #7c3aed;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid #ddd6fe;
}

.reset-timer {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

.usage-progress-bar {
    height: 10px;
    background: #f1f5f9;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.usage-progress-fill {
    height: 100%;
    background: #8b5cf6;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.usage-footer-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
}

#usage-percentage-label {
    color: #1e293b;
}

#usage-status-text {
    color: #64748b;
}

.usage-warning .usage-progress-fill { background: #f59e0b; }
.usage-danger .usage-progress-fill { background: #ef4444; }
.usage-danger #usage-status-text { color: #ef4444; }


.queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 1rem;
}

.queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #475569;
}

.queue-pos-badge {
    background: #e2e8f0;
    color: #475569;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-right: 8px;
}

.queue-spinner {
    color: #f59e0b;
    animation: spin 2s linear infinite;
}

.queue-visible {
    display: block !important;
}

#queue-card {
    display: none;
}

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

.fa-hourglass-half {
    animation: spin 2s linear infinite;
}

.spin-slow {
    animation: spin 3s linear infinite;
}
