/* NebPool extensions on top of cineprime.css
   cineprime.css supplies .card / .form-input / .btn-primary /
   .sidebar-link / .tab-link / .toggle-switch etc.
   This file:
     1) overrides cineprime.css defaults where cineprime's PAGES differ from
        its STORE (dashboard uses #141414 cards, store uses #161616)
     2) adds pieces cineprime doesn't ship: filter chips, bulk bar,
        DNS drag list, command palette, dark SweetAlert2 + DataTables. */

/* ── Card + table match cineprime's PANEL PAGES exactly ──
   cineprime.css's .card { background:#161616 } is what its store card uses.
   Its panel pages (settings.php, services.php, dashboard.php) instead put
   `style="background:#141414;border:1px solid #1e1e1e;"` inline on every
   card. Force that everywhere so our cards match panel pages, not store. */
.card,
.stat-card {
    background: #141414 !important;
    border: 1px solid #1e1e1e !important;
    border-radius: 0.75rem !important;
}
.stat-card { padding: 1.25rem 1.5rem !important; }
.stat-card:hover { border-color: rgba(243,156,18,0.4) !important; }

/* Cineprime's thead is dark #111; enforce it in case DataTables overrides. */
table thead,
table thead tr,
table thead tr th {
    background: #111 !important;
}

/* ── Command palette (⌘K) ── */

