/* ==========================================================================
   Service Area Map — Digital Arborist WP Plugin
   Dual-zone: primary (green) + extended (amber).
   ========================================================================== */

/* ── Layout ────────────────────────────────────────────────────────────── */

#da-service-area-wrapper {
    position: relative;
    width: 100%;
}

#da-service-area-map {
    height: 70vh;
    width: 100%;
    min-height: 400px;
    max-height: 700px;
}

/* ── Search Bar — floating top-center ─────────────────────────────────── */

#da-search-container {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    width: 90%;
    max-width: 480px;
}

#da-search-inner {
    position: relative;
}

#da-search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    outline: none;
    background: #fff;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#da-search-input:focus {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

#da-search-input::placeholder {
    color: #999;
}

/* ── Result Banner — floating below search ────────────────────────────── */

#da-result-banner {
    position: absolute;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: normal;
    max-width: 540px;
    animation: da-slide-down 0.3s ease-out;
}

@keyframes da-slide-down {
    from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#da-result-banner.da-in-zone {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}

#da-result-banner.da-extended-zone {
    background: #fff8e1;
    color: #bf6c00;
    border: 1px solid #ffe082;
}

#da-result-banner.da-out-zone {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

#da-result-banner.da-hidden {
    display: none;
}

#da-result-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 2px;
    color: inherit;
    flex-shrink: 0;
}

#da-result-close:hover {
    opacity: 1;
}

/* ── Map Legend — floating bottom-left ─────────────────────────────────── */

#da-map-legend {
    position: absolute;
    bottom: 32px;
    left: 16px;
    z-index: 5;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
    padding: 10px 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.8;
}

#da-map-legend.da-hidden {
    display: none;
}

.da-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.da-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.da-legend-swatch.primary {
    background: rgba(45, 90, 39, 0.35);
    border: 2px solid #2d5a27;
}

.da-legend-swatch.extended {
    background: rgba(193, 121, 0, 0.25);
    border: 2px solid #bf6c00;
}

/* ── Edit Toolbar — floating bottom-right ─────────────────────────────── */

#da-edit-toolbar {
    position: absolute;
    bottom: 32px;
    right: 16px;
    z-index: 5;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
}

#da-zone-select {
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: #333;
    cursor: pointer;
}

#da-zone-select:focus {
    outline: none;
    border-color: #69A741;
}

#da-edit-status {
    min-width: 0;
}

#da-edit-status:empty {
    display: none;
}

#da-edit-status.da-saving {
    color: #1565c0;
}

#da-edit-status.da-saved {
    color: #2e7d32;
}

#da-edit-status.da-error {
    color: #c62828;
}

#da-edit-status.da-dirty {
    color: #e65100;
}

/* Button styling — matches ATE brand green */
#da-save-btn {
    background-color: #69A741;
    border-color: #69A741;
    color: #fff;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid;
    cursor: pointer;
}

#da-save-btn:hover:not(:disabled) {
    background-color: #5a9236;
    border-color: #5a9236;
}

#da-save-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

#da-reset-btn {
    background: transparent;
    border: 1px solid #999;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

#da-reset-btn:hover {
    border-color: #666;
    color: #333;
}

#da-clear-zone-btn {
    background: transparent;
    border: 1px solid #dc3545;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 13px;
    color: #dc3545;
    cursor: pointer;
}

#da-clear-zone-btn:hover {
    background: #dc3545;
    color: #fff;
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    #da-search-container {
        width: 94%;
    }

    #da-result-banner {
        max-width: 94%;
        font-size: 14px;
    }

    #da-edit-toolbar {
        bottom: 16px;
        right: 8px;
        left: 8px;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    #da-map-legend {
        bottom: 16px;
        left: 8px;
    }

    #da-service-area-map {
        height: 55vh;
        height: 55dvh;
        min-height: 300px;
        max-height: 500px;
    }
}

/* ── Google Places Autocomplete dropdown styling ──────────────────────── */

.pac-container {
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pac-item {
    padding: 8px 12px;
    font-size: 14px;
    border-top: 1px solid #f0f0f0;
}

.pac-item:hover {
    background: #f5f9f3;
}

.pac-item-selected {
    background: #e8f5e9;
}
