/*
 * Locations v4 — picker widget styles
 * Adapted from mockup-city-tags-v4.html for goldenwhale2 dark theme.
 * All classes prefixed .gw-loc-*
 *
 * Note: this site uses fluid root font-size (`html { font-size: 0.5208vw }`)
 * which gives 1rem ≈ 10px at 1920px. Mockup was designed at 16px base, so all
 * rem values below are scaled ×1.6 to preserve visual proportions.
 */

.gw-loc {
    --gw-loc-bg: #0a0a0a;
    --gw-loc-s1: #0a0a0a;
    --gw-loc-s2: #111;
    --gw-loc-s3: #161616;
    --gw-loc-field: #080808;
    --gw-loc-primary: #d79858;
    --gw-loc-pdim: rgba(215,152,88,0.12);
    --gw-loc-text: #f0f0f0;
    --gw-loc-t2: #777;
    --gw-loc-t3: #555;
    --gw-loc-div: rgba(255,255,255,0.08);
    --gw-loc-div2: rgba(255,255,255,0.14);
    --gw-loc-hover: rgba(255,255,255,0.06);
    --gw-loc-sel: rgba(215,152,88,0.10);
    --gw-loc-r: 2.24rem;
    --gw-loc-rs: 1.12rem;
    font-family: inherit;
    color: var(--gw-loc-text);
    box-sizing: border-box;
    width: 100%;
    max-width: 460px;
}
.gw-loc *,
.gw-loc *::before,
.gw-loc *::after { box-sizing: border-box; }

/* ===== Country pill ===== */
.gw-loc-cpill-wrap {
    position: relative;
    display: inline-flex;
    margin-bottom: 1.12rem;
}
.gw-loc-cpill {
    display: inline-flex;
    align-items: center;
    gap: 0.64rem;
    padding: 0.64rem 1.44rem 0.64rem 0.96rem;
    background: var(--gw-loc-s3);
    border: 1px solid var(--gw-loc-div);
    border-radius: 3.2rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 1.28rem;
    font-weight: 600;
    color: var(--gw-loc-text);
    user-select: none;
    white-space: nowrap;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}
.gw-loc-cpill:hover { border-color: rgba(215,152,88,0.3); }
.gw-loc-cpill.open { border-color: var(--gw-loc-primary); }
.gw-loc-cpill .gw-loc-flag,
.gw-loc-cpill .gw-flag {
    font-size: 1.84rem;
    line-height: 1;
}
.gw-loc-cpill .gw-loc-arr {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--gw-loc-t2);
    margin-left: 0.32rem;
    transition: transform 0.2s;
}
.gw-loc-cpill.open .gw-loc-arr { transform: rotate(180deg); }

.gw-loc-cdd {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 240px;
    background: var(--gw-loc-s2);
    border: 1px solid var(--gw-loc-div2);
    border-radius: var(--gw-loc-r);
    z-index: 200;
    padding: 0.48rem;
    box-shadow: 0 12px 36px rgba(0,0,0,0.6);
}
.gw-loc-cdd.show { display: block; }
.gw-loc-cdd-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.88rem 1.28rem;
    border-radius: var(--gw-loc-rs);
    cursor: pointer;
    transition: background 0.1s;
    font-size: 1.31rem;
    font-weight: 500;
}
.gw-loc-cdd-item:hover { background: var(--gw-loc-hover); }
.gw-loc-cdd-item.active {
    background: var(--gw-loc-sel);
    color: var(--gw-loc-primary);
    font-weight: 600;
}
.gw-loc-cdd-item .gw-loc-flag,
.gw-loc-cdd-item .gw-flag { font-size: 1.76rem; line-height: 1; }
.gw-loc-cdd-item .gw-loc-cc {
    font-size: 0.96rem;
    color: var(--gw-loc-t3);
    margin-left: auto;
    background: var(--gw-loc-s3);
    padding: 0.16rem 0.56rem;
    border-radius: 0.48rem;
}
.gw-loc-cdd-item.active .gw-loc-cc {
    background: var(--gw-loc-pdim);
    color: var(--gw-loc-primary);
}

/* ===== Filter tabs ===== */
.gw-loc-tabs {
    display: flex;
    gap: 0.48rem;
    margin-bottom: 0.96rem;
    padding: 0.4rem;
    background: var(--gw-loc-s1);
    border-radius: var(--gw-loc-r);
    border: 1px solid var(--gw-loc-div);
}
.gw-loc-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.48rem;
    padding: 0.72rem 0.8rem;
    border-radius: calc(var(--gw-loc-r) - 0.32rem);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gw-loc-t3);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    user-select: none;
    white-space: nowrap;
    background: transparent;
    border: 0;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}
