/* ============================================================
   Middle East War Map — Front-end Styles  v3.0
   All selectors scoped under .mewm-wrap to avoid theme conflicts
   ============================================================ */

/* ---- Wrapper ---- */
.mewm-wrap {
    width: 100%;
    margin: 0 auto;
    background: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ---- Title bar ---- */
.mewm-title {
    padding: 20px !important;
    background: #001D35 !important;
    color: white !important;
    text-align: center !important;
    font-size: 2.5em !important;
    margin: 0 !important;
    font-family: 'Times New Roman', Times, serif !important;
    border: none !important;
    line-height: 1.2 !important;
}

/* ---- Layout: panel left, map right ---- */
.mewm-layout {
    display: flex;
    gap: 16px;
    align-items: stretch;
    padding: 16px;
}

/* ---- Map ---- */
.mewm-map-container {
    width: 50%;
    min-width: 420px;
    height: 400px;
    position: relative;
    border: 1px solid #d7d7d7;
   
}

.leaflet-container {
    background: #e8f4f8;
}

/* ---- Info panel ---- */
.mewm-info-panel {
    width: 50%;
    border: 1px solid #d7d7d7;
    display: flex;
    flex-direction: column;
    align-self: flex-start;
    background: #fff;
    flex-shrink: 0;
}

/* Panel top — title bar with logo */
.mewm-panel-top h3,
#mewm-panel-title {
    background: #001D35;
    color: #fff !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    font-size: 1.2em !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border: none !important;
    font-family: inherit !important;
    line-height: 1.3 !important;
}

.mewm-panel-top h3::after,
#mewm-panel-title::after {
    content: "";
    width: 36px;
    height: 36px;
    margin-left: 10px;
    flex: 0 0 36px;
    background-image: var(--mewm-logo-url);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* Panel body */
.mewm-panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Panel sections */
.mewm-panel-section {
    flex: 0 0 auto;
    padding: 12px;
    overflow: hidden;
    border-bottom: 1px solid #e3e3e3;
}

.mewm-panel-attacks  { flex: 0 0 auto; }
.mewm-panel-casualties { flex: 1 1 auto; min-height: 0; }

.mewm-panel-section:last-child { border-bottom: none; }

.mewm-attacks-heading,
.mewm-casualties-heading {
    margin: 0 0 8px !important;
    color: #A01C40 !important;
    border: none !important;
    font-size: 1em !important;
    padding: 0 !important;
}

/* ---- Stat rows ---- */
.mewm-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-bottom: 1px solid #d1d4d7;
}

.mewm-stat-item:last-child {
    border-bottom: 1px solid #d1d4d7;
}

.mewm-label-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-width: 0;
    flex: 1;
}

.mewm-icon-box {
    width: 42px;
    flex: 0 0 42px;
    height: 100%;
    background: #d1d4d7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mewm-stat-item:nth-child(odd)  .mewm-icon-box { background: #d1d4d7; }
.mewm-stat-item:nth-child(even) .mewm-icon-box { background: #b8bec1; }

.mewm-icon {
    width: 78%;
    height: 78%;
    object-fit: contain;
}

.mewm-label {
    display: inline-flex;
    align-items: center;
    padding: 0 0 0 10px;
    white-space: nowrap;
    font-weight: 700;
    color: #5b5f65;
}

.mewm-value {
    display: inline-flex;
    align-items: center;
    font-size: 1.1em;
    font-weight: 800;
    color: #A01C40;
    padding-right: 15px;
}

.mewm-panel-text {
    color: #1f2f3e;
    line-height: 1.5;
}

/* ---- Country labels (Leaflet tooltips) ---- */
.mewm-wrap .leaflet-tooltip,
.mewm-country-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-weight: bold !important;
    color: #fff !important;
    font-size: 16px !important;
    text-shadow:
        black 1px  1px 2px,
        black -1px 1px 2px,
        black -1px -1px 2px,
        black 1px  -1px 2px !important;
}

/* ---- US inset ---- */
.mewm-us-wrap {
    background: #fff;
    border: 1px solid #000;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    padding: 4px;
}

.mewm-us-map {
    width: 160px;
    height: 110px;
    background: #fff;
}

.mewm-us-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-weight: bold !important;
    color: #fff !important;
    font-size: 12px !important;
    text-shadow:
        black 1px  1px 2px,
        black -1px 1px 2px,
        black -1px -1px 2px,
        black 1px  -1px 2px !important;
}

/* ============================================================
   MOBILE  ≤ 768px
   ============================================================ */
@media (max-width: 768px) {

    .mewm-title {
        font-size: 1.8em !important;
        padding: 16px !important;
    }

    .mewm-layout {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }

    .mewm-map-container {
        width: 100%;
        min-width: 0;
        height: 470px;
        border-left: none;
        border-right: none;
    }

    /* Info panel slides up from bottom on mobile */
    .mewm-info-panel {
        width: 100%;
        height: 390px;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10000;
        overflow-y: auto;
        border-left: none;
        border-right: none;
        border-bottom: none;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2);
        transform: translateY(100%);
        transition: transform 0.2s ease;
        align-self: auto;
    }

    .mewm-info-panel.mewm-mobile-visible {
        transform: translateY(0);
    }

    .mewm-panel-body {
        flex-direction: column;
    }

    .mewm-panel-section:last-child {
        border-bottom: none;
    }
}
