/* Full Screen Geohash Map Tool Styles */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: #f5f5f7;
}

/* Full screen map */
.map-display {
    width: 100vw;
    height: 100vh;
    z-index: 1;
    outline: none;
}

/* Top Panel - Search and Coordinates */
.top-panel {
    position: fixed;
    top: 36px; /* Account for navigation menu */
    left: 50%;
    transform: translateX(-50%);
    /*background: rgba(255, 255, 255, 0.95);*/
    /*backdrop-filter: blur(10px);*/
    border-radius: 12px;
    padding: 20px;
    /*box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);*/
    z-index: 100; /* Lower than navigation menu */
    display: flex;
    gap: 20px;
    align-items: stretch; /* Align all items to same height */
    min-width: 1100px;
    max-width: 95vw;
    /*border: 1px solid rgba(255, 255, 255, 0.3);*/

    backdrop-filter:
            blur(20px) /* Slightly reduced blur for better performance */
            saturate(150%) /* Increased saturation for richer colors */
            brightness(1.05) /* Slight brightness boost */
            contrast(1.25); /* Improved contrast */
    -webkit-backdrop-filter:
            blur(20px)
            saturate(150%)
            brightness(1.05)
            contrast(1.25);

    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.2);


    /* Glass-like border */
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* Adds depth */

    /* More realistic glass shadow */
    box-shadow:
            inset 0 1px 2px rgba(255, 255, 255, 0.015), /* Inner glow */
            inset 0 -1px 1px rgba(74, 73, 73, 0.015), /* Inner shadow at bottom */
            0 4px 6px -1px rgba(69, 68, 68, 0.015), /* Soft outer shadow */
            0 2px 4px -1px rgba(73, 72, 72, 0.015);

    /* Glass texture simulation */
    /*position: sticky;*/
    /*top: 0;*/
    /*z-index: 999;*/

    /* Transition for smooth state changes */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Improved text visibility */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Search Section */
.search-section {
    position: relative;
    min-width: 350px;
    flex-shrink: 0;
    display: flex;
    align-items: center; /* Center vertically */
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e3e3e3;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease;
    height: 48px; /* Fixed height to match coordinate fields */
    width: 100%;
}

.search-input-wrapper:focus-within {
    border-color: #4a817b;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-size: 16px;
    outline: none;
    color: #333;
}

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

.search-btn {
    padding: 12px 16px;
    background: #4a817b;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.search-btn:hover {
    background: #5a959d;
}

.search-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background: #f8f9fa;
}

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

.search-result-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.search-result-subtitle {
    font-size: 14px;
    color: #666;
}

/* Coordinates Section */
.coordinates-section {
    display: flex;
    gap: 16px;
    flex: 1;
    min-width: 0; /* Allow shrinking */
    align-items: stretch; /* Match height with search */
}

.coordinate-group {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
    gap: 6px;
    flex: 1;
    min-width: 180px; /* Prevent wrapping */
}

.coordinate-label {
    font-weight: 600;
    color: #4a817b;
    font-size: 12px;
    padding-left:2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.coordinate-value-container {
    display: flex;
    align-items: center;
    /*gap: 8px;*/
    background: white;
    padding-left: 3px;
    border-radius: 8px;
    border: 2px solid #e3e3e3;
    transition: border-color 0.2s ease;
    height: 48px; /* Fixed height to match search input */
}

.coordinate-value-container:hover {
    border-color: #4a817b;
}

.coordinate-value {
    flex: 1;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    color: #333;
    word-break: break-all;
    padding: 0 8px 0 8px;
}

.copy-btn {
    padding: 8px;
    background: transparent;
    border: 1px solid #e3e3e3;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    outline: none;
}

.copy-btn:hover:not(:disabled) {
    background: #4a817b;
    color: white;
    border-color: #4a817b;
}

.copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.copy-btn.success {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

/* Action Buttons - Bottom Center */
.action-buttons {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 1000;
}

.btn {
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 14px;
    outline: none;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: rgba(74, 129, 123, 0.95);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: rgba(90, 149, 157, 0.95);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.95);
    color: #4a817b;
    border: 2px solid #4a817b;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(74, 129, 123, 0.95);
    color: white;
}

/* Custom Zoom Controls Position */
.leaflet-control-zoom {
    position: fixed !important;
    top: 50% !important;
    right: 20px !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    z-index: 1000 !important;
}

/* Status Message */
.status-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 2000;
    max-width: 300px;
}

.status-message.show {
    transform: translateX(0);
}

.status-message.success {
    background: #28a745;
}

.status-message.error {
    background: #dc3545;
}

.status-message.info {
    background: #17a2b8;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
}

.leaflet-popup-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.4;
    margin: 12px 16px;
    min-width: 200px;
}

.popup-title {
    font-weight: 600;
    color: #4a817b;
    margin-bottom: 8px;
    font-size: 16px;
}

.popup-coordinates {
    font-size: 14px;
    color: #666;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.4;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4a817b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom Marker Styles */
.custom-marker {
    background: #4a817b;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

.custom-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .top-panel {
        min-width: 1000px;
        max-width: calc(100vw - 20px);
    }

    .coordinate-group {
        min-width: 160px;
    }
}

@media (max-width: 1024px) {
    .top-panel {
        min-width: 700px;
        max-width: calc(100vw - 20px);
        top: 70px;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .search-section {
        min-width: auto;
        width: 100%;
    }

    .coordinates-section {
        gap: 12px;
        width: 100%;
    }

    .coordinate-group {
        min-width: 180px;
    }
}

@media (max-width: 768px) {
    .top-panel {
        min-width: 320px;
        max-width: calc(100vw - 20px);
        padding: 16px;
        flex-direction: column;
        gap: 16px;
        top: 60px;
    }

    .search-section {
        min-width: auto;
    }

    .coordinates-section {
        gap: 12px;
    }

    .coordinate-group {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        min-width: auto;
    }

    .coordinate-label {
        min-width: 80px;
        font-size: 11px;
    }

    .coordinate-value {
        font-size: 12px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .top-panel {
        top: 50px;
        min-width: 300px;
        padding: 12px;
    }

    .coordinate-group {
        flex-direction: column;
        gap: 6px;
    }

    .coordinate-label {
        min-width: auto;
        font-size: 10px;
    }

    .coordinate-value {
        font-size: 11px;
    }

    .status-message {
        top: auto;
        bottom: 100px;
        right: 20px;
        left: 20px;
        transform: translateY(100%);
        max-width: none;
    }

    .status-message.show {
        transform: translateY(0);
    }

    .leaflet-control-zoom {
        right: 10px !important;
    }
}