/* Dashboard Tile Styling
 * Shared styles for dashboard tiles across all dashboards.
 * Extracted from individual dashboard components for consistency.
 */

/* Base dashboard tile */
.dashboard-tile {
    position: relative;
    overflow: hidden;
    border-radius: 16px !important;
    height: 220px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-tile:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12) !important;
}

.dashboard-tile::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    transition: all 0.5s ease;
    pointer-events: none;
}

.dashboard-tile:hover::before {
    transform: scale(1.5);
}

.dashboard-tile .tile-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.dashboard-tile:hover .tile-icon {
    transform: scale(1.1);
    background: rgba(255,255,255,0.35);
}

.tile-subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Metric tile - smaller variant for summary cards/metrics */
.dashboard-metric-tile {
    position: relative;
    overflow: hidden;
    border-radius: 16px !important;
    height: 140px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-metric-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1) !important;
}

.dashboard-metric-tile::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    transition: all 0.5s ease;
    pointer-events: none;
}

.dashboard-metric-tile:hover::before {
    transform: scale(1.5);
}

.dashboard-metric-tile .metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.dashboard-metric-tile:hover .metric-icon {
    transform: scale(1.1);
    background: rgba(255,255,255,0.35);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.metric-label {
    font-size: 0.75rem;
    opacity: 0.9;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Neutral and Alert tile variants
 * Restrained treatment used by the Services dashboard. Meets WCAG 2.1 AA text-contrast
 * requirements: metric values render as `--mud-palette-text-primary` on the standard
 * `--mud-palette-surface`, labels as `--mud-palette-text-secondary`. No gradient overlay.
 * The Alert variant adds a left accent border and colours the icon+value when an alarm
 * condition is active; when calm it collapses to the Neutral appearance so a
 * zero-count "no problems" tile does not scream red at the reader. */

.dashboard-metric-tile--neutral,
.dashboard-metric-tile--alert {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    color: var(--mud-palette-text-primary);
}

.dashboard-metric-tile--neutral::before,
.dashboard-metric-tile--alert::before {
    display: none;
}

.dashboard-metric-tile--neutral .metric-icon,
.dashboard-metric-tile--alert .metric-icon {
    backdrop-filter: none;
}

.dashboard-metric-tile--neutral:hover,
.dashboard-metric-tile--alert:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important;
    transform: translateY(-2px);
}

/* Gradient presets for tiles */
.gradient-green {
    background: linear-gradient(135deg, #43E97B 0%, #38F9D7 100%);
    color: white;
}

.gradient-orange {
    background: linear-gradient(135deg, #F6D365 0%, #FDA085 100%);
    color: white;
}

.gradient-blue {
    background: linear-gradient(135deg, #4FACFE 0%, #00F2FE 100%);
    color: white;
}

.gradient-purple {
    background: linear-gradient(135deg, #A18CD1 0%, #FBC2EB 100%);
    color: white;
}

.gradient-red {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A24 100%);
    color: white;
}

.gradient-indigo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.gradient-teal {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.gradient-pink {
    background: linear-gradient(135deg, #FA709A 0%, #FEE140 100%);
    color: white;
}

.gradient-warning {
    background: linear-gradient(135deg, #FA709A 0%, #FEE140 100%);
    color: white;
}

.gradient-success {
    background: linear-gradient(135deg, #0BA360 0%, #3CBA92 100%);
    color: white;
}

.gradient-error {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    color: white;
}

/* Widget loading skeleton */
.widget-skeleton {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Widget error state */
.widget-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    color: var(--mud-palette-text-secondary);
}

/* Widget empty state */
.widget-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    color: var(--mud-palette-text-secondary);
}

/* Dashboard section header
 * Underline uses --mud-palette-lines-default (Nova's neutral border tone) rather than the
 * primary brand colour. The section heading is a structural separator, not a call to action;
 * a coloured underline pulls the eye away from the tiles below where the real information
 * lives. Neutral lines meet WCAG non-text contrast (3:1) against the surface. */
.dashboard-section-header {
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* Screen-reader-only class used by dashboard charts to expose their underlying data as
   a proper HTML table. The SVG chart itself is opaque to assistive technology; this table
   is visually hidden but reachable by every screen reader. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
