/* Map Container */
.map-container {
    position: relative;
    height: calc(100vh - 60px);
}

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

/* Popup Styling */
.maplibregl-popup-content {
    background: #fff;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.maplibregl-popup-close-button {
    font-size: 18px;
    padding: 4px 8px;
    color: #666;
}

.maplibregl-popup-close-button:hover {
    background: transparent;
    color: #333;
}

.maplibregl-popup-content .popup-content {
    padding: 12px 14px;
    color: #000 !important;
    font-size: 0.9rem;
    line-height: 1.5;
}

.maplibregl-popup-content .popup-title {
    font-weight: 600;
    font-size: 1rem;
    color: #000 !important;
    margin-bottom: 2px;
}

.maplibregl-popup-content .popup-type {
    color: #000 !important;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.maplibregl-popup-content .popup-address {
    color: #000 !important;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.maplibregl-popup-content .popup-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.maplibregl-popup-content .popup-contact a {
    color: #000 !important;
    text-decoration: underline;
    font-size: 0.85rem;
}

/* Controls */
.maplibregl-ctrl-group {
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.maplibregl-ctrl-scale {
    font-size: 11px;
    border-radius: 3px;
}

/* Drop Pin Button */
#drop-pin-btn {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#drop-pin-btn:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

#drop-pin-btn:active {
    transform: translateX(-50%) scale(0.98);
}

#drop-pin-btn.active {
    background: #16a34a;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4);
}

#drop-pin-btn.active:hover {
    background: #15803d;
}

#drop-pin-btn svg {
    flex-shrink: 0;
}

/* Name Input Modal */
.name-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.name-modal.visible {
    opacity: 1;
    visibility: visible;
}

.name-modal-content {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.name-modal.visible .name-modal-content {
    transform: translateY(0);
}

.name-modal-content h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #111;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#location-name-input {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#location-name-input:focus {
    border-color: #2563eb;
}

.address-display {
    font-size: 14px;
    color: #6b7280;
    margin-top: 8px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    line-height: 1.4;
}

#location-name-input.error {
    border-color: #ef4444;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.name-modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.name-modal-buttons button {
    flex: 1;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.btn-cancel {
    background: #f3f4f6;
    color: #374151;
}

.btn-cancel:hover {
    background: #e5e7eb;
}

.btn-save {
    background: #2563eb;
    color: white;
}

.btn-save:hover {
    background: #1d4ed8;
}

.btn-save:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

/* Desktop adjustments */
@media (min-width: 768px) {
    .name-modal {
        align-items: center;
    }

    .name-modal-content {
        border-radius: 16px;
        max-width: 400px;
    }
}

/* Emoji Marker */
.emoji-marker {
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease;
}

.emoji-marker:hover {
    transform: scale(1.15);
}
