/* OpenStreetMap-style Map Interface */

.osm-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    height: 100vh;
}

/* Override standard header for map page - needs to be fixed position */
.osm-body header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Map Wrapper - positioned below fixed header */
.osm-map-wrapper {
    position: fixed;
    top: 73px; /* Adjust for header height */
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

/* Sidebar */
.osm-sidebar {
    width: 350px;
    background: white;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    z-index: 900;
    transition: transform 0.3s;
}

.osm-sidebar.collapsed {
    transform: translateX(-350px);
}

.osm-sidebar-header {
    display: flex;
    background: #f8f8f8;
    border-bottom: 1px solid #ccc;
    position: relative;
}

.osm-sidebar-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #666;
    transition: all 0.2s;
}

.osm-sidebar-tab:hover {
    background: #e8e8e8;
}

.osm-sidebar-tab.active {
    background: white;
    color: #7ebc6f;
    border-bottom: 2px solid #7ebc6f;
}

.osm-sidebar-close {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    display: none;
}

.osm-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.osm-tab-panel {
    display: none;
}

.osm-tab-panel.active {
    display: block;
}

.osm-tab-panel h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.osm-tab-panel h4 {
    margin: 15px 0 10px 0;
    font-size: 14px;
    color: #666;
}

/* Search */
.osm-search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.osm-search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.osm-search-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #7ebc6f;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.osm-search-btn:hover {
    background: #6aa85f;
}

.osm-search-results {
    max-height: 400px;
    overflow-y: auto;
}

.osm-search-results:empty {
    display: none;
    height: 0;
    min-height: 0;
}

.osm-search-result {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.osm-search-result:hover {
    background: #f8f8f8;
    border-color: #7ebc6f;
}

.osm-search-result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.osm-search-result-address {
    font-size: 13px;
    color: #666;
}

.osm-quick-links {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.osm-quick-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.osm-quick-btn:hover {
    background: #f8f8f8;
    border-color: #7ebc6f;
}

/* Layers */
.osm-layer-list {
    margin-bottom: 20px;
}

.osm-layer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.osm-layer-item:hover {
    background: #f8f8f8;
}

.osm-layer-item input {
    cursor: pointer;
}

/* Share */
.osm-share-section {
    margin-bottom: 20px;
}

.osm-share-link {
    display: flex;
    gap: 8px;
}

.osm-share-link input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.osm-btn-copy {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #7ebc6f;
    color: white;
    cursor: pointer;
    font-size: 13px;
}

.osm-btn-copy:hover {
    background: #6aa85f;
}

.osm-embed-code {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    margin-bottom: 8px;
    resize: vertical;
}

.osm-export-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.osm-export-btn:hover {
    background: #f8f8f8;
    border-color: #7ebc6f;
}

/* GPS */
.osm-gps-info {
    background: #f8f8f8;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.osm-gps-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.osm-gps-item:last-child {
    border-bottom: none;
}

.osm-gps-label {
    font-weight: 600;
    color: #666;
}

.osm-gps-value {
    color: #333;
}

.osm-gps-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.osm-gps-btn {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #7ebc6f;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.osm-gps-btn:hover {
    background: #6aa85f;
}

.osm-gps-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.osm-gps-option input {
    cursor: pointer;
}

/* Map Container */
.osm-map-container {
    flex: 1;
    position: relative;
    min-height: 0; /* Important for flex children */
}

.osm-map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* Map Controls */
.osm-map-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 800;
}

.osm-control-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.osm-control-btn:hover {
    background: #f0f0f0;
}

.osm-control-btn.active {
    background: #7ebc6f;
    color: white;
}

/* Map Info */
.osm-map-info {
    position: absolute;
    bottom: 30px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 15px;
    z-index: 800;
}

/* Attribution */
.osm-attribution {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 8px;
    font-size: 11px;
    z-index: 800;
}

.osm-attribution a {
    color: #7ebc6f;
    text-decoration: none;
}

.osm-attribution a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .osm-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 950;
    }

    .osm-sidebar-close {
        display: block;
    }

    .osm-nav-menu {
        display: none;
    }

    .osm-map-controls {
        top: 10px;
        right: 10px;
        left: auto;
    }
}

/* MapLibre Overrides */
.maplibregl-ctrl-attrib {
    display: none;
}

.maplibregl-ctrl-bottom-right {
    display: none;
}
