/* Import modern fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

/* Institution Dropdown Styles */
.institution-dropdown {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 280px;
    text-align: center;
}

.institution-dropdown label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.search-container {
    position: relative;
    width: 100%;
}

.institution-dropdown input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: white;
    color: #333;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.institution-dropdown input[type="text"]:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.institution-dropdown input[type="text"]:hover {
    border-color: #bbb;
}

.institution-dropdown select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.institution-dropdown select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.institution-dropdown select:hover {
    border-color: #bbb;
}

.search-divider {
    text-align: center;
    margin: 12px 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
    z-index: 1;
}

.search-divider span {
    background: rgba(255, 255, 255, 0.95);
    padding: 0 12px;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

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

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

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

.search-result-item.selected {
    background-color: #e3f2fd;
    color: #1976d2;
}

.search-result-item .highlight {
    background-color: #fff3cd;
    font-weight: 600;
    padding: 1px 2px;
    border-radius: 2px;
}

#institution-dropdown-message {
    font-size: 12px;
    color: #666;
    margin: 0;
    text-align: left;
    margin-top: 8px;
    font-weight: bold;
}

#map-controls {
    display: flex;
    flex-direction: column;
}

#map-controls .map-button {
    padding: 8px 12px;
    font-size: 12px;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#map-controls .map-button svg {
    flex-shrink: 0;
}

#map-controls .map-button span {
    font-weight: 500;
}

.button-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.map-button {
    background: white;
    border: 2px solid #ccc;
    border-radius: 5px;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    width: 100%;
}

.map-button:hover {
    background: #f0f0f0;
    border-color: #999;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.map-button:active {
    transform: translateY(1px);
}

.sync-button {
    background: #4CAF50;
    color: white;
    border-color: #45a049;
}

.sync-button:hover {
    background: #45a049;
}

.save-button {
    background: #2196F3;
    color: white;
    border-color: #1976D2;
    margin-top: 10px;
}

.save-button:hover {
    background: #1976D2;
}

.auth-button {
    background: white;
    color: #4285f4;
    border-color: #4285f4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-button:hover {
    background: #f8f9fa;
    border-color: #3367d6;
    color: #3367d6;
}

.auth-button img {
    opacity: 0.9;
    vertical-align: middle;
    margin: 0;
}

.signout-button {
    background: #f44336;
    color: white;
    border-color: #d32f2f;
}

.signout-button:hover {
    background: #d32f2f;
}

.user-profile {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 25px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-details {
    margin-right: 16px;
    margin-left: 10px;
    flex: 1;
}

.user-name {
    color: #333;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    line-height: 1.2;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.user-email {
    color: #666;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.logout-button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    min-width: 36px;
    min-height: 36px;
}

.logout-button:hover {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    transform: scale(1.05);
}

.logout-button:active {
    transform: scale(0.95);
}

#user-info {
    text-align: center;
}

/* Editable Popup Styles */
.editable-popup .leaflet-popup-content {
    margin: 0;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 350px !important;
}

.feature-editor {
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
}

.feature-editor h4 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.property-row {
    margin-bottom: 12px;
}

.property-row label {
    display: block;
    margin-bottom: 4px;
    color: #555;
    font-size: 13px;
    font-weight: 500;
}

.property-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: white;
    color: #333;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.property-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.property-input:hover {
    border-color: #bbb;
}

.property-dropdown {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: white;
    color: #333;
    transition: all 0.2s ease;
    box-sizing: border-box;
    cursor: pointer;
}

.property-dropdown:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.property-dropdown:hover {
    border-color: #bbb;
}

.button-row {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.save-properties-btn,
.cancel-properties-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-properties-btn {
    background: #4CAF50;
    color: white;
}

.save-properties-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.cancel-properties-btn {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.cancel-properties-btn:hover {
    background: #e0e0e0;
    color: #333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.save-properties-btn:active,
.cancel-properties-btn:active {
    transform: translateY(0);
}

/* Success message animation */
.success-message {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Custom scrollbar styling for the popup */
.editable-popup .leaflet-popup-content::-webkit-scrollbar {
    width: 8px;
}

.editable-popup .leaflet-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.editable-popup .leaflet-popup-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.editable-popup .leaflet-popup-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox scrollbar styling */
.editable-popup .leaflet-popup-content {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}
