/* ── UniFi Door Status Widget ─────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:wght@400;500&display=swap');

.unifi-ds-widget {
    --ds-open:    #22c55e;
    --ds-closed:  #ef4444;
    --ds-unknown: #94a3b8;
    --ds-bg:      #0f172a;
    --ds-surface: #1e293b;
    --ds-border:  #334155;
    --ds-text:    #f1f5f9;
    --ds-muted:   #94a3b8;
    --ds-radius:  16px;
    --ds-color:   var(--ds-unknown);

    font-family: 'DM Sans', sans-serif;
    background:  var(--ds-bg);
    border:      1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    padding:     28px 32px;
    max-width:   360px;
    color:       var(--ds-text);
    position:    relative;
    overflow:    hidden;
    transition:  border-color 0.4s ease;
}

/* Ambient glow behind the status dot */
.unifi-ds-widget::before {
    content: '';
    position: absolute;
    top: -60px; left: -60px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, var(--ds-color) 0%, transparent 70%);
    opacity: 0.12;
    transition: background 0.5s ease;
    pointer-events: none;
}

/* ── States ── */
.unifi-ds-widget[data-status="open"]   { --ds-color: var(--ds-open);   border-color: rgba(34,197,94,.35); }
.unifi-ds-widget[data-status="closed"] { --ds-color: var(--ds-closed); border-color: rgba(239,68,68,.35); }
.unifi-ds-widget[data-status="unknown"]{ --ds-color: var(--ds-unknown);}

/* ── Label row ── */
.unifi-ds-label {
    font-family: 'Syne', sans-serif;
    font-size:   11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ds-muted);
    margin-bottom: 18px;
}

/* ── Main status row ── */
.unifi-ds-status {
    display:     flex;
    align-items: center;
    gap:         14px;
}

.unifi-ds-dot {
    width:  18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ds-color);
    flex-shrink: 0;
    box-shadow: 0 0 0 0 var(--ds-color);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

.unifi-ds-widget[data-status="open"] .unifi-ds-dot {
    animation: ds-pulse 2s infinite;
}

@keyframes ds-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(34,197,94,.7); }
    70%  { box-shadow: 0 0 0 10px rgba(34,197,94,0);  }
    100% { box-shadow: 0 0 0 0   rgba(34,197,94,0);  }
}

.unifi-ds-state-text {
    font-family: 'Syne', sans-serif;
    font-size:   32px;
    font-weight: 800;
    line-height: 1;
    color:       var(--ds-color);
    transition:  color 0.4s ease;
}

/* ── Meta row ── */
.unifi-ds-meta {
    margin-top: 14px;
    display:    flex;
    gap:        16px;
    flex-wrap:  wrap;
}

.unifi-ds-meta-item {
    font-size:   12px;
    color:       var(--ds-muted);
    display:     flex;
    align-items: center;
    gap:         5px;
}

.unifi-ds-meta-item svg {
    opacity: 0.6;
}

/* ── Loading ── */
.unifi-ds-loading {
    color:     var(--ds-muted);
    font-size: 13px;
    animation: ds-fade 1.2s ease infinite alternate;
}

@keyframes ds-fade {
    from { opacity: .4; }
    to   { opacity: 1;  }
}

/* ── Compact mode ── */
.unifi-ds--compact {
    padding:   14px 18px;
    max-width: 220px;
}

.unifi-ds--compact .unifi-ds-state-text { font-size: 20px; }
.unifi-ds--compact .unifi-ds-dot        { width: 12px; height: 12px; }
.unifi-ds--compact .unifi-ds-meta       { margin-top: 8px; }
