/* ═══════════════════════════════════════════════════════════════════
   omMap Interactive — Full-screen map UI styles
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --om-primary: #1a73e8;
    --om-primary-dark: #1557b0;
    --om-primary-light: rgba(26, 115, 232, 0.12);
    --om-surface: #ffffff;
    --om-surface-hover: #f8f9fa;
    --om-bg: #f0f2f5;
    --om-text: #202124;
    --om-text-secondary: #5f6368;
    --om-text-muted: #9aa0a6;
    --om-border: #dadce0;
    --om-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    --om-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.18);
    --om-radius: 12px;
    --om-radius-sm: 8px;
    --om-green: #34a853;
    --om-orange: #ea8600;
    --om-red: #ea4335;
    --om-blue: #4285f4;
}

/* ─── Full-screen Map Container ───────────────────────────────── */

#ommap-container {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

#ommap-map {
    width: 100%;
    height: 100%;
}

/* ─── Search Bar ──────────────────────────────────────────────── */

.ommap-search-wrapper {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 540px;
}

.ommap-search-box {
    display: flex;
    align-items: center;
    background: var(--om-surface);
    border-radius: 28px;
    box-shadow: var(--om-shadow-lg);
    padding: 4px 16px;
    gap: 8px;
    transition: box-shadow 0.2s ease;
}

.ommap-search-box:focus-within {
    box-shadow: 0 4px 20px rgba(26, 115, 232, 0.3);
}

.ommap-search-icon {
    color: var(--om-primary);
    font-size: 20px;
    flex-shrink: 0;
}

.ommap-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--om-text);
    background: transparent;
    padding: 12px 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.ommap-search-input::placeholder {
    color: var(--om-text-muted);
}

.ommap-search-clear {
    cursor: pointer;
    color: var(--om-text-muted);
    font-size: 18px;
    padding: 4px;
    border-radius: 50%;
    display: none;
    transition: background 0.15s;
}

.ommap-search-clear:hover {
    background: var(--om-primary-light);
    color: var(--om-text);
}

.ommap-search-clear.visible {
    display: block;
}

/* Search Results Dropdown */

.ommap-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--om-surface);
    border-radius: var(--om-radius);
    box-shadow: var(--om-shadow-lg);
    max-height: 380px;
    overflow-y: auto;
    display: none;
}

.ommap-search-results.visible {
    display: block;
}

.ommap-search-results::-webkit-scrollbar {
    width: 6px;
}

.ommap-search-results::-webkit-scrollbar-thumb {
    background: var(--om-border);
    border-radius: 3px;
}

.ommap-result-section {
    padding: 8px 0;
}

.ommap-result-section + .ommap-result-section {
    border-top: 1px solid var(--om-border);
}

.ommap-result-section-title {
    padding: 4px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--om-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ommap-result-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    gap: 12px;
    transition: background 0.12s;
}

.ommap-result-item:hover,
.ommap-result-item.active {
    background: var(--om-surface-hover);
}

.ommap-result-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.ommap-result-icon.saved {
    background: rgba(234, 134, 0, 0.12);
    color: var(--om-orange);
}

.ommap-result-icon.nominatim {
    background: var(--om-primary-light);
    color: var(--om-primary);
}

.ommap-result-text {
    flex: 1;
    min-width: 0;
}

.ommap-result-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--om-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ommap-result-address {
    font-size: 12px;
    color: var(--om-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.ommap-search-loading {
    display: none;
    padding: 20px;
    text-align: center;
    color: var(--om-text-muted);
    font-size: 13px;
}

.ommap-search-loading.visible {
    display: block;
}

/* ─── Place Info Panel ────────────────────────────────────────── */

.ommap-place-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 95%;
    max-width: 480px;
    background: var(--om-surface);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px 20px 20px;
    display: none;
    animation: slideUp 0.25s ease-out;
}

.ommap-place-panel.visible {
    display: block;
}

@keyframes slideUp {
    from { transform: translateX(-50%) translateY(100%); }
    to { transform: translateX(-50%) translateY(0); }
}

.ommap-place-drag-handle {
    width: 36px;
    height: 4px;
    background: var(--om-border);
    border-radius: 2px;
    margin: 0 auto 12px;
}

.ommap-place-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ommap-place-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    background: rgba(234, 67, 53, 0.12);
    color: var(--om-red);
}

.ommap-place-icon.saved {
    background: rgba(234, 134, 0, 0.12);
    color: var(--om-orange);
}

.ommap-place-details {
    flex: 1;
    min-width: 0;
}

.ommap-place-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--om-text);
    margin-bottom: 4px;
    line-height: 1.3;
}

