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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main Content */
main {
    padding: 2rem 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    height: calc(100vh - 200px);
}

/* Mapa */
.map-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

#map {
    height: 100%;
    width: 100%;
    min-height: 500px;
}

/* Painel de Controle */
.control-panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 1.5rem;
    overflow-y: auto;
}

.control-panel h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ecf0f1;
    font-size: 1.1rem;
}

/* Filtros */
.filters-section {
    margin-bottom: 2rem;
}

.category-filter {
    margin-bottom: 1rem;
}

.category-filter label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.category-filter select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    background: white;
    min-height: 120px;
}

.category-filter select:focus {
    outline: none;
    border-color: #3498db;
}

/* Botões */
.btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin: 0.25rem;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Itinerário */
.itinerary-section {
    margin-bottom: 2rem;
}

.itinerary-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
}

.itinerary-item {
    background: white;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 5px;
    border-left: 4px solid #3498db;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.itinerary-item:last-child {
    margin-bottom: 0;
}

.itinerary-item .remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 0.8rem;
}

.empty-message {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
}

.itinerary-actions {
    display: flex;
    gap: 0.5rem;
}

/* Locais de Interesse */
.places-section {
    margin-bottom: 1rem;
}

.place-types {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.place-types label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.place-types label:hover {
    background-color: #f1f2f6;
}

.place-types input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: slideIn 0.3s ease;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Estilos para marcadores do itinerário */
.itinerary-marker {
    background: #e74c3c;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.itinerary-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.itinerary-number {
    font-size: 14px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Popup do itinerário */
.itinerary-popup {
    min-width: 200px;
}

.itinerary-popup h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-size: 1.1rem;
}

.itinerary-popup p {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    color: #666;
}

.itinerary-popup .btn-remove {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    transition: background 0.3s ease;
}

.itinerary-popup .btn-remove:hover {
    background: #c0392b;
}

.itinerary-popup .btn-remove i {
    margin-right: 0.3rem;
}

/* Linha do itinerário */
.leaflet-interactive {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Responsividade */
@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: 400px 1fr;
        height: auto;
    }
    
    .control-panel {
        order: -1;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .itinerary-marker {
        width: 30px !important;
        height: 30px !important;
    }
    
    .itinerary-number {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 1rem;
    }
}

/* Estilos para marcadores do mapa */
.custom-marker {
    background: #3498db;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.marker-passadicos { background: #27ae60; }
.marker-monumentos { background: #8e44ad; }
.marker-vinhos { background: #c0392b; }
.marker-farois { background: #f39c12; }
.marker-igrejas { background: #34495e; }
.marker-praias { background: #3498db; }
.marker-castelos { background: #95a5a6; }

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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