/**
 * Socket Fiber System Coverage Map Stylesheet
 * Custom Leaflet map styling and Socket Fiber branding
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Montserrat:wght@500;600;700;800&display=swap');

.socket-map-wrapper.socket-map-leaflet-wrapper {
    position: relative;
    width: 100%;
    margin: 24px auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    font-family: 'Outfit', 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.socket-map-leaflet-wrapper * {
    box-sizing: border-box;
}

/* ========================================================
   TOP TOOLBAR & SEARCH CONTROLS
   ======================================================== */
.socket-map-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    z-index: 20;
    position: relative;
}

.socket-map-search-box {
    position: relative;
    flex: 1 1 280px;
    max-width: 440px;
    display: flex;
    align-items: center;
}

.socket-map-search-box .socket-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    line-height: 1;
}

.socket-map-wrapper .socket-city-search-input,
input.socket-city-search-input,
.et_pb_module input.socket-city-search-input {
    width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    padding-left: 42px !important;
    padding-right: 38px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    color: #0f172a !important;
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    box-sizing: border-box !important;
    line-height: normal !important;
    box-shadow: none !important;
}

.socket-map-wrapper .socket-city-search-input:focus,
input.socket-city-search-input:focus,
.et_pb_module input.socket-city-search-input:focus {
    border-color: #ea871e !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(234, 135, 30, 0.18) !important;
}

.socket-map-search-box .socket-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none !important;
    font-size: 18px !important;
    line-height: 1 !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    padding: 4px !important;
    z-index: 5;
}

.socket-map-search-box .socket-search-clear:hover {
    color: #334155 !important;
}

.socket-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
}

.socket-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 13.5px;
    color: #1e293b;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.socket-search-item:last-child {
    border-bottom: none;
}

.socket-search-item:hover {
    background: #f8fafc;
    color: #ea871e;
}

.socket-search-item .item-link-hint {
    font-size: 11.5px;
    color: #ea871e;
    font-weight: 600;
}

.socket-map-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.socket-locations-counter {
    font-size: 13px;
    color: #64748b;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.socket-locations-counter strong {
    color: #1b365d;
    font-weight: 700;
}

.socket-reset-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: #1b365d;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.socket-reset-view-btn:hover {
    background: #ffffff;
    border-color: #1b365d;
    color: #ea871e;
}

/* ========================================================
   VIEWPORT & LEAFLET CANVAS
   ======================================================== */
.socket-map-viewport-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    background: #f8fafc;
    overflow: hidden;
}

.socket-leaflet-map-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* ========================================================
   CUSTOM MARKER ICONS (SOCKET FIBER PINS)
   ======================================================== */
.socket-custom-div-icon {
    background: transparent !important;
    border: none !important;
}

.socket-marker-pin {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.socket-marker-halo {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(234, 135, 30, 0.28);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.socket-marker-core {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ea871e;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease;
}

/* ========================================================
   LEAFLET VECTOR PINS & SMART HOVER TOOLTIPS
   ======================================================== */
.socket-clickable-pin {
    cursor: pointer !important;
}

.leaflet-tooltip.socket-marker-hover-tooltip {
    background: #1b365d !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.28) !important;
    font-family: 'Outfit', 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #ffffff !important;
    padding: 5px 10px !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    letter-spacing: 0.1px !important;
    white-space: nowrap !important;
}

.leaflet-tooltip.socket-marker-hover-tooltip strong {
    color: #ea871e !important;
    font-weight: 700 !important;
}

.leaflet-tooltip.socket-marker-hover-tooltip::before {
    border-top-color: #1b365d !important;
}

.socket-marker-label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Outfit', 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9), 0 0 6px #ffffff;
    pointer-events: none;
    letter-spacing: -0.1px;
    transition: color 0.15s ease, font-weight 0.15s ease;
}

/* Marker Hover States */
.socket-marker-pin:hover .socket-marker-core {
    transform: scale(1.45);
    background: #d97706;
}

.socket-marker-pin:hover .socket-marker-halo {
    transform: scale(1.6);
    background: rgba(234, 135, 30, 0.45);
}

.socket-marker-pin:hover .socket-marker-label {
    color: #0f172a;
    font-weight: 700;
}

/* ========================================================
   LEAFLET POPUP CARD STYLING
   ======================================================== */
.socket-leaflet-popup-custom .leaflet-popup-content-wrapper {
    background: #ffffff;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.18), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
    border: 1px solid #e2e8f0;
    font-family: 'Outfit', 'Montserrat', sans-serif;
    overflow: hidden;
}

.socket-leaflet-popup-custom .leaflet-popup-content {
    margin: 0;
    padding: 14px 16px;
    min-width: 200px;
}

.socket-map-popup-card .socket-popup-title {
    margin: 0 0 4px 0;
    font-size: 14.5px;
    font-weight: 700;
    color: #1b365d;
}

.socket-map-popup-card .socket-popup-desc {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.socket-map-popup-card .socket-popup-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    background: #ea871e;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.socket-map-popup-card .socket-popup-btn:hover {
    background: #d97706;
    color: #ffffff;
}

/* ========================================================
   FLOATING BRAND OVERLAYS
   ======================================================== */
.socket-map-floating-brand {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    pointer-events: auto;
}

.socket-brand-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.socket-brand-name {
    font-size: 22px;
    font-weight: 700;
    color: #1b365d;
    letter-spacing: -0.3px;
}

.socket-brand-fiber {
    font-size: 22px;
    font-weight: 800;
    color: #ea871e;
    letter-spacing: 0.5px;
}

.socket-map-floating-badge {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: #142b58;
    color: #ffffff;
    border-radius: 8px;
    padding: 8px 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
    text-align: center;
    pointer-events: auto;
}

.socket-badge-sub {
    display: block;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #93c5fd;
    margin-bottom: 2px;
}

.socket-badge-main {
    display: block;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.8px;
    color: #ffffff;
}

/* ========================================================
   DIRECTORY SECTION
   ======================================================== */
.socket-map-directory-section {
    padding: 24px 28px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.socket-directory-title {
    font-size: 18px;
    font-weight: 700;
    color: #1b365d;
    margin: 0 0 16px 0;
}

.socket-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.socket-directory-column h4 {
    font-size: 13.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 1px;
    margin: 0 0 10px 0;
    padding-bottom: 4px;
    border-bottom: 2px solid #e2e8f0;
}

.socket-directory-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 260px;
    overflow-y: auto;
}

.socket-directory-list li {
    margin-bottom: 6px;
}

.socket-directory-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: #334155;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.socket-directory-list a:hover {
    background: #e2e8f0;
    color: #ea871e;
}

.socket-directory-list .city-arrow {
    font-size: 12px;
    color: #94a3b8;
}

/* ========================================================
   RESPONSIVE ADJUSTMENTS
   ======================================================== */
@media (max-width: 768px) {
    .socket-map-toolbar {
        padding: 10px 14px;
    }

    .socket-map-search-box {
        max-width: 100%;
        width: 100%;
    }

    .socket-map-toolbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .socket-map-floating-badge {
        display: none;
    }

    .socket-map-floating-brand {
        bottom: 12px;
        left: 12px;
        padding: 6px 10px;
    }

    .socket-brand-name,
    .socket-brand-fiber {
        font-size: 18px;
    }
}
