/* Design System CSS Variables */
:root {
    /* Spacing System */
    --primitives-spacing-0: 0px;
    --primitives-spacing-0-5: 2px;
    --primitives-spacing-1: 4px;
    --primitives-spacing-1-duplicate: 4px;
    --primitives-spacing-5: 20px;
    --primitives-spacing-11: 44px;
    --primitives-spacing-14: 56px;

    /* Border Radius */
    --themes-border-border-radius-rounded-sm: 4px;

    /* Background Colors */
    --themes-colors-background-bg-secondary-soft: #f9fafb;
    --themes-colors-background-bg-secondary-medium: #f5f5f5;
    --themes-colors-background-bg-brand-softer: #e6f3ff;
    --themes-colors-background-bg-warning-soft: #fff8f1;
    --themes-colors-background-bg-danger-soft: #fef0f2;

    /* Border Colors */
    --themes-colors-border-border-base: #e5e5e5;
    --themes-colors-border-border-base-medium: #d1d1d1;
    --themes-colors-border-border-brand-subtle: #b3d9ff;
    --themes-colors-border-border-warning-subtle: #fcd9bd;
    --themes-colors-border-border-danger-subtle: #ffccd3;

    /* Text Colors */
    --themes-colors-text-text-body: #333333;
    --themes-colors-text-text-fg-brand-strong: #1c398e;
    --themes-colors-text-text-fg-warning: #771d1d;
    --themes-colors-text-text-fg-danger-strong: #8b0836;

    /* Brand Colors (Figma: Green/100) */
    --color-brand-green: #25af88;
    --color-brand-green-hover: #1e9a73;

    /* Panel Headers (Figma: tenant info panel header tint) */
    --color-panel-header-tinted: #f5fbf7;

    /* Chart Colors (Figma: donut charts) */
    --color-chart-status-online: #22e5a1;
    --color-chart-status-offline: #ff5e5e;
    --color-chart-importance-low: #51c0ff;
    --color-chart-importance-medium: #fe9239;
    --color-chart-importance-high: #ff5e5e;

    /* Chart Colors (Figma: bar charts) */
    --color-chart-alert-bar: #5bdcc6; /* Figma: Primary/300 teal */

    /* Dashboard Figma Alignment (Phase 1) */
    /* Banner gradient backgrounds */
    --color-banner-gradient-start: #e8f9f3;
    --color-banner-gradient-end: #d4f1e8;

    /* Alert severity dot colors (8px circles) */
    --color-severity-dot-high: #ff5e5e; /* coral red */
    --color-severity-dot-medium: #fe9239; /* warm orange */
    --color-severity-dot-info: #51c0ff; /* sky blue */

    /* Status Pill Colors (Figma: pill-shaped status badges) */
    --color-status-pill-bg-online: #e8f9f3;
    --color-status-pill-text-online: #1a7f5f;
    --color-status-pill-bg-danger: #ffe8e8;
    --color-status-pill-text-danger: #c93636;
    --color-status-pill-bg-warning: #fff3e8;
    --color-status-pill-text-warning: #b86e0f;
    --color-status-pill-bg-info: #e8f6ff;
    --color-status-pill-text-info: #2e7db5;
    --color-status-pill-bg-neutral: #f3f4f6;
    --color-status-pill-text-neutral: #6b7280;

    /* Filter Pill Colors (Figma: toggle filter buttons) */
    --color-filter-pill-bg-active: #25af88;
    --color-filter-pill-text-active: #ffffff;
    --color-filter-pill-border-inactive: #d1d5db;
    --color-filter-pill-text-inactive: #374151;
}

/* Flowbite Badge Base Styles - High specificity */
table .flowbite-badge,
.flowbite-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 2px 4px !important;
    position: relative !important;
    border-radius: 4px !important;
    border: 1px solid !important;
    white-space: nowrap !important;
    font-family: "Ubuntu Sans-Medium", Helvetica, sans-serif !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    text-align: center !important;
    letter-spacing: 0 !important;
    line-height: 16px !important;
}

/* Flowbite Severity Badge Variants - High specificity - Design System Colors */
table .flowbite-badge-severity-low,
.flowbite-badge-severity-low {
    border-radius: 6px !important;
    border: 1px solid #bedbff !important;
    background: #eef6ff !important;
    color: #1c398e !important;
    text-align: center !important;
    font-family: "Ubuntu Sans", sans-serif !important;
    font-size: 12px !important;
    font-style: normal !important;
    font-weight: 500 !important;
    line-height: 16px !important; /* 133.333% */
}

table .flowbite-badge-severity-medium,
.flowbite-badge-severity-medium {
    border-radius: 6px !important;
    border: 1px solid #fcd9bd !important;
    background: #fff8f1 !important;
    color: #8b0836 !important;
    text-align: center !important;
    font-family: "Ubuntu Sans", sans-serif !important;
    font-size: 12px !important;
    font-style: normal !important;
    font-weight: 500 !important;
    line-height: 16px !important; /* 133.333% */
}

