@import '../../utils/shared-styles.scss';

.status {
    background: $color-white;

    .status__summary {
        display: flex;
        align-items: center;
        gap: .5rem;
        padding: 1rem;
        border: 1px solid $color-gray-light;
        border-radius: 14px;
        margin: 1rem 0;
        background: $color-background-main;

        .dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            display: inline-block;
            flex-shrink: 0;
        }

        .dot.ok {
            background: $color-success;
        }

        .dot.warn {
            background: $color-warning;
        }

        .dot.err {
            background: $color-error;
        }

        .dot.info {
            background: $color-info;
        }

        .summary__title {
            color: $color-text-primary;
        }

        .summary__meta {
            margin-left: auto;
            color: $color-gray;
            font-size: .9rem;
        }

        .btn--xs {
            height: 34px;
            padding: 0 .6rem;
            border-radius: 10px;
            font-size: .9rem;
        }
    }

    .grid {
        display: grid;
        gap: 1rem;
        grid-template-columns: 1fr;

        @media (min-width: 700px) {
            grid-template-columns: repeat(2, 1fr);
        }

        @media (min-width: 1100px) {
            grid-template-columns: repeat(3, 1fr);
        }
    }

    .card {
        border: 1px solid $color-gray-light;
        border-radius: 14px;
        background: $color-white;
        display: grid;
        gap: .75rem;
        padding: 1rem;

        .card__head {
            display: flex;
            align-items: center;
            gap: .5rem;

            .card__title {
                margin: 0;
                font-size: 1.05rem;
                color: $color-text-primary;
            }

            .meta {
                color: $color-text-secondary;
                font-weight: 400;
            }

            .chip {
                margin-left: auto;
                padding: .25rem .6rem;
                border-radius: 999px;
                font-size: .85rem;
                font-weight: 600;

                &.is-up {
                    background: rgba(22, 163, 74, .12);
                    color: $color-success;
                }

                &.is-degraded {
                    background: rgba(245, 158, 11, .14);
                    color: $color-warning;
                }

                &.is-down {
                    background: rgba(220, 38, 38, .14);
                    color: $color-error;
                }

                &.is-maint {
                    background: rgba(14, 165, 233, .12);
                    color: $color-info;
                }
            }
        }

        .kpis {
            display: grid;
            gap: .5rem;
            grid-template-columns: repeat(2, minmax(0, 1fr));

            @media (min-width: 520px) {
                grid-template-columns: repeat(3, minmax(0, 1fr));
            }

            .kpi {
                display: grid;
                gap: .15rem;
                padding: .5rem;
                border: 1px solid $color-gray-light;
                border-radius: 10px;

                .kpi__label {
                    color: $color-text-secondary;
                    font-size: .85rem;
                }

                .kpi__value {
                    color: $color-text-primary;
                    font-weight: 600;
                }
            }
        }

        .spark {
            display: flex;
            align-items: center;
            gap: .5rem;

            .spark__line {
                fill: none;
                stroke: $color-brand-primary;
                stroke-width: 2;
            }

            .spark__caption {
                color: $color-text-secondary;
                font-size: .85rem;
            }
        }

        .card__foot {
            display: flex;
            gap: .75rem;
            flex-wrap: wrap;
            align-items: center;

            .muted {
                color: $color-text-secondary;
                font-size: .9rem;
            }
        }
    }
}

/* Ghost-Button (klein) – nutzt deine Farbvariablen */
.btn.btn--ghost {
    background: $color-white;
    color: $color-text-primary;
    border: 1px solid $color-gray-light;

    &:hover {
        background: $color-background-main;
    }

    &:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
    }
}