/* ═══════════════════════════════════════════════
   Escapade Travel Map — Styles
   escapadeetvoyage.com
═══════════════════════════════════════════════ */

/* ── Variables de couleur ── */
:root {
    --etm-color-0: #d8dde3;   /* non marqué */
    --etm-color-1: #27ae60;   /* visité 1x  */
    --etm-color-2: #1a5e38;   /* visité 2x+ */
    --etm-color-3: #e67e22;   /* projet      */
    --etm-color-4: #3498db;   /* wishlist    */
    --etm-stroke:  #8a9ba8;
    --etm-hover:   rgba(255,255,255,0.25);
    --etm-bg:      #f0f4f8;
    --etm-radius:  12px;
    --etm-shadow:  0 4px 24px rgba(0,0,0,0.10);
}

/* ── Wrapper global ── */
#etm-wrapper {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    max-width: 100%;
    background: var(--etm-bg);
    border-radius: var(--etm-radius);
    padding: 20px;
    box-shadow: var(--etm-shadow);
    position: relative;
    user-select: none;
}

/* ── Barre admin ── */
#etm-admin-bar {
    background: linear-gradient(90deg, #2c3e50, #34495e);
    color: #ecf0f1;
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.etm-admin-label { opacity: .9; }

/* ── Légende ── */
#etm-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
}
.etm-legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #444;
}
.etm-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 1.5px solid rgba(0,0,0,.12);
    flex-shrink: 0;
}
.etm-dot-0 { background: var(--etm-color-0); }
.etm-dot-1 { background: var(--etm-color-1); }
.etm-dot-2 { background: var(--etm-color-2); }
.etm-dot-3 { background: var(--etm-color-3); }
.etm-dot-4 { background: var(--etm-color-4); }

/* ── Stats ── */
#etm-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.etm-stat-item {
    flex: 1;
    min-width: 70px;
    text-align: center;
    padding: 10px 8px;
    border-radius: 8px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.etm-stat-1 { background: var(--etm-color-1); }
.etm-stat-2 { background: var(--etm-color-2); }
.etm-stat-3 { background: var(--etm-color-3); }
.etm-stat-4 { background: var(--etm-color-4); }
.etm-stat-number {
    display: block;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
}
.etm-stat-label {
    display: block;
    font-size: 11px;
    opacity: .85;
    margin-top: 3px;
}

/* ── Conteneur carte ── */
#etm-map-container {
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #cdd9e1;
    cursor: default;
    line-height: 0;
}
#etm-map-container svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Couleurs des pays dans le SVG ── */
#etm-map-container svg path {
    fill: var(--etm-color-0);
    stroke: var(--etm-stroke);
    stroke-width: 0.3;
    transition: fill .18s ease, filter .18s ease;
}
#etm-map-container svg path[data-etm-status="1"] { fill: var(--etm-color-1); }
#etm-map-container svg path[data-etm-status="2"] { fill: var(--etm-color-2); }
#etm-map-container svg path[data-etm-status="3"] { fill: var(--etm-color-3); }
#etm-map-container svg path[data-etm-status="4"] { fill: var(--etm-color-4); }

/* Hover sur la carte */
#etm-map-container svg path:hover,
#etm-map-container svg path.etm-hovered {
    filter: brightness(1.18) drop-shadow(0 0 3px rgba(0,0,0,.3));
    cursor: pointer;
}

/* ── Tooltip ── */
#etm-tooltip {
    position: fixed;
    background: rgba(20,30,40,.88);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    box-shadow: 0 3px 12px rgba(0,0,0,.25);
    backdrop-filter: blur(4px);
}
#etm-tooltip-name { font-weight: 600; }
#etm-tooltip-status {
    display: block;
    font-size: 11px;
    opacity: .8;
    margin-top: 2px;
}

