/**
 * frontend/css/dashboard.css
 * Core layout, filter bar, buttons, flatpickr NOW button.
 */

/* ── Root dashboard wrapper ──────────────────────────────────────────────── */
.plc-dash {
    max-width: 100%;
    font-family: sans-serif;
    background: #f5f5f5;
    padding: 16px;
    border-radius: 8px;
    box-sizing: border-box;
}

/* ── Layout: content wrap holds anchor sidebar + main ────────────────────── */
.plc-content-wrap {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.plc-main-content {
    flex: 1;
    min-width: 0; /* prevent flex blowout */
}

/* ── Filter bar — base (all positions) ──────────────────────────────────── */
.plc-filter-bar {
    background: #fff;
    padding: 16px 20px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.10);
    margin-bottom: 18px;
    box-sizing: border-box;
}

/* ── Filter bar — TOP sticky ─────────────────────────────────────────────── */
.plc-filter-bar.plc-filter-top.plc-sticky {
    position: sticky;
    top: 0; /* JS sets the correct value based on #wpadminbar presence */
    z-index: 200;
}

.plc-filter-bar.plc-filter-top.plc-sticky.plc-stuck {
    box-shadow: 0 3px 10px rgba(0,0,0,.18);
}

/* ── Filter bar — LEFT / RIGHT sidebar ───────────────────────────────────── */
.plc-filter-bar.plc-filter-left,
.plc-filter-bar.plc-filter-right {
    width: 240px;
    flex-shrink: 0;
    border-radius: 6px;
    margin-bottom: 0;
}

/* Sticky sidebar filter */
.plc-filter-bar.plc-filter-left.plc-sticky,
.plc-filter-bar.plc-filter-right.plc-sticky {
    position: sticky;
    top: 0; /* JS sets the correct value based on #wpadminbar presence */
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

/* Layout: filter LEFT */
.plc-dash--sidebar-filter.plc-dash--filter-left .plc-filter-bar { order: -1; }
/* Layout: filter RIGHT */
.plc-dash--sidebar-filter.plc-dash--filter-right .plc-filter-bar { order: 2; }

/* ── Filter controls ─────────────────────────────────────────────────────── */
.plc-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.plc-filters > div { flex: 1 1 180px; }

.plc-filters label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.plc-filters input,
.plc-filters select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 13px;
}

/* Sidebar filter: stack vertically */
.plc-filter-left .plc-filters,
.plc-filter-right .plc-filters { flex-direction: column; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.plc-btn {
    padding: 9px 18px;
    background: #2271b1;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}
.plc-btn:hover { background: #135e96; }

/* ── Flatpickr NOW button ────────────────────────────────────────────────── */
.flatpickr-now-button {
    background: #2271b1;
    color: #fff;
    padding: 5px;
    text-align: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 11px;
    border-radius: 0 0 4px 4px;
}

/* ── Component frames ────────────────────────────────────────────────────── */
.plc-component-frame { margin-bottom: 24px; }

.plc-frame-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #e0e0e0;
}

/* ── Mobile filter close button (hidden on desktop) ──────────────────────── */
.plc-filter-close-btn {
    display: none;
}

/* ── Mobile filter FAB toggle (hidden on desktop) ────────────────────────── */
.plc-filter-toggle-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 310;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.plc-filter-toggle-btn:hover { background: #135e96; }

/* ── Timestamp Table component ───────────────────────────────────────────── */
.plc-ts-table-wrap { margin-top: 4px; }
.plc-ts-table .plc-ts-value {
    font-family: monospace;
    font-weight: 600;
    color: #1565c0;
    background: #e3f2fd;
    border-radius: 3px;
    padding: 2px 6px;
    white-space: nowrap;
}

/* ── Total Cards optional section heading ────────────────────────────────── */
.plc-section-heading {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px;
    padding: 0;
}