.gw-loc-tab:hover { color: var(--gw-loc-t2); }
.gw-loc-tab.active {
    background: var(--gw-loc-s3);
    color: var(--gw-loc-text);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.gw-loc-tab-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.gw-loc-tab .gw-loc-cnt {
    font-size: 0.88rem;
    opacity: 0.45;
    margin-left: 0.16rem;
}

/* ===== City selector ===== */
.gw-loc-sbox { position: relative; }
.gw-loc-trig {
    display: flex;
    align-items: center;
    width: 100%;
    background: var(--gw-loc-field);
    border: 1px solid var(--gw-loc-div);
    border-radius: var(--gw-loc-r);
    padding: 0 1.6rem;
    height: 8rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    gap: 0.8rem;
    color: var(--gw-loc-text);
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}
.gw-loc-trig:hover { border-color: rgba(215,152,88,0.35); }
.gw-loc-trig.open {
    border-color: var(--gw-loc-primary);
    box-shadow: 0 0 0 1px var(--gw-loc-primary) inset;
}
.gw-loc-sname {
    font-weight: 700;
    font-size: 1.68rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    flex-shrink: 1;
}
.gw-loc-sname.placeholder { color: var(--gw-loc-t2); font-weight: 500; }
.gw-loc-stags {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
    flex-shrink: 0;
}
.gw-loc-trig .gw-loc-arr {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--gw-loc-t3);
    flex-shrink: 0;
    margin-left: 0.48rem;
    transition: transform 0.2s;
}
.gw-loc-trig.open .gw-loc-arr { transform: rotate(180deg); }

.gw-loc-sdd {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--gw-loc-s2);
    border: 1px solid var(--gw-loc-div2);
    border-radius: var(--gw-loc-r);
    max-height: 480px;
    overflow-y: auto;
    z-index: 100;
    padding: 0.48rem;
    box-shadow: 0 16px 48px rgba(0,0,0,0.55);
}
.gw-loc-sdd.show { display: block; }
.gw-loc-sdd::-webkit-scrollbar { width: 4px; }
.gw-loc-sdd::-webkit-scrollbar-thumb {
    background: var(--gw-loc-div2);
    border-radius: 4px;
}

.gw-loc-search-wrap {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.32rem 0.32rem 0.48rem;
    background: var(--gw-loc-s2);
}
.gw-loc-search {
    width: 100%;
    background: var(--gw-loc-s1);
    border: 1px solid var(--gw-loc-div);
    border-radius: var(--gw-loc-rs);
    padding: 0.8rem 1.12rem;
    color: var(--gw-loc-text);
    font-size: 1.25rem;
    font-family: inherit;
    outline: none;
}
.gw-loc-search:focus { border-color: var(--gw-loc-primary); }
.gw-loc-search::placeholder { color: var(--gw-loc-t3); }

.gw-loc-list { padding: 0; margin: 0; }
.gw-loc-item {
    display: flex;
    align-items: center;
    padding: 1.12rem 1.44rem;
    border-radius: var(--gw-loc-rs);
    cursor: pointer;
    transition: background 0.1s;
    gap: 0.64rem;
}
.gw-loc-item:hover { background: var(--gw-loc-hover); }
.gw-loc-item.active { background: var(--gw-loc-sel); }
.gw-loc-item.hid { display: none; }
.gw-loc-item .gw-loc-cn {
    font-size: 1.41rem;
    font-weight: 500;
}
.gw-loc-item.active .gw-loc-cn {
    color: var(--gw-loc-primary);
    font-weight: 600;
}
.gw-loc-item .gw-loc-tgs {
    display: flex;
    gap: 0.32rem;
    margin-left: auto;
    flex-shrink: 0;
}

/* ===== Tag badges (used in trigger and city items) ===== */
.gw-loc-tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.29rem 0.67rem;
    border-radius: 0.56rem;
    white-space: nowrap;
    color: var(--c, #888);
    background: rgba(136,136,136,0.10);
}
.gw-loc-tag-badge::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* Mobile */
@media (max-width: 480px) {
    .gw-loc { max-width: 100%; }
    .gw-loc-trig { height: 7.36rem; }
    .gw-loc-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .gw-loc-tab { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
    .gw-loc *,
    .gw-loc *::before,
    .gw-loc *::after { transition-duration: 0.01ms !important; }
}
