/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: min-content;
    /* Better for variable height */
    gap: 20px;
    padding: 20px;
}

.dash-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Changed from center to allow lists */
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    /* Contain children */
}

.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.hero-card {
    grid-column: span 1;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    justify-content: center;
}

.metric-card {
    grid-column: span 1;
    align-items: flex-start;
    padding-left: 24px;
    position: relative;
    justify-content: center;
}

.metric-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0.5;
    pointer-events: none;
}

.metric-card.critical {
    border-color: rgba(239, 68, 68, 0.3);
}

.metric-card.critical::after {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.2) 0%, transparent 70%);
}

.metric-card.success {
    border-color: rgba(16, 185, 129, 0.3);
}

.metric-card.success::after {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
}

.chart-card {
    grid-column: span 2;
    /* Default charts take 2 cols */
    min-height: 300px;
    justify-content: center;
}

.full-width {
    grid-column: span 4;
    min-height: 350px;
}

.list-card {
    grid-column: span 2;
    min-height: 300px;
    align-items: stretch;
    /* Full width children */
}

/* Lists */
.scroll-list {
    flex: 1;
    overflow-y: auto;
    width: 100%;
    margin-top: 10px;
    padding-right: 4px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item .url {
    color: var(--text-main);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.list-item .score-bad {
    color: #ef4444;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.trend-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.trend-badge.up {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.trend-badge.down {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.badge.critical {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge.warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.empty-state {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 13px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 8px;
    font-family: 'Inter', sans-serif;
}

.metric-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.icon {
    font-size: 24px;
    margin-bottom: 4px;
}

/* Gauge Styles */
.gauge-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
}

#heroScore {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.score-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    width: 100%;
    text-align: left;
}

/* Scrollbar for lists */
.scroll-list::-webkit-scrollbar {
    width: 4px;
}

.scroll-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .full-width {
        grid-column: span 2;
    }

    .list-card {
        grid-column: span 1;
    }

    .chart-card {
        grid-column: span 1;
    }

    .hero-card {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .full-width,
    .list-card,
    .chart-card,
    .hero-card,
    .metric-card {
        grid-column: span 1;
    }
}