/**
 * 领事馆地图样式 - Leaflet版本
 * Consulate Map Styles - Leaflet Version
 */

/* ================================
   弹窗容器样式
   ================================ */
.cev-map-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.cev-map-modal.active {
    display: flex;
}

.cev-map-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 25px;
    border: 3px solid #000;
    border-radius: 12px;
    width: 90%;
    max-width: 1000px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

/* ================================
   弹窗头部
   ================================ */
.cev-map-modal-header {
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.cev-map-modal-title {
    margin: 0;
    font-size: 26px;
    color: #222;
    font-weight: bold;
}

.cev-map-modal-subtitle {
    margin: 8px 0 0;
    font-size: 15px;
    color: #666;
    font-weight: normal;
}

.cev-map-close-btn {
    color: #000;
    position: absolute;
    top: 0;
    right: 0;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.cev-map-close-btn:hover,
.cev-map-close-btn:focus {
    background-color: #f0f0f0;
    color: #333;
}

/* ================================
   弹窗主体内容
   ================================ */
.cev-map-modal-body {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ================================
   地图容器
   ================================ */
.cev-map-container {
    width: 100%;
    height: 550px;
    background-color: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 2px solid #ddd;
}

.cev-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #666;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px 30px;
    border-radius: 8px;
    z-index: 1000;
    font-weight: 500;
}

/* ================================
   Leaflet地图样式覆盖
   ================================ */
.leaflet-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 15px;
    font-size: 14px;
}

/* ================================
   自定义Tooltip样式
   ================================ */
.cev-map-tooltip {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 14px;
    font-family: sans-serif;
    pointer-events: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: none;
    max-width: 250px;
    line-height: 1.5;
}

.cev-map-tooltip strong {
    display: block;
    margin-bottom: 5px;
    font-size: 15px;
}

.cev-map-tooltip small {
    font-size: 12px;
    color: #ddd;
}

/* ================================
   州信息弹窗
   ================================ */
.cev-state-info-popup {
    display: none;
    position: fixed;
    background-color: #fff;
    border: 2px solid #000;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    max-width: 380px;
    max-height: 80vh;
    overflow-y: auto;
    text-align: center;
    font-family: sans-serif;
}

.cev-popup-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10;
}

.cev-popup-close-btn:hover {
    background-color: #f0f0f0;
    color: #000;
}

.cev-state-info-popup h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    color: #222;
    line-height: 1.4;
    padding-right: 35px; /* 为关闭按钮留出空间 */
}

.cev-state-info-popup .consulate-name {
    margin: 10px 0;
    font-size: 15px;
    color: #555;
    line-height: 1.6;
}

.cev-state-info-popup .ca-notice {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
}

.cev-state-info-popup .ca-notice > p {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #222;
    text-align: center;
}

.cev-state-info-popup .ca-region {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 12px;
    margin-bottom: 12px;
}

.cev-state-info-popup .ca-region:last-child {
    margin-bottom: 0;
}

.cev-state-info-popup .ca-region-south {
    border-color: #EF4444;
    border-width: 2px;
}

.cev-state-info-popup .ca-region-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #222;
    font-weight: bold;
}

.cev-state-info-popup .ca-consulate {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #555;
}

.cev-state-info-popup .ca-counties {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cev-state-info-popup .ca-counties li {
    padding: 6px 10px;
    margin: 4px 0;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 12px;
    color: #444;
    border-left: 3px solid #EF4444;
}

.cev-agency-service-btn {
    background-color: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.cev-agency-service-btn:hover {
    background-color: #333;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* ================================
   图例样式
   ================================ */
.cev-map-legend {
    margin-top: 25px;
    width: 100%;
    background-color: #f8f8f8;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
}

.cev-map-legend-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 12px;
    text-align: center;
    color: #222;
}

.cev-map-legend-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.cev-map-legend-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #444;
}

.cev-map-legend-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-right: 10px;
    border: 1px solid #999;
    flex-shrink: 0;
}

/* ================================
   移动端响应式
   ================================ */
