:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --bg-glass: rgba(255, 255, 255, 0.95);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    overflow: hidden;
    /* Prevent scrollbars */
}

#app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Search Wrapper */
.search-wrapper {
    position: absolute;
    top: 24px;
    left: 24px;
    width: 380px;
    z-index: 1000;
    /* Above map */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
}

.search-box:focus-within {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 12px;
}

#search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-main);
    outline: none;
    font-family: inherit;
}

#search-input::placeholder {
    color: #94a3b8;
}

#clear-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#clear-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.hidden {
    display: none !important;
}

/* Results Dropdown */
.results-container {
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.15s;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover {
    background: rgba(37, 99, 235, 0.05);
}

.result-name {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 2px;
}

.result-name .short-name {
    font-weight: 400;
    color: var(--primary);
    font-size: 14px;
}

.result-details {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Scrollbar styling */
.results-container::-webkit-scrollbar {
    width: 8px;
}

.results-container::-webkit-scrollbar-track {
    background: transparent;
}

.results-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .search-wrapper {
        top: 16px;
        left: 16px;
        right: 16px;
        width: auto;
    }
}

/* Popup Navigation Buttons */
.popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.nav-btn,
.qr-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-btn {
    background-color: var(--primary);
    color: white !important;
}

.nav-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.qr-btn {
    background-color: #f1f5f9;
    color: var(--text-main);
}

.qr-btn:hover {
    background-color: #e2e8f0;
    transform: translateY(-1px);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.close-btn:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.modal-content h3 {
    margin-bottom: 24px;
    font-weight: 600;
}

#qrcode {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    padding: 16px;
    background: white;
    border-radius: 12px;
}

.modal-content p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}