/* Overview Page - Modern Dashboard Design */

/* ===== Stat Cards Row ===== */
.overview-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.overview-stat-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: statAppear 0.5s ease forwards;
    opacity: 0;
    transform: translateY(15px);
}

@keyframes statAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.overview-stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--stat-color);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--stat-color) 20%, transparent);
}

.stat-card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-color);
    opacity: 0.8;
}

.stat-card-content {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-wrapper svg {
    width: 22px;
    height: 22px;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.stat-trend {
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 4px;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--danger);
}

/* ===== Overview Grid ===== */
.overview-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Section Cards ===== */
.overview-section-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.overview-section-card:hover {
    border-color: var(--section-color, var(--border-color));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.section-card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.section-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-icon-wrapper svg {
    width: 18px;
    height: 18px;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

.section-badge {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.section-card-body {
    padding: 0;
}

/* ===== Daily Summary Table ===== */
.daily-summary-table {
    width: 100%;
}

.daily-summary-table table {
    width: 100%;
    border-collapse: collapse;
}

.daily-summary-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
}

.daily-summary-table td {
    padding: 12px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.daily-summary-table tr:last-child td {
    border-bottom: none;
}

.daily-summary-table tbody tr {
    transition: background 0.2s ease;
    cursor: pointer;
}

.daily-summary-table tbody tr:hover {
    background: var(--bg-hover);
}

.summary-date {
    font-weight: 600;
    color: var(--text-primary);
}

.summary-value {
    font-weight: 600;
    font-family: 'SF Mono', Monaco, monospace;
}

.summary-value.highlight {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* ===== Mini Charts ===== */
.mini-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px;
}

.mini-chart-card {
    background: var(--bg-dark);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s ease;
}

.mini-chart-card:hover {
    background: var(--bg-hover);
}

.mini-chart-canvas {
    width: 100%;
    max-width: 120px;
    margin: 0 auto 12px;
}

.mini-chart-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Recent Runs Section ===== */
.recent-runs-section {
    margin-top: 24px;
}

.recent-runs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 16px;
}

.recent-run-card {
    position: relative;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.recent-run-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--run-color, var(--accent));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.recent-run-card:hover {
    background: var(--bg-hover);
    border-color: var(--run-color, var(--accent));
    transform: translateX(4px);
}

.recent-run-card:hover::before {
    opacity: 1;
}

.run-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.run-status-indicator.success {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.run-status-indicator.warning {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.run-info {
    flex: 1;
    min-width: 0;
}

.run-datetime {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.run-metrics {
    display: flex;
    gap: 12px;
}

.run-metric {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.run-metric .value {
    font-weight: 600;
    color: var(--metric-color, var(--text-primary));
    margin-right: 2px;
}

.run-arrow {
    color: var(--text-muted);
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s ease;
}

.recent-run-card:hover .run-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ===== Quick Actions ===== */
.quick-actions-bar {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.quick-action-btn svg {
    width: 14px;
    height: 14px;
}

/* ===== Empty States ===== */
.overview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.overview-empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.overview-empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.overview-empty-message {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .overview-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .mini-charts-grid {
        grid-template-columns: 1fr;
    }

    .recent-runs-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .overview-stats-row {
        grid-template-columns: 1fr;
    }

    .stat-card-content {
        padding: 12px;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}
