/**
 * GoGreen Directory — Leaflet Maps & Directions Styles.
 */

/* Map containers */
.ggd-map {
    width: 100%;
    min-height: 300px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    position: relative;
    z-index: 1;
}

#ggd-single-map {
    height: 300px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Popup styles */
.ggd-map-popup {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    max-width: 250px;
}

.ggd-map-popup strong {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.ggd-map-popup a {
    color: #2563eb;
    text-decoration: none;
}

.ggd-map-popup a:hover {
    text-decoration: underline;
}

.ggd-map-notice {
    padding: 1rem;
    text-align: center;
    color: #64748b;
    font-style: italic;
}

/* Directions button */
.ggd-directions-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.ggd-directions-btn:hover {
    background: #1d4ed8;
    color: #fff;
}

.ggd-directions-btn svg,
.ggd-directions-btn .dashicons {
    width: 16px;
    height: 16px;
}

/* Directions bar — shows distance/time */
.ggd-directions-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}

.ggd-directions-bar .ggd-directions-btn {
    flex-shrink: 0;
}

/* App selector for directions */
.ggd-directions-apps {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.ggd-directions-apps a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    color: #374151;
    transition: all 0.2s;
}

.ggd-directions-apps a:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.ggd-directions-apps a.ggd-app-google { border-color: #4285f4; color: #4285f4; }
.ggd-directions-apps a.ggd-app-apple { border-color: #333; color: #333; }
.ggd-directions-apps a.ggd-app-waze { border-color: #05c8f7; color: #05c8f7; }

/* Route status */
#ggd-route-status {
    display: none;
    padding: 8px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    font-size: 14px;
    color: #0c4a6e;
    margin: 8px 0;
}

/* Turn-by-turn panel */
#ggd-directions-panel {
    display: none;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.ggd-turn-by-turn {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ggd-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.ggd-step:last-child {
    border-bottom: none;
}

.ggd-step-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #2563eb;
    flex-shrink: 0;
}

.ggd-step-text {
    flex: 1;
    color: #1e293b;
}

.ggd-step-dist {
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Route markers */
.ggd-marker-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.ggd-marker-start {
    background: #22c55e;
}

.ggd-marker-user {
    background: #3b82f6;
    width: 20px;
    height: 20px;
    animation: ggd-pulse 2s infinite;
}

@keyframes ggd-pulse {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* Near Me button */
#ggd-near-me-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

#ggd-near-me-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

#ggd-near-me-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    #ggd-single-map {
        height: 250px;
    }

    .ggd-directions-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .ggd-directions-apps {
        flex-wrap: wrap;
    }

    #ggd-directions-panel {
        max-height: 300px;
    }
}