.ommap-place-address {
    font-size: 13px;
    color: var(--om-text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ommap-place-coords {
    font-size: 11px;
    color: var(--om-text-muted);
    font-family: 'Roboto Mono', monospace;
    margin-top: 4px;
    cursor: pointer;
    transition: color 0.15s;
}

.ommap-place-coords:hover {
    color: var(--om-primary);
}

.ommap-place-close {
    cursor: pointer;
    color: var(--om-text-muted);
    font-size: 20px;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.15s;
    flex-shrink: 0;
}

.ommap-place-close:hover {
    background: var(--om-primary-light);
}

.ommap-place-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.ommap-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    font-family: inherit;
}

.ommap-btn-primary {
    background: var(--om-primary);
    color: #fff;
}

.ommap-btn-primary:hover {
    background: var(--om-primary-dark);
}

.ommap-btn-outline {
    background: transparent;
    color: var(--om-primary);
    border: 1.5px solid rgba(26, 115, 232, 0.4);
}

.ommap-btn-outline:hover {
    background: var(--om-primary-light);
}

/* ─── Route Panel ─────────────────────────────────────────────── */

.ommap-route-panel {
    position: fixed;
    top: 80px;
    left: 16px;
    z-index: 1000;
    width: 340px;
    max-height: calc(100vh - 120px);
    background: var(--om-surface);
    border-radius: var(--om-radius);
    box-shadow: var(--om-shadow-lg);
    display: none;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

.ommap-route-panel.visible {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ommap-route-header {
    padding: 16px;
    border-bottom: 1px solid var(--om-border);
}

.ommap-route-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ommap-route-distance {
    font-size: 22px;
    font-weight: 700;
    color: var(--om-primary);
}

.ommap-route-duration {
    font-size: 15px;
    color: var(--om-text-secondary);
}

.ommap-route-via {
    font-size: 12px;
    color: var(--om-text-muted);
    margin-top: 4px;
}

.ommap-route-eta {
    font-size: 13px;
    color: var(--om-green);
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(52, 168, 83, 0.1);
}

/* Transport Mode Chips */

.ommap-mode-chips {
    display: flex;
    gap: 8px;
}

.ommap-mode-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid var(--om-border);
    background: transparent;
    color: var(--om-text-secondary);
    transition: all 0.15s;
}

.ommap-mode-chip.active {
    background: var(--om-primary-light);
    border-color: var(--om-primary);
    color: var(--om-primary);
}

.ommap-mode-chip:hover:not(.active) {
    border-color: var(--om-text-muted);
}

/* Route Steps */

.ommap-route-steps {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.ommap-route-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 16px;
    transition: background 0.12s;
}

.ommap-route-step:hover {
    background: var(--om-surface-hover);
}

.ommap-step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--om-primary-light);
    color: var(--om-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.ommap-step-text {
    flex: 1;
}

.ommap-step-instruction {
    font-size: 14px;
    color: var(--om-text);
    font-weight: 500;
}

.ommap-step-distance {
    font-size: 12px;
    color: var(--om-text-muted);
    margin-top: 2px;
}

.ommap-route-close {
    padding: 12px 16px;
    border-top: 1px solid var(--om-border);
    text-align: center;
}

/* Route alternatives */

.ommap-route-alt-list {
    padding: 0 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ommap-route-alt-card {
    padding: 10px 14px;
    border-radius: var(--om-radius-sm);
    border: 1.5px solid var(--om-border);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ommap-route-alt-card:hover {
    border-color: var(--om-primary);
    background: var(--om-primary-light);
}

.ommap-route-alt-card.selected {
    border-color: var(--om-primary);
    background: var(--om-primary-light);
}

/* ─── Map Controls (FABs) ─────────────────────────────────────── */

.ommap-controls {
    position: fixed;
    bottom: 24px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ommap-fab {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--om-surface);
    box-shadow: var(--om-shadow);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--om-text-secondary);
    transition: all 0.15s;
}

.ommap-fab:hover {
    box-shadow: var(--om-shadow-lg);
    color: var(--om-primary);
}

.ommap-fab.active {
    background: var(--om-primary);
    color: #fff;
}

/* Pulsing blue dot for my location */

.ommap-my-location-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--om-primary);
    border: 3px solid #fff;
    box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.4);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.4); }
    70% { box-shadow: 0 0 0 14px rgba(26, 115, 232, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0); }
}

/* ─── Context Menu ────────────────────────────────────────────── */

.ommap-context-menu {
    position: fixed;
    z-index: 2000;
    background: var(--om-surface);
    border-radius: var(--om-radius-sm);
    box-shadow: var(--om-shadow-lg);
    padding: 6px 0;
    display: none;
    min-width: 180px;
}

.ommap-context-menu.visible {
    display: block;
}

.ommap-context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--om-text);
    transition: background 0.12s;
}

.ommap-context-item:hover {
    background: var(--om-surface-hover);
}

.ommap-context-item .material-icons {
    font-size: 18px;
    color: var(--om-text-secondary);
}

/* ─── Sovereignty Markers ─────────────────────────────────────── */

.ommap-sovereignty-label {
    background: rgba(234, 67, 53, 0.08);
    color: #c5221f;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(234, 67, 53, 0.2);
    white-space: nowrap;
    letter-spacing: 0.3px;
    font-family: 'Inter', sans-serif;
}

/* ─── Toast Notification ──────────────────────────────────────── */

.ommap-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    background: #323232;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: var(--om-shadow-lg);
    display: none;
    animation: fadeInUp 0.2s ease-out;
}

.ommap-toast.visible {
    display: block;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

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

@media (max-width: 768px) {
    .ommap-route-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 50vh;
    }

    .ommap-search-wrapper {
        width: 92%;
    }
}
