﻿/* Device Simulation  */

.dsim-layout {
    display: flex;
    height: calc(100vh - var(--nav-h) - var(--footer-h));
    overflow: hidden;
}

/* Sidebar*/
.dsim-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--c-bg-2);
    border-right: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--c-border) transparent;
}

.dsim-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 8px;
}

.dsim-sidebar__title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--c-text-dim);
}

.dsim-sidebar__count {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 1px 7px;
    background: var(--c-bg-3);
    border: 1px solid var(--c-border);
    border-radius: 20px;
    color: var(--c-text-muted);
}

.dsim-sidebar__group-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--c-text-dim);
    padding: 12px 16px 4px;
}

.dsim-sidebar__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: background 0.12s;
}

    .dsim-sidebar__item:hover {
        background: var(--c-bg-3);
    }

    .dsim-sidebar__item.is-active {
        background: var(--c-blue-bg);
        border-left-color: var(--c-accent);
    }

        .dsim-sidebar__item.is-active .dsim-sidebar__item-name {
            color: var(--c-text);
        }

.dsim-sidebar__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

    .dsim-sidebar__dot.is-online {
        background: var(--c-green);
    }

    .dsim-sidebar__dot.is-offline {
        background: var(--c-red);
    }

.dsim-sidebar__item-name {
    font-size: 13px;
    color: var(--c-text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dsim-sidebar__chip {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--c-bg-3);
    border: 1px solid var(--c-border);
    color: var(--c-text-dim);
    flex-shrink: 0;
}

.chip--elev {
    color: var(--c-blue);
    border-color: #bfdbfe;
    background: var(--c-blue-bg);
}

.chip--recv {
    color: var(--c-amber);
    border-color: #fde68a;
    background: var(--c-amber-bg);
}

.dsim-sidebar__sim-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--c-accent);
    flex-shrink: 0;
    animation: pulse-accent 2s ease-in-out infinite;
}

@keyframes pulse-accent {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.25;
    }
}

/* Detail */
.dsim-detail {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--c-bg);
    scrollbar-width: thin;
    scrollbar-color: var(--c-border) transparent;
}

.dsim-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
    max-width: 500px;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 24px;
    border: solid 2px;
}

    .dsim-panel.is-visible {
        display: flex;
        animation: fadeSlideIn 0.18s ease;
    }

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(6px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Panel header */
.dsim-panel__header {
    background: var(--c-bg-2);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dsim-panel__title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dsim-panel__name {
    font-size: 20px;
    font-weight: 600;
    color: var(--c-text);
    letter-spacing: -0.02em;
}

.dsim-panel__type-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 4px;
    background: var(--c-bg-3);
    border: 1px solid var(--c-border-md);
    color: var(--c-text-muted);
}

.dsim-panel__pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.dsim-panel__checkin {
    font-size: 11px;
    color: var(--c-text-dim);
}

.dsim-panel__checkin-time {
    font-family: var(--font-mono);
}

/* Action groups */
.dsim-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dsim-actions__group {
    background: var(--c-bg-2);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.dsim-actions__group-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--c-text-dim);
    padding: 10px 14px 6px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-bg-3);
}

.dsim-actions__row {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
}

.dsim-actions__row--wrap {
    flex-wrap: wrap;
}

.dsim-actions__row .act {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

/* Simulation toggle */
.dsim-panel__footer {
    padding-top: 4px;
    border-top: 1px solid var(--c-border);
}

.act-sim {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--c-border-md);
    cursor: pointer;
    transition: background 0.12s;
    width: 100%;
    justify-content: center;
}

.act-sim__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.act-sim--enable {
    background: var(--c-ok-bg);
    border-color: var(--c-ok-border);
    color: var(--c-ok);
}

    .act-sim--enable .act-sim__dot {
        background: var(--c-green);
        animation: pulse-accent 2s ease-in-out infinite;
    }

    .act-sim--enable:hover {
        background: #dcfce7;
    }

.act-sim--disable {
    background: var(--c-red-bg);
    border-color: #fecaca;
    color: var(--c-red);
}

    .act-sim--disable .act-sim__dot {
        background: var(--c-red);
    }

    .act-sim--disable:hover {
        background: #fee2e2;
    }

/* Empty state */
.dsim-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    color: var(--c-text-dim);
}

.dsim-empty__icon {
    font-size: 32px;
}

.dsim-empty__text {
    font-size: 15px;
    font-weight: 500;
    color: var(--c-text-muted);
}

.dsim-empty__sub {
    font-size: 13px;
}

.chip--plug {
    color: #d97706;
    border-color: #fde68a;
    background: #fffbeb;
}

.chip--ble {
    color: #7c3aed;
    border-color: #ddd6fe;
    background: #f5f3ff;
}