/* ── Modal admin ── */
#etm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    animation: etmFadeIn .18s ease;
}
@keyframes etmFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
#etm-modal-inner {
    background: #fff;
    border-radius: 14px;
    padding: 28px 32px;
    min-width: 300px;
    max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    animation: etmSlideUp .2s ease;
}
@keyframes etmSlideUp {
    from { transform: translateY(18px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
#etm-modal-title {
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
}
#etm-status-buttons {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 16px;
}
.etm-status-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #f4f6f8;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all .15s ease;
    text-align: left;
    width: 100%;
}
.etm-status-btn:hover { transform: translateX(3px); }
.etm-status-btn.etm-active { border-color: currentColor; background: #fff; }

.etm-status-btn-0 .etm-btn-dot { background: var(--etm-color-0); }
.etm-status-btn-1 .etm-btn-dot { background: var(--etm-color-1); }
.etm-status-btn-2 .etm-btn-dot { background: var(--etm-color-2); }
.etm-status-btn-3 .etm-btn-dot { background: var(--etm-color-3); }
.etm-status-btn-4 .etm-btn-dot { background: var(--etm-color-4); }

.etm-status-btn-1:hover,
.etm-status-btn-1.etm-active { color: var(--etm-color-1); }
.etm-status-btn-2:hover,
.etm-status-btn-2.etm-active { color: var(--etm-color-2); }
.etm-status-btn-3:hover,
.etm-status-btn-3.etm-active { color: var(--etm-color-3); }
.etm-status-btn-4:hover,
.etm-status-btn-4.etm-active { color: var(--etm-color-4); }

.etm-btn-dot {
    width: 13px; height: 13px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1.5px solid rgba(0,0,0,.1);
}

#etm-modal-feedback {
    min-height: 20px;
    font-size: 13px;
    color: var(--etm-color-1);
    font-weight: 500;
    margin-bottom: 8px;
    text-align: center;
}
#etm-modal-feedback.etm-error { color: #e74c3c; }

#etm-modal-close {
    width: 100%;
    padding: 9px;
    background: #ecf0f1;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: background .15s;
}
#etm-modal-close:hover { background: #dde1e4; }

/* ── Responsive ── */
@media (max-width: 600px) {
    #etm-wrapper { padding: 12px; }
    #etm-stats { gap: 6px; }
    .etm-stat-number { font-size: 20px; }
    #etm-modal-inner { padding: 20px 18px; }
    #etm-legend { gap: 7px 14px; }
}

/* ═══════════════════════════════════════════════
   Barre de recherche admin (v1.1)
═══════════════════════════════════════════════ */

#etm-admin-bar {
    background: linear-gradient(90deg, #2c3e50, #34495e);
    color: #ecf0f1;
    padding: 10px 16px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
}

#etm-admin-bar-top {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

#etm-search-zone {
    position: relative;
}

#etm-search-wrap {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.22);
    border-radius: 8px;
    padding: 0 10px;
    transition: border-color .15s, background .15s;
}
#etm-search-wrap:focus-within {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

#etm-search-icon {
    font-size: 15px;
    margin-right: 8px;
    opacity: .7;
    flex-shrink: 0;
}

#etm-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 14px;
    padding: 9px 0;
    width: 100%;
}
#etm-search-input::placeholder { color: rgba(255,255,255,.45); }

#etm-search-clear {
    background: transparent;
    border: none;
    color: rgba(255,255,255,.5);
    cursor: pointer;
    font-size: 13px;
    padding: 4px;
    line-height: 1;
    display: none;
    flex-shrink: 0;
    transition: color .15s;
}
#etm-search-clear:hover { color: #fff; }
#etm-search-clear.visible { display: block; }

/* Liste de résultats */
#etm-search-results {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,.22);
    max-height: 240px;
    overflow-y: auto;
    position: absolute;
    left: 0; right: 0;
    z-index: 9998;
    display: none;
}
#etm-search-results.open { display: block; }

#etm-search-results li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #2c3e50;
    border-bottom: 1px solid #f0f0f0;
    transition: background .1s;
    gap: 10px;
}
#etm-search-results li:last-child { border-bottom: none; }
#etm-search-results li:hover { background: #f4f7fb; }

.etm-result-name { flex: 1; font-weight: 500; }
.etm-result-id   { font-size: 11px; color: #aaa; font-family: monospace; }
.etm-result-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}
.etm-badge-0 { background: #aab5bd; color: #fff; }
.etm-badge-1 { background: var(--etm-color-1); }
.etm-badge-2 { background: var(--etm-color-2); }
.etm-badge-3 { background: var(--etm-color-3); }
.etm-badge-4 { background: var(--etm-color-4); }

.etm-no-result {
    padding: 12px 14px;
    color: #888;
    font-size: 13px;
    cursor: default !important;
}
.etm-no-result:hover { background: transparent !important; }

/* Focus clavier dans la liste de résultats */
#etm-search-results li.etm-kbd-focus {
    background: #eaf2fb;
}