/* Command palette (⌘K) */
.palette-overlay {
    position: fixed; inset: 0; z-index: 1080;
    background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
    display: none; justify-content: center; align-items: flex-start;
    padding-top: 12vh;
}
.palette-overlay.open { display: flex; }
.palette-panel {
    width: min(640px, 92vw);
    background: #161616; border: 1px solid #1e1e1e;
    border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.55); overflow: hidden;
}
.palette-input {
    width: 100%; padding: 14px 18px;
    background: transparent; border: 0; outline: 0;
    color: #fff; font-size: 15px;
    border-bottom: 1px solid #1e1e1e;
}
.palette-input::placeholder { color: #666; }
.palette-list  { max-height: 55vh; overflow-y: auto; padding: 6px; }
.palette-item {
    display: grid; grid-template-columns: 28px 1fr auto;
    align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px;
    color: #ccc; cursor: pointer; text-decoration: none;
}
.palette-item:hover, .palette-item.active { background: rgba(243,156,18,0.08); color: #f9b84a; }
.palette-item .icon  { color: #f39c12; font-size: 17px; text-align: center; line-height: 1; }
.palette-item .title { font-weight: 600; font-size: 13.5px; color: #fff; }
.palette-item .sub   { font-size: 11.5px; color: #777; margin-top: 1px; }
.palette-empty       { padding: 28px; text-align: center; color: #777; font-size: 13.5px; }
.palette-group-label { padding: 10px 12px 4px; color: #777; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

.palette-hint {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 10px 5px 12px; border-radius: 999px;
    background: rgba(255,255,255,.04); border: 1px solid #1e1e1e;
    color: #999; font-size: 12.5px; cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}
.palette-hint:hover { background: rgba(255,255,255,.08); color: #fff; border-color: #2a2a2a; }
.palette-hint kbd   { background: transparent; border: 1px solid #2a2a2a; color: inherit; font-family: ui-monospace, monospace; font-size: 11px; padding: 1px 6px; border-radius: 4px; }

/* Filter chips (Requests page) */
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid #1e1e1e; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.03);
    color: #999;
    border: 1px solid #1e1e1e;
    font-size: 12.5px; font-weight: 500;
    cursor: pointer;
    transition: all .12s;
}
.chip:hover        { background: rgba(255,255,255,.06); color: #ccc; }
.chip.active       { background: rgba(243,156,18,0.12); color: #f9b84a; border-color: rgba(243,156,18,0.35); }
.chip .count       { color: inherit; opacity: .7; font-size: 11px; margin-left: 2px; }

.bulk-bar {
    display: none; align-items: center; gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid #1e1e1e;
    background: rgba(243,156,18,0.08);
    font-size: 13px;
    color: #fff;
}
.bulk-bar.open   { display: flex; }
.bulk-bar strong { color: #f9b84a; }
.bulk-bar .spacer { flex: 1; }

/* Server list (dns.php) row grid — desktop layout defined here so mobile
   can override without fighting inline styles. */
.dns-grid {
    display: grid;
    grid-template-columns: 24px 1fr 220px 80px 90px;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
}
.dns-thead {
    background: #0f0f0f;
    border-bottom: 1px solid #1e1e1e;
    padding: 12px 20px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: .03em;
    font-size: 11px;
    color: #777;
}
@media (max-width: 720px) {
    .dns-grid { grid-template-columns: 24px 1fr auto; gap: 10px; }
    /* URL cell wraps under the name column at mobile widths */
    .dns-grid > .dns-url-cell { grid-column: 2 / -1; margin-top: 4px; }
    /* Hide the URL/live labels in the thead row; the row itself shows the URL */
    .dns-thead .dns-url-head,
    .dns-thead .dns-live-head { display: none; }
}

/* DNS server list (drag reorder) */
.dns-list { list-style: none; margin: 0; padding: 0; }
.dns-list > li      { border-bottom: 1px solid #1e1e1e; }
.dns-list > li:last-child { border-bottom: 0; }
.dns-row {
    display: grid;
    grid-template-columns: 28px 1fr auto auto;
    align-items: center; gap: 14px;
    padding: 14px 20px;
    transition: background .1s ease;
}
.dns-row:hover      { background: rgba(255,255,255,.02); }
.dns-handle         { cursor: grab; color: #444; font-size: 18px; text-align: center; user-select: none; line-height: 1; }
.dns-handle:active  { cursor: grabbing; }
.dns-name           { font-weight: 600; font-size: 14px; color: #fff; }
.dns-url            { color: #f9b84a; font-family: ui-monospace, monospace; font-size: 12.5px; word-break: break-all; margin-top: 2px; }
.dns-note           { color: #777; font-size: 12px; margin-top: 2px; }
.dns-actions        { display: flex; gap: 6px; }
.dns-ghost          { opacity: .55; background: rgba(243,156,18,0.08); }

/* Icon-only action buttons (edit/delete inline) */
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 6px;
    background: #1e1e1e; border: 1px solid #2a2a2a; color: #aaa;
    font-size: 14px; transition: all .15s; cursor: pointer;
}
.btn-icon:hover        { background: #2a2a2a; color: #f9b84a; border-color: #f39c12; }
.btn-icon.btn-danger   { color: #f87171; }
.btn-icon.btn-danger:hover { background: rgba(239,68,68,0.1); border-color: #dc2626; color: #f87171; }

/* Toggle switch (peer-based, no wrapper class needed) */
.np-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.np-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.np-switch .slider {
    position: absolute; inset: 0;
    background: #333; border-radius: 22px; cursor: pointer;
    transition: background .2s;
}
.np-switch .slider::before {
    content: ''; position: absolute;
    height: 16px; width: 16px; left: 3px; bottom: 3px;
    background: #aaa; border-radius: 50%;
    transition: transform .2s, background .2s;
}
.np-switch input:checked + .slider { background: #f39c12; }
.np-switch input:checked + .slider::before { transform: translateX(18px); background: #fff; }

/* Modal (Tailwind-native, Alpine-driven) */
.np-modal-backdrop {
    position: fixed; inset: 0; z-index: 1050;
    background: rgba(0,0,0,.65); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.np-modal {
    background: #161616; border: 1px solid #1e1e1e;
    border-radius: 12px; width: 100%; max-width: 32rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.55);
    display: flex; flex-direction: column;
    max-height: calc(100vh - 2rem);
}
.np-modal-head {
    padding: 16px 20px; border-bottom: 1px solid #1e1e1e;
    display: flex; align-items: center; justify-content: space-between;
}
.np-modal-head h3 { font-size: 16px; font-weight: 700; color: #fff; margin: 0; }
.np-modal-close {
    background: transparent; border: 0; color: #666;
    font-size: 20px; line-height: 1; cursor: pointer; padding: 4px;
}
.np-modal-close:hover { color: #fff; }
.np-modal-body { padding: 20px; overflow-y: auto; }
.np-modal-foot {
    padding: 12px 20px; border-top: 1px solid #1e1e1e;
    display: flex; gap: 8px; justify-content: flex-end;
}
.np-modal-foot .me-auto { margin-right: auto; }

/* Sidebar mini header stat count */
.side-count { color: #666; font-size: 11px; margin-left: auto; padding: 1px 7px; background: rgba(255,255,255,0.04); border-radius: 4px; }
.side-count.hot { color: #f9b84a; background: rgba(243,156,18,0.12); }

/* SweetAlert2 dark */
.swal2-popup            { background: #161616 !important; color: #e2e8f0 !important; border: 1px solid #1e1e1e; }
.swal2-title            { color: #fff !important; }
.swal2-html-container   { color: #ccc !important; }
.swal2-styled.swal2-confirm { background: #f39c12 !important; box-shadow: none !important; }
.swal2-styled.swal2-confirm:focus { box-shadow: 0 0 0 3px rgba(243,156,18,0.3) !important; }
.swal2-styled.swal2-cancel  { background: #1e1e1e !important; color: #ccc !important; border: 1px solid #2a2a2a !important; }
.swal2-styled.swal2-cancel:hover { background: #2a2a2a !important; }
.swal2-icon.swal2-warning   { border-color: #f39c12 !important; color: #f39c12 !important; }
.swal2-icon.swal2-success   { border-color: #22c55e !important; color: #22c55e !important; }
.swal2-icon.swal2-error     { border-color: #dc2626 !important; color: #dc2626 !important; }
.swal2-icon.swal2-question  { border-color: #3b82f6 !important; color: #3b82f6 !important; }

/* DataTables dark skin */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate    { color: #777; padding: 12px 20px; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: #111 !important; border: 1px solid #1e1e1e !important;
    color: #fff !important; border-radius: 6px !important;
    padding: 6px 12px !important; margin-left: 6px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: transparent !important; border: 1px solid #1e1e1e !important;
    color: #999 !important; border-radius: 6px !important;
    margin: 0 2px; padding: 4px 12px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(243,156,18,0.1) !important; color: #f9b84a !important;
    border-color: #f39c12 !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #f39c12 !important; color: #fff !important;
    border-color: #f39c12 !important;
}

/* Requests state badges */
.state-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
    border: 1px solid transparent;
}
.state-badge.state-queued      { background: rgba(243,156,18,0.15); color: #f9b84a; border-color: rgba(243,156,18,0.3); }
.state-badge.state-added       { background: rgba(59,130,246,0.15); color: #60a5fa; border-color: rgba(59,130,246,0.3); }
.state-badge.state-downloading { background: rgba(14,165,233,0.15); color: #38bdf8; border-color: rgba(14,165,233,0.3); }
.state-badge.state-downloaded  { background: rgba(34,197,94,0.15);  color: #4ade80; border-color: rgba(34,197,94,0.3); }
.state-badge.state-rejected    { background: rgba(107,114,128,0.15);color: #9ca3af; border-color: rgba(107,114,128,0.3); }
.state-badge.state-error       { background: rgba(239,68,68,0.15);  color: #f87171; border-color: rgba(239,68,68,0.3); }
.state-badge.state-kind        { background: #1e1e1e; color: #ccc; border-color: #2a2a2a; text-transform: uppercase; }

/* Requests row selected highlight */
tr.selected > td { background: rgba(243,156,18,0.08) !important; }

/* Utility: font-mono override for inputs */
.font-mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
