/* ============================================
   Zero Day BattleMetrics — Dashboard
   Mobile-first responsive layout
   ============================================ */

#zdbm-dashboard {
    font-family: 'Courier New', Courier, monospace;
    color: #c8c8c8;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 8px;
}

#zdbm-dashboard * {
    box-sizing: border-box;
}

/* ── Hero Stats Row ─────────────────────────── */

.zdbm-dash-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.zdbm-dash-stat {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px 8px;
    text-align: center;
    min-width: 0;
    overflow: hidden;
}

.zdbm-dash-stat__label {
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 4px;
}

.zdbm-dash-stat__value {
    font-size: 1em;
    font-weight: bold;
    color: #e0e0e0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Card Grid ──────────────────────────────── */

.zdbm-dash-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.zdbm-dash-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px;
    overflow: hidden;
    min-width: 0;
}

.zdbm-dash-card--wide {
    grid-column: 1 / -1;
}

.zdbm-dash-card__title {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #2a2a2a;
}

.zdbm-dash-card__chart {
    position: relative;
    height: 180px;
    width: 100%;
}

.zdbm-dash-card__body {
    font-size: 0.8em;
    line-height: 1.6;
}

/* ── Sessions Feed ──────────────────────────── */

.zdbm-dash-sessions {
    max-height: 280px;
    overflow-y: auto;
}

.zdbm-dash-session {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    gap: 6px;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #222;
}

.zdbm-dash-session:last-child {
    border-bottom: none;
}

.zdbm-dash-session__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.zdbm-dash-session__name {
    color: #c8c8c8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.zdbm-dash-session__time {
    color: #666;
    font-size: 0.8em;
    white-space: nowrap;
}

.zdbm-dash-session__dur {
    color: #888;
    font-size: 0.8em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
    display: none;
}

/* ── Online Player Tags ─────────────────────── */

.zdbm-dash-online-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.zdbm-dash-online-tag {
    background: #252525;
    border: 1px solid #3a3a3a;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 0.8em;
    color: #c8c8c8;
}

.zdbm-dash-online-tag::before {
    content: '● ';
    color: #7eef6d;
    font-size: 0.65em;
}

/* ── Outage Log ─────────────────────────────── */

.zdbm-dash-outages {
    max-height: 200px;
    overflow-y: auto;
}

.zdbm-dash-outage {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
    border-bottom: 1px solid #222;
    font-size: 0.8em;
}

.zdbm-dash-outage:last-child {
    border-bottom: none;
}

.zdbm-dash-outage__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef6d6d;
    flex-shrink: 0;
}

/* ── Error State ────────────────────────────── */

.zdbm-dash-error {
    background: #2a1515;
    border: 1px solid #5a2727;
    border-radius: 6px;
    padding: 16px;
    color: #ef6d6d;
    text-align: center;
    font-style: italic;
    font-size: 0.9em;
}

/* ── Scrollbar styling ──────────────────────── */

.zdbm-dash-sessions::-webkit-scrollbar,
.zdbm-dash-outages::-webkit-scrollbar {
    width: 4px;
}

.zdbm-dash-sessions::-webkit-scrollbar-track,
.zdbm-dash-outages::-webkit-scrollbar-track {
    background: transparent;
}

.zdbm-dash-sessions::-webkit-scrollbar-thumb,
.zdbm-dash-outages::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 2px;
}

/* ── Tablet (600px+) ────────────────────────── */

@media (min-width: 600px) {
    #zdbm-dashboard {
        padding: 0 12px;
    }

    .zdbm-dash-hero {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }

    .zdbm-dash-stat {
        padding: 14px 10px;
    }

    .zdbm-dash-stat__value {
        font-size: 1.15em;
    }

    .zdbm-dash-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 10px;
    }

    .zdbm-dash-card {
        padding: 14px;
    }

    .zdbm-dash-card__chart {
        height: 200px;
    }

    .zdbm-dash-session {
        grid-template-columns: 10px 1fr auto auto;
    }

    .zdbm-dash-session__dur {
        display: block;
    }
}

/* ── Desktop (900px+) ───────────────────────── */

@media (min-width: 900px) {
    #zdbm-dashboard {
        padding: 0 16px;
    }

    .zdbm-dash-hero {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }

    .zdbm-dash-stat {
        padding: 16px;
    }

    .zdbm-dash-stat__label {
        font-size: 0.7em;
    }

    .zdbm-dash-stat__value {
        font-size: 1.3em;
    }

    .zdbm-dash-row {
        gap: 12px;
        margin-bottom: 12px;
    }

    .zdbm-dash-card {
        padding: 16px;
    }

    .zdbm-dash-card__title {
        font-size: 0.75em;
    }

    .zdbm-dash-card__chart {
        height: 220px;
    }

    .zdbm-dash-card__body {
        font-size: 0.85em;
    }

    .zdbm-dash-session {
        grid-template-columns: 12px 1fr auto auto;
        gap: 8px;
    }
}
