/**
 *  Country URLs — Frontend Styles v2.0
 * All styles scoped to #ecu-wrap — zero CSS conflict with any theme/plugin
 */

#ecu-wrap, #ecu-wrap *, #ecu-wrap *::before, #ecu-wrap *::after {
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    margin: 0;
    padding: 0;
    line-height: 1 !important;
}

/* ── Position ─────────────────────────────────────────────────────────────── */
#ecu-wrap {
    position: fixed !important;
    z-index: 2147483647 !important; /* Max z-index — above everything */
    margin: 18px !important;
}
#ecu-wrap.ecu-bottom-right { bottom: 0 !important; right: 0 !important; }
#ecu-wrap.ecu-bottom-left  { bottom: 0 !important; left: 0 !important; }
#ecu-wrap.ecu-top-right    { top: 0 !important;    right: 0 !important; }
#ecu-wrap.ecu-top-left     { top: 0 !important;    left: 0 !important; }

/* ── Toggle Button ─────────────────────────────────────────────────────────── */
#ecu-wrap .ecu-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 10px 16px !important;
    background: #0057b8 !important;
    color: #f8fafc !important;
    border: 2px solid rgba(255,255,255,0.12) !important;
    border-radius: 999px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.35) !important;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s !important;
    outline: none !important;
    letter-spacing: 0.4px !important;
    text-transform: none !important;
    text-decoration: none !important;
}
#ecu-wrap .ecu-toggle:hover {
    background: #0057b8 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4) !important;
}
#ecu-wrap .ecu-toggle:focus-visible {
    outline: 2px solid #38bdf8 !important;
    outline-offset: 3px !important;
}
#ecu-wrap .ecu-flag { font-size: 20px !important; line-height: 1 !important; }
#ecu-wrap .ecu-label {
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    color: #f8fafc !important;
}
#ecu-wrap .ecu-arrow {
    font-size: 8px !important;
    opacity: 0.6 !important;
    transition: transform 0.2s !important;
}
#ecu-wrap .ecu-toggle[aria-expanded="true"] .ecu-arrow {
    transform: rotate(180deg) !important;
}

/* ── Dropdown Panel ─────────────────────────────────────────────────────────── */
#ecu-wrap .ecu-panel {
    position: absolute !important;
    min-width: 210px !important;
    background: #ffffff !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 50px rgba(0,0,0,0.22), 0 2px 10px rgba(0,0,0,0.1) !important;
    border: 1px solid rgba(0,0,0,0.07) !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(8px) scale(0.96) !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
}
.ecu-bottom-right .ecu-panel, .ecu-bottom-left .ecu-panel {
    bottom: calc(100% + 10px) !important;
}
.ecu-top-right .ecu-panel, .ecu-top-left .ecu-panel {
    top: calc(100% + 10px) !important;
}
.ecu-bottom-right .ecu-panel, .ecu-top-right .ecu-panel { right: 0 !important; }
.ecu-bottom-left .ecu-panel, .ecu-top-left .ecu-panel   { left: 0 !important; }

#ecu-wrap .ecu-panel.ecu-open {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) scale(1) !important;
}

/* ── Panel Header ─────────────────────────────────────────────────────────── */
#ecu-wrap .ecu-panel-header {
    padding: 12px 16px 8px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.3px !important;
    color: #94a3b8 !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

/* ── Country List ─────────────────────────────────────────────────────────── */
#ecu-wrap .ecu-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 6px 0 !important;
    max-height: 340px !important;
    overflow-y: auto !important;
}
#ecu-wrap .ecu-list::-webkit-scrollbar { width: 4px; }
#ecu-wrap .ecu-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

/* ── Country Item ─────────────────────────────────────────────────────────── */
#ecu-wrap .ecu-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 16px !important;
    cursor: pointer !important;
    transition: background 0.12s ease !important;
    color: #334155 !important;
    font-size: 14px !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
}
#ecu-wrap .ecu-item:hover, #ecu-wrap .ecu-item:focus {
    background: #f0f9ff !important;
    color: #0f172a !important;
}
#ecu-wrap .ecu-item.ecu-active {
    background: #eff6ff !important;
    color: #1e40af !important;
    font-weight: 600 !important;
}
#ecu-wrap .ecu-iflag { font-size: 22px !important; flex-shrink: 0 !important; }
#ecu-wrap .ecu-name  { flex: 1 !important; font-size: 14px !important; color: inherit !important; }
#ecu-wrap .ecu-tick  { color: #22c55e !important; font-weight: 700 !important; font-size: 14px !important; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    #ecu-wrap { margin: 12px !important; }
    #ecu-wrap .ecu-toggle { padding: 9px 13px !important; }
    #ecu-wrap .ecu-panel { min-width: 185px !important; }
}