table .flowbite-badge-severity-high,
.flowbite-badge-severity-high {
    border-radius: 6px !important;
    border: 1px solid #ffccd3 !important;
    background: #fef0f2 !important;
    color: #8b0836 !important;
    text-align: center !important;
    font-family: "Ubuntu Sans", sans-serif !important;
    font-size: 12px !important;
    font-style: normal !important;
    font-weight: 500 !important;
    line-height: 16px !important; /* 133.333% */
}

table .flowbite-badge-severity-critical,
.flowbite-badge-severity-critical {
    border-radius: 6px !important;
    border: 1px solid #ffccd3 !important;
    background: #fef0f2 !important;
    color: #8b0836 !important;
    text-align: center !important;
    font-family: "Ubuntu Sans", sans-serif !important;
    font-size: 12px !important;
    font-style: normal !important;
    font-weight: 500 !important;
    line-height: 16px !important; /* 133.333% */
}

/* Flowbite Status Badge Variants - No dot icon, rounded shape */
table .flowbite-badge-status-active,
.flowbite-badge-status-active {
    background-color: #f5f5f5 !important;
    border-color: #d1d1d1 !important;
    color: #333333 !important;
    border-radius: 6px !important;
    padding: 2px 6px !important;
}

table .flowbite-badge-status-resolved,
.flowbite-badge-status-resolved {
    background-color: #e5e5e5 !important;
    border-color: #d1d1d1 !important;
    color: #666666 !important;
    border-radius: 6px !important;
    padding: 2px 6px !important;
}

table .flowbite-badge-status-acknowledged,
.flowbite-badge-status-acknowledged {
    background-color: #e6f3ff !important;
    border-color: #b3d9ff !important;
    color: #1c398e !important;
    border-radius: 6px !important;
    padding: 2px 6px !important;
}

/* Table Header Cell - Standard table cell, not flex container */
table thead th.table-header-cell {
    height: 44px;
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #4a5565;
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    text-transform: capitalize;
    vertical-align: middle;
    text-align: left;
}

/* Table Header Link - Flex container for text and icon alignment */
table thead th.table-header-cell .table-header-link {
    color: #4a5565;
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-transform: capitalize;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* Table header text */
table thead th.table-header-cell .table-header-link .table-header-text {
    display: inline;
}

/* SVG icons in table headers */
table thead th.table-header-cell .table-header-link svg {
    display: inline-block;
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    vertical-align: middle;
}

.table-header-link:hover {
    color: #1f2937;
}

/* Status Pill Variant Classes (Figma: pill-shaped status badges) */
.status-pill-online {
    background-color: var(--color-status-pill-bg-online);
    color: var(--color-status-pill-text-online);
}

.status-pill-danger {
    background-color: var(--color-status-pill-bg-danger);
    color: var(--color-status-pill-text-danger);
}

.status-pill-warning {
    background-color: var(--color-status-pill-bg-warning);
    color: var(--color-status-pill-text-warning);
}

.status-pill-info {
    background-color: var(--color-status-pill-bg-info);
    color: var(--color-status-pill-text-info);
}

.status-pill-neutral {
    background-color: var(--color-status-pill-bg-neutral);
    color: var(--color-status-pill-text-neutral);
}

/* Filter Pill Variant Classes (Figma: toggle filter buttons) */
.filter-pill-active {
    background-color: var(--color-filter-pill-bg-active);
    color: var(--color-filter-pill-text-active);
}

.filter-pill-inactive {
    border-color: var(--color-filter-pill-border-inactive);
    color: var(--color-filter-pill-text-inactive);
}

/* Active row highlight for table row selection */
:root {
    --color-row-highlight: #e0f2fe;
}

#product-models-table tr.pm-row-active td {
    background-color: var(--color-row-highlight);
}

/* Subtle pulsing animation for attention-drawing buttons (V53) */
@keyframes pulse-orange {
    0%,
    100% {
        background-color: #f97316;
    }
    50% {
        background-color: #fdba74;
    }
}

.animate-pulse-orange {
    animation: pulse-orange 2.5s ease-in-out infinite;
}

/* Leaflet popup overrides — keep close button inside the white box */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    padding: 12px 14px;
}

.leaflet-popup-content {
    margin: 0;
    font-family: "Inter", system-ui, sans-serif;
    font-size: 13px;
}

.leaflet-container a.leaflet-popup-close-button {
    top: 8px;
    right: 10px;
    z-index: 10;
    font-size: 20px;
    font-weight: 400;
    color: #9ca3af;
    width: 20px;
    height: 20px;
    line-height: 20px;
    padding: 0;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: #374151;
}
