/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Mapa */
#map {
    height: 100vh;
    width: 100vw;
    z-index: 1;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 20px;
    color: #666;
    font-size: 16px;
}

/* Direct Mode Message */
.direct-mode-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.direct-mode-message.hidden {
    display: none;
}

.message-container {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    text-align: center;
}

.message-container h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 28px;
}

.message-container p {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.6;
}

.message-container ol {
    text-align: left;
    margin: 20px auto;
    max-width: 400px;
    color: #555;
}

.message-container li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Buttons */
.button-group {
    margin-top: 30px;
}

.primary-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.secondary-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.secondary-button:hover {
    background: #2980b9;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #333;
}

.modal-content h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.modal-content p {
    color: #555;
    margin-bottom: 15px;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
    transition: border-color 0.2s ease;
}

.modal-content input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.link-display {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.link-display input {
    flex: 1;
    margin-bottom: 0;
}

#generated-link-container {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

#generated-link-container.hidden {
    display: none;
}

/* Error Message */
.error-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(231, 76, 60, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    transition: opacity 0.3s ease;
}

.error-message.hidden {
    display: none;
}

.error-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.error-container h3 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.error-container p {
    color: #555;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Custom Popup Styles */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 280px;
}

.point-tooltip {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.point-tooltip img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.point-tooltip-content {
    padding: 16px;
}

.point-tooltip h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 12px;
    font-weight: 600;
}

.point-tooltip p {
    color: #555;
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.point-tooltip p strong {
    color: #2c3e50;
    font-weight: 600;
}

.point-tooltip .tooltip-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 12px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .message-container {
        padding: 30px 20px;
        margin: 20px;
    }

    .message-container h2 {
        font-size: 24px;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .point-tooltip {
        min-width: 240px;
    }

    .point-tooltip img {
        height: 140px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}
