/**
 * frontend/css/sidebar.css
 * Anchor index sidebar + Shift Settings modal.
 */

/* ── Anchor index sidebar ────────────────────────────────────────────────── */
.plc-anchor-sidebar {
    width: 190px;
    flex-shrink: 0;
}

/* Sticky sidebar — top is updated dynamically by sticky.js to clear the filter bar */
.plc-anchor-sidebar.plc-sticky {
    position: sticky;
    top: 0; /* JS sets --plc-filter-h via CSS custom property */
    max-height: calc(100vh - var(--plc-filter-h, 60px) - 20px);
    overflow-y: auto;
    transition: top .2s;
}

.plc-anchor-inner {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 14px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* Left sidebar: before main content */
.plc-anchor-left { order: -1; }
/* Right sidebar: after main content */
.plc-anchor-right { order: 2; }

.plc-anchor-heading {
    margin: 0 0 10px;
    font-size: 10px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .8px;
}

.plc-anchor-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.plc-anchor-list li {
    margin-bottom: 2px;
}

.plc-anchor-link {
    display: block;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #444;
    text-decoration: none;
    transition: background .15s, color .15s;
    line-height: 1.3;
}

.plc-anchor-link:hover,
.plc-anchor-link.active {
    background: #e8f0fb;
    color: #2271b1;
    font-weight: 600;
}

/* ── Shift Configuration modal ───────────────────────────────────────────── */
.shift-config-section {
    background: #fff;
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 16px 20px;
    margin-bottom: 18px;
}

.shift-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
    align-items: flex-end;
}

.shift-row > div { flex: 1 1 160px; }

.shift-row label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.shift-row input {
    width: 80%;
    padding: 7px 9px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.del-btn {
    background: #f44336;
    color: #fff;
    border: none;
    padding: 7px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.del-btn:hover { background: #c62828; }

/* ── Modal overlay ───────────────────────────────────────────────────────── */
.plc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    box-sizing: border-box;
}

.plc-modal-overlay.active { display: flex; }

.plc-modal-window {
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,.30);
    animation: plcModalShow .2s ease;
}

@keyframes plcModalShow {
    from { opacity:0; transform: translateY(10px) scale(.98); }
    to   { opacity:1; transform: translateY(0)    scale(1);   }
}

.plc-modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.plc-modal-header h3 { margin: 0; font-size: 16px; }

.plc-modal-body { padding: 20px; }

.plc-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fafafa;
    position: sticky;
    bottom: 0;
}
