/**
 * GeminiBook Admin — Custom Select Styles
 * File: /admin/assets/css/gb-custom-select.css
 *
 * Styles the gb-cs custom dropdown widget to match the Columns dropdown design:
 *   • Same trigger button shape as columnsBtn
 *   • Same panel as geminibook-adminpanel-dropdown-menu
 *   • Option rows styled like the column checkbox rows
 *   • Full dark-mode parity
 */

/* ============================================================
   Namespace: gb-cs (GeminiBook Custom Select)
   ============================================================ */

/* Hide the native select element — it stays in DOM for JS */
.gb-cs__native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Hide any orphaned inline SVG chevron that was a sibling of the native select
   (e.g. the manual arrows in prompts.html, cache-settings.html etc.)
   The custom trigger has its own built-in chevron. */
.gb-cs__wrap + svg.pointer-events-none,
.relative > .gb-cs__wrap + svg.pointer-events-none {
    display: none !important;
}

/* ── Wrap ──────────────────────────────────────────────────── */
.gb-cs__wrap {
    position: relative;
    display: inline-block;
    min-width: 0;
}

.gb-cs__wrap.w-full,
.gb-cs__wrap.flex-1 {
    display: block;
}

/* ── Trigger Button ─────────────────────────────────────────── */
.gb-cs__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;

    /* Surface — matches columnsBtn */
    background-color: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.875rem;

    /* Typography */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
    letter-spacing: 0.01em;
    line-height: 1.4;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;

    /* Spacing */
    padding: 0.55rem 0.75rem 0.55rem 0.9rem;

    /* Depth */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 0 transparent;

    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease,
        color 0.15s ease;
}

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

.gb-cs__trigger:hover {
    border-color: #a5b4fc;
    background-color: #fafbff;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.08);
}

.gb-cs__trigger:focus-visible {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3.5px rgba(99, 102, 241, 0.18), 0 1px 4px rgba(99, 102, 241, 0.12);
}

.gb-cs__wrap--open .gb-cs__trigger,
.gb-cs__wrap.gb-cs--open .gb-cs__trigger {
    border-color: #6366f1;
    background-color: #fafbff;
    box-shadow: 0 0 0 3.5px rgba(99, 102, 241, 0.15), 0 1px 4px rgba(99, 102, 241, 0.1);
    color: #1e293b;
}

/* Disabled */
.gb-cs__wrap--disabled .gb-cs__trigger,
.gb-cs__trigger:disabled {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.72;
    box-shadow: none;
}

/* ── Chevron Icon ─────────────────────────────────────────── */
.gb-cs__chevron {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    color: #6366f1;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease;
}

.gb-cs__wrap--open .gb-cs__chevron,
.gb-cs__wrap.gb-cs--open .gb-cs__chevron {
    transform: rotate(180deg);
    color: #4f46e5;
}

.gb-cs__wrap--disabled .gb-cs__chevron {
    color: #94a3b8;
}

/* ── Dropdown Panel ──────────────────────────────────────── */
.gb-cs__panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 200;
    min-width: 100%;
    max-height: 260px;
    overflow-y: auto;

    /* Surface — matches geminibook-adminpanel-dropdown-menu */
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0.375rem;
    box-shadow:
        0 10px 25px -5px rgba(15, 23, 42, 0.12),
        0 4px 10px -3px rgba(15, 23, 42, 0.06),
        0 0 0 1px rgba(226, 232, 240, 0.5);

    animation: gb-cs-panel-in 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes gb-cs-panel-in {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Open state */
.gb-cs__wrap--open .gb-cs__panel,
.gb-cs__wrap.gb-cs--open .gb-cs__panel {
    display: block;
}

/* Flip-up variant */
.gb-cs__panel--up {
    top: auto;
    bottom: calc(100% + 6px);
    animation: gb-cs-panel-in-up 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes gb-cs-panel-in-up {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Custom scrollbar inside panel */
.gb-cs__panel::-webkit-scrollbar {
    width: 4px;
}
.gb-cs__panel::-webkit-scrollbar-track {
    background: transparent;
}
.gb-cs__panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.gb-cs__panel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Option Items ─────────────────────────────────────────── */
.gb-cs__option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: none;
    border-radius: 0.625rem;
    background: transparent;

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
    letter-spacing: 0.005em;
    text-align: left;
    white-space: nowrap;

    cursor: pointer;
    transition:
        background-color 0.12s ease,
        color 0.12s ease;
}

.gb-cs__option:hover,
.gb-cs__option:focus-visible {
    background-color: #f1f5f9;
    color: #1e293b;
    outline: none;
}

.gb-cs__option--selected {
    background-color: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
}

.gb-cs__option--selected:hover,
.gb-cs__option--selected:focus-visible {
    background-color: #e0e7ff;
    color: #4338ca;
}

.gb-cs__option--disabled {
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ── Checkmark Icon ──────────────────────────────────────── */
.gb-cs__check {
    flex-shrink: 0;
    width: 0.875rem;
    height: 0.875rem;
    color: transparent;  /* hidden by default */
    transition: color 0.12s ease;
}

.gb-cs__option--selected .gb-cs__check {
    color: #4f46e5;
}