@media (max-width: 768px) {
    .cev-map-modal-content {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
        border: none;
        max-height: 100vh;
        padding: 15px;
    }

    .cev-map-modal-header {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .cev-map-close-btn {
        top: 50%;
        transform: translateY(-50%);
        right: 10px;
        font-size: 40px;
        width: 45px;
        height: 45px;
        background-color: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
    }

    .cev-map-container {
        height: 60vh;
    }

    .cev-map-modal-title {
        font-size: 20px;
    }

    .cev-map-modal-subtitle {
        font-size: 13px;
    }

    .cev-map-legend {
        margin-top: 15px;
        padding: 12px;
    }

    .cev-map-legend-title {
        font-size: 15px;
    }

    .cev-map-legend-items {
        justify-content: flex-start;
        gap: 10px;
    }

    .cev-map-legend-item {
        font-size: 13px;
    }

    .cev-map-legend-color {
        width: 20px;
        height: 20px;
    }

    .cev-state-info-popup {
        max-width: 90%;
        padding: 15px;
    }

    .cev-state-info-popup h3 {
        font-size: 18px;
    }

    .cev-map-tooltip {
        font-size: 13px;
        padding: 8px 12px;
    }
}

/* ================================
   移动端地图触发按钮 (head_contact中)
   ================================ */
.cev-map-trigger-mobile {
    display: none; /* 默认隐藏 */
}

@media (max-width: 991px) {
    .cev-map-trigger-mobile {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 3px;
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background-color: #000;
        color: #fff;
        padding: 4px 8px;
        border-radius: 15px;
        font-size: 11px;
        text-decoration: none;
        white-space: nowrap;
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
        transition: all 0.3s ease;
        z-index: 10;
    }
    
    .cev-map-trigger-mobile:hover {
        background-color: #333;
        color: #fff;
        transform: translateY(-50%) scale(1.05);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }
    
    .cev-map-trigger-mobile i {
        font-size: 11px;
        line-height: 1;
    }
    
    .cev-map-trigger-mobile span {
        font-size: 10px;
        font-weight: 600;
        line-height: 1;
        letter-spacing: 0.5px;
    }
    
    /* 确保head_contact有相对定位 */
    .head_contact {
        position: relative;
        padding-right: 65px; /* 为按钮留出空间 */
    }
}

@media (max-width: 576px) {
    .cev-map-trigger-mobile {
        padding: 8px 17px;
        font-size: 10px;
        right: 5px;
        gap: 2px;
        border-radius: 12px;
    }
    
    .cev-map-trigger-mobile i {
        font-size: 10px;
    }
    
    .cev-map-trigger-mobile span {
        font-size: 13px;
        font-weight: 600;
    }
    
    /* 隐藏head_contact下的图片图标 */
    .head_contact p img {
        display: none !important;
    }
    
    /* 增加一点高度和右侧空间 */
    .head_lx_con {
        min-height: 42px !important;
        align-items: center !important;
    }
    
    .head_contact {
        padding-right: 55px !important;
        align-items: center !important;
    }
    
    .head_contact p {
        font-size: 12px !important;
        margin-right: 10px !important;
    }
}

/* ================================
   独立页面样式
   ================================ */
.cev-map-page-wrapper {
    min-height: 60vh;
}

.cev-map-page-header {
    text-align: center;
    margin-bottom: 30px;
}

.cev-map-page-title {
    font-size: 32px;
    font-weight: bold;
    color: #222;
    margin-bottom: 15px;
}

.cev-map-page-description {
    font-size: 16px;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.cev-map-page-notes {
    background-color: #f9f9f9;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.cev-map-page-notes h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #222;
}

.cev-map-page-notes ul {
    line-height: 1.8;
    color: #555;
}

.cev-map-page-notes li {
    margin-bottom: 8px;
}

.page-template-page-consulate-map .cev-map-page-container {
    height: 650px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .cev-map-page-title {
        font-size: 24px;
    }
    
    .cev-map-page-description {
        font-size: 14px;
    }
    
    .page-template-page-consulate-map .cev-map-page-container {
        height: 70vh;
    }
    
    .cev-map-page-notes {
        padding: 15px;
    }
}
