/*
 * phone.css — Ops UI Library: PhoneField
 * Uses CSS variables from index.html for automatic dark/light theme support
 */

/* ── Wrapper ──────────────────────────────────────────────── */

.pf-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    overflow: hidden;
    transition: border-color 0.15s;
}

.pf-wrap:focus-within {
    border-color: var(--accent);
}

.pf-wrap--error {
    border-color: #ef4444;
}

/* ── Country selector ─────────────────────────────────────── */

.pf-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px 0 10px;
    cursor: pointer;
    border-right: 1px solid var(--border);
    background: transparent;
    transition: background 0.12s;
    flex-shrink: 0;
    outline: none;
    user-select: none;
    min-width: 80px;
}

.pf-selector:hover,
.pf-selector:focus {
    background: var(--sidebar-active);
}

.pf-flag {
    font-size: 16px;
    line-height: 1;
}

.pf-dial {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-1);
}

.pf-arrow {
    font-size: 10px;
    color: var(--text-2);
    margin-left: 2px;
}

/* ── Input ────────────────────────────────────────────────── */

.pf-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-1);
    font-size: 14px;
    padding: 8px 10px;
    font-family: inherit;
    min-width: 0;
}

.pf-input::placeholder {
    color: var(--text-2);
    opacity: 0.6;
}

/* ── Dropdown ─────────────────────────────────────────────── */

.pf-dropdown {
    position: absolute;
    z-index: 9100;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 280px;
}

.pf-search {
    flex-shrink: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text-1);
    font-size: 13px;
    padding: 9px 12px;
    outline: none;
    font-family: inherit;
}

.pf-search::placeholder {
    color: var(--text-2);
    opacity: 0.7;
}

.pf-list {
    overflow-y: auto;
    flex: 1;
}

.pf-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.pf-item:hover {
    background: var(--sidebar-active);
}

.pf-item--active {
    background: var(--tab-active-bg);
}

.pf-item-flag {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.pf-item-name {
    font-size: 13px;
    color: var(--text-1);
    flex: 1;
}

.pf-item-dial {
    font-size: 12px;
    color: var(--text-2);
    flex-shrink: 0;
}

.pf-sep {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.pf-no-results {
    padding: 12px;
    font-size: 13px;
    color: var(--text-2);
    text-align: center;
}
