/* ──────────────────────────────────────────────────────────────────────────
   Insira Select — Premium native select styling + custom dropdown panel
   ────────────────────────────────────────────────────────────────────────── */

/* Base styling for all native <select> elements */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Custom chevron via SVG background */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='20' viewBox='0 -960 960 960' width='20' fill='%2394a3b8'%3E%3Cpath d='M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;

    /* Visuals */
    background-color: #ffffff;
    border: 1px solid rgba(100, 116, 139, 0.15);
    border-radius: 0.75rem;       /* rounded-xl */
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;          /* text-sm */
    font-weight: 700;
    color: #334155;               /* slate-700 */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
    width: 100%;
    line-height: 1.5;
}

select:hover:not(:focus) {
    background-color: #f1f5f9;
}

select:focus {
    outline: none;
    border-color: rgba(0, 43, 78, 0.3);
    box-shadow: 0 0 0 3px rgba(0, 43, 78, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

select option {
    font-weight: 600;
    color: #334155;
    background-color: #ffffff;
}

/* Opt-out: add data-native-select to keep browser default */
select[data-native-select] {
    background-image: none;
    appearance: auto;
}

/* ── Custom dropdown trigger (replaces native select visually) ───────────── */
.is-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    height: 3rem;           /* h-12 */
    padding: 0 1rem;
    background-color: #ffffff;
    border: 1px solid rgba(100, 116, 139, 0.15);
    border-radius: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: #334155;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    overflow: hidden;
}

.is-trigger:hover {
    background-color: #f8fafc;
}

.is-trigger:focus {
    outline: none;
    border-color: rgba(0, 43, 78, 0.3);
    box-shadow: 0 0 0 3px rgba(0, 43, 78, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

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

.is-trigger__chevron {
    flex-shrink: 0;
    color: #94a3b8;
    font-size: 1.125rem;
    transition: transform 0.2s ease;
}

.is-trigger__chevron.is-open {
    transform: rotate(180deg);
}

/* ── Dropdown panel (appended to <body> so it escapes overflow:hidden) ───── */
.is-panel {
    position: fixed;    /* fixed to viewport — never clipped by overflow:hidden */
    z-index: 9999;
    background-color: #ffffff;
    border: 1px solid rgba(100, 116, 139, 0.12);
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(11, 28, 48, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 0.375rem 0;
    overflow-y: auto;
    max-height: 15rem;  /* max-h-60 */
    display: none;
    min-width: 160px;
}

.is-panel.is-visible {
    display: block;
}

/* Placeholder section label inside dropdown */
.is-panel__placeholder {
    padding: 0.375rem 1rem 0.25rem;
    font-size: 0.625rem;
    font-weight: 900;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Each option item */
.is-panel__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.1s, color 0.1s;
    position: relative;
    white-space: nowrap;
}

.is-panel__item:hover {
    background-color: rgba(0, 43, 78, 0.04);
    color: #002b4e;
}

.is-panel__item.is-selected {
    background-color: rgba(0, 43, 78, 0.05);
    color: #002b4e;
    font-weight: 700;
}

.is-panel__item__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.is-panel__item__check {
    flex-shrink: 0;
    color: #002b4e;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.1s;
}

.is-panel__item.is-selected .is-panel__item__check {
    opacity: 1;
}
