/* public/js/nice-select.js companion styles — themed custom dropdown */

.ns {
    position: relative;
    display: inline-block;
    width: 100%;
    font-size: 0.95rem;
    text-align: left;
}

.ns-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 40px 11px 14px;
    border-radius: 10px;
    background: var(--input-bg, #0d1117);
    border: 1px solid var(--glass-border-color, rgba(0, 217, 255, 0.22));
    color: var(--text-primary, #e8e8f0);
    font: inherit;
    line-height: 1.3;
    cursor: pointer;
    text-align: left;
    position: relative;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.ns-trigger:hover { border-color: var(--accent-primary, #00D9FF); }
.ns-trigger:focus-visible,
.ns-open .ns-trigger {
    outline: none;
    border-color: var(--accent-primary, #00D9FF);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.14);
}

.ns-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ns-caret {
    position: absolute;
    right: 14px;
    top: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--accent-primary, #00D9FF);
    border-bottom: 2px solid var(--accent-primary, #00D9FF);
    transform: translateY(-70%) rotate(45deg);
    transition: transform .18s;
    pointer-events: none;
}
.ns-open .ns-caret { transform: translateY(-30%) rotate(-135deg); }

.ns-is-disabled .ns-trigger {
    opacity: .5;
    cursor: not-allowed;
}

/* ── Panel (left/width/top|bottom/max-height set inline by nice-select.js) ── */
.ns-panel {
    position: fixed;   /* never in normal flow — JS sets the coordinates */
    top: -9999px;
    left: -9999px;
    z-index: 3000;
    overflow-y: auto;
    padding: 4px;
    border-radius: 9px;
    background: var(--dropdown-bg, #131a24);
    border: 1px solid var(--accent-primary, rgba(0, 217, 255, 0.35));
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.55);
    display: none;
    opacity: 0;
    transition: opacity .1s ease;
}
.ns-open .ns-panel {
    display: block;
    opacity: 1;
}

.ns-opt {
    padding: 6px 11px;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--text-secondary, #cbd5e1);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .1s, color .1s;
}
.ns-opt:hover,
.ns-opt.ns-active {
    background: rgba(0, 217, 255, 0.12);
    color: var(--text-primary, #fff);
}
.ns-opt.ns-selected {
    color: var(--accent-primary, #00D9FF);
    font-weight: 600;
}
.ns-opt.ns-selected::after {
    content: '✓';
    float: right;
    opacity: .9;
}
.ns-opt.ns-disabled {
    opacity: .4;
    cursor: not-allowed;
}

.ns-group {
    padding: 7px 11px 3px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted, #8a94a3);
}

.ns-panel::-webkit-scrollbar { width: 8px; }
.ns-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 217, 255, 0.3);
    border-radius: 4px;
}

/* Light theme */
:root[data-theme="light"] .ns-trigger,
html.light .ns-trigger {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
    color: #1a2230;
}
:root[data-theme="light"] .ns-panel,
html.light .ns-panel {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}
:root[data-theme="light"] .ns-opt,
html.light .ns-opt { color: #384252; }
:root[data-theme="light"] .ns-opt:hover,
:root[data-theme="light"] .ns-opt.ns-active,
html.light .ns-opt:hover,
html.light .ns-opt.ns-active {
    background: rgba(0, 150, 200, 0.1);
    color: #0a0e14;
}

@media (max-width: 640px) {
    .ns-trigger { padding-top: 12px; padding-bottom: 12px; }
    .ns-opt { padding: 9px 11px; }
}
