/* ============================================================
   EV Charging Finder Plugin — Stylesheet v1.0.0
   All classes prefixed with evcf- to avoid theme conflicts
   ============================================================ */

#ev-finder {
  --c:      var(--evcf-color, #1a9e5c);
  --c-lt:   color-mix(in srgb, var(--c) 15%, #fff);
  --c-dk:   color-mix(in srgb, var(--c) 80%, #000);
  --bg:     #f5f7f5;
  --surf:   #ffffff;
  --text:   #141814;
  --muted:  #6b736b;
  --bdr:    #e0e6e0;
  --rsm:    8px;
  --open-bg: #e6f7ee; --open-t: #1a7a46;
  --busy-bg: #fff3e0; --busy-t: #c06000;
  --fast-bg: #e8f1ff; --fast-t: #1850a0;
  font-family: -apple-system, 'DM Sans', BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--bdr);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

#ev-finder *, #ev-finder *::before, #ev-finder *::after {
  box-sizing: border-box; margin: 0; padding: 0;
}

/* ── HEADER ── */
.evcf-hdr { background: var(--surf); border-bottom: 1px solid var(--bdr); padding: 20px 20px 16px; }
.evcf-hdr h2 { font-size: 22px; font-weight: 700; margin-bottom: 3px; line-height: 1.3; }
.evcf-hdr h2 span { color: var(--c); }
.evcf-hdr > p { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.evcf-srow { display: flex; gap: 8px; flex-wrap: wrap; }
.evcf-swrap { flex: 1; min-width: 200px; position: relative; }
.evcf-swrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.evcf-swrap input { width: 100%; padding: 10px 10px 10px 36px; border: 1.5px solid var(--bdr); border-radius: var(--rsm); font-size: 14px; background: var(--bg); color: var(--text); outline: none; transition: border-color .2s; font-family: inherit; }
.evcf-swrap input:focus { border-color: var(--c); }
.evcf-btn-search { padding: 10px 20px; background: var(--c); color: #fff; border: none; border-radius: var(--rsm); font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s; font-family: inherit; }
.evcf-btn-search:hover { background: var(--c-dk); }
.evcf-btn-locate { padding: 10px 14px; background: var(--c-lt); color: var(--c-dk); border: 1.5px solid var(--c); border-radius: var(--rsm); font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 5px; transition: background .2s; font-family: inherit; }
.evcf-btn-locate:hover { filter: brightness(.95); }
.evcf-err-msg { display: none; margin-top: 8px; font-size: 13px; color: #c0392b; background: #fff5f5; border: 1px solid #f5c6c6; border-radius: 6px; padding: 7px 12px; }

/* ── FILTER CHIPS ── */
.evcf-fbar { background: var(--surf); padding: 10px 20px; border-bottom: 1px solid var(--bdr); display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.evcf-flbl { font-size: 12px; color: var(--muted); font-weight: 500; margin-right: 3px; }
.evcf-chip { padding: 5px 13px; border: 1.5px solid var(--bdr); border-radius: 20px; font-size: 12px; color: var(--muted); background: var(--surf); cursor: pointer; transition: all .15s; user-select: none; }
.evcf-chip:hover { border-color: var(--c); color: var(--c); }
.evcf-chip.active { background: var(--c-lt); border-color: var(--c); color: var(--c-dk); font-weight: 600; }

/* ── STATS ── */
.evcf-stats { display: flex; background: var(--surf); border-bottom: 1px solid var(--bdr); }
.evcf-sbox { flex: 1; padding: 12px 16px; border-right: 1px solid var(--bdr); text-align: center; }
.evcf-sbox:last-child { border-right: none; }
.evcf-snum { font-size: 20px; font-weight: 700; color: var(--c); }
.evcf-sdesc { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── LAYOUT ── */
.evcf-layout { display: grid; grid-template-columns: 340px 1fr; height: var(--evcf-height, 520px); }

/* ── LIST PANEL ── */
.evcf-lpanel { background: var(--surf); border-right: 1px solid var(--bdr); overflow-y: auto; display: flex; flex-direction: column; position: relative; }
.evcf-lhead { padding: 12px 14px 9px; border-bottom: 1px solid var(--bdr); font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--surf); z-index: 1; }
.evcf-ssort { font-size: 12px; border: 1px solid var(--bdr); border-radius: 6px; padding: 4px 7px; color: var(--text); background: var(--bg); cursor: pointer; outline: none; font-family: inherit; }
.evcf-scard { padding: 13px 14px; border-bottom: 1px solid var(--bdr); cursor: pointer; transition: background .15s; border-left: 3px solid transparent; }
.evcf-scard:hover { background: #f9fbf9; }
.evcf-scard.active { background: var(--c-lt); border-left-color: var(--c); }
.evcf-ctop { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 5px; }
.evcf-cname { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; padding-right: 8px; line-height: 1.3; }
.evcf-badge { font-size: 11px; padding: 3px 9px; border-radius: 20px; font-weight: 500; white-space: nowrap; }
.evcf-badge.open    { background: var(--open-bg); color: var(--open-t); }
.evcf-badge.busy    { background: var(--busy-bg); color: var(--busy-t); }
.evcf-badge.unknown { background: #f0f0f0; color: #888; }
.evcf-caddr { font-size: 12px; color: var(--muted); margin-bottom: 7px; display: flex; align-items: flex-start; gap: 4px; line-height: 1.4; }
.evcf-ctags { display: flex; gap: 5px; flex-wrap: wrap; }
.evcf-tag { font-size: 11px; padding: 2px 8px; border-radius: 5px; background: var(--bg); color: var(--muted); border: 1px solid var(--bdr); }
.evcf-tag.fast { background: var(--fast-bg); color: var(--fast-t); border-color: #b8d0f7; }
.evcf-cmeta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 7px; }
.evcf-cdist { font-weight: 600; color: var(--c-dk); }

/* ── MAP PANEL ── */
.evcf-mpanel { position: relative; display: flex; flex-direction: column; }
#evcf-map { flex: 1; background: #e8ede8; min-height: 200px; }
.evcf-mph { position: absolute; inset: 0; background: #e8ede8; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; color: var(--muted); z-index: 1; text-align: center; padding: 20px; }
.evcf-mph-note { font-size: 13px; background: var(--surf); padding: 8px 18px; border-radius: 20px; border: 1px solid var(--bdr); }
.evcf-mph-note a { color: var(--c); }

/* ── DETAIL SHEET ── */
.evcf-dsheet { position: absolute; right: 0; top: 0; bottom: 0; width: 285px; background: var(--surf); border-left: 1px solid var(--bdr); overflow-y: auto; transform: translateX(100%); transition: transform .25s ease; z-index: 10; display: flex; flex-direction: column; }
.evcf-dsheet.open { transform: translateX(0); }
.evcf-dclose { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.9); border: 1px solid var(--bdr); border-radius: 50%; width: 27px; height: 27px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; color: var(--muted); z-index: 1; }
.evcf-dclose:hover { background: #eee; }
.evcf-dimg { width: 100%; height: 90px; background: linear-gradient(135deg, #d0eed8, #a8dfc0); display: flex; align-items: center; justify-content: center; font-size: 38px; }
.evcf-dbody { padding: 14px; flex: 1; }
.evcf-dname { font-size: 16px; font-weight: 700; margin-bottom: 3px; padding-right: 28px; color: var(--text); }
.evcf-dnet  { font-size: 13px; color: var(--c); font-weight: 500; margin-bottom: 10px; }
.evcf-dsec  { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 12px 0 7px; }
.evcf-drow  { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--bdr); }
.evcf-drow span:first-child { color: var(--muted); }
.evcf-dbtn  { display: block; width: 100%; padding: 11px; background: var(--c); color: #fff; border: none; border-radius: var(--rsm); font-size: 14px; font-weight: 600; cursor: pointer; text-align: center; margin-top: 10px; text-decoration: none; transition: background .2s; font-family: inherit; }
.evcf-dbtn:hover { background: var(--c-dk); }
.evcf-dbtn.blue { background: #185FA5; }
.evcf-dbtn.blue:hover { background: #0f3f7a; }

/* ── LOADER ── */
.evcf-loader { position: absolute; inset: 0; background: rgba(255,255,255,.85); display: none; align-items: center; justify-content: center; z-index: 20; flex-direction: column; gap: 10px; font-size: 14px; color: var(--muted); }
.evcf-spin { width: 30px; height: 30px; border: 3px solid var(--bdr); border-top-color: var(--c); border-radius: 50%; animation: evcf-spin .7s linear infinite; }
@keyframes evcf-spin { to { transform: rotate(360deg); } }
.evcf-nores { padding: 36px 18px; text-align: center; color: var(--muted); font-size: 14px; display: none; line-height: 1.6; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .evcf-layout { grid-template-columns: 1fr; height: auto; }
  .evcf-lpanel { max-height: 50vh; border-right: none; border-bottom: 1px solid var(--bdr); }
  #evcf-map { height: 50vh; }
  .evcf-dsheet { width: 100%; border-left: none; }
  .evcf-sbox { padding: 9px 6px; }
  .evcf-snum { font-size: 16px; }
  .evcf-stats { overflow-x: auto; }
}
