/**
 * Trail Map CSS
 * Styles for the Mt Hood Trails interactive map
 */

/* Leaflet popup styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.custom-popup .leaflet-popup-content {
    margin: 15px;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.custom-popup .leaflet-popup-content h3 {
    color: #2c5530;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Difficulty styling */
.difficulty-easy { 
    color: #28a745; 
    font-weight: bold; 
    background: rgba(40, 167, 69, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.difficulty-moderate { 
    color: #ffc107; 
    font-weight: bold; 
    background: rgba(255, 193, 7, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.difficulty-difficult { 
    color: #fd7e14; 
    font-weight: bold; 
    background: rgba(253, 126, 20, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.difficulty-expert { 
    color: #dc3545; 
    font-weight: bold; 
    background: rgba(220, 53, 69, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Trail filters styling */
#trail-filters {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#trail-filters label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

#trail-filters select {
    font-size: 14px;
    border: 2px solid #e9ecef;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#trail-filters select:focus {
    outline: none;
    border-color: #2c5530;
    box-shadow: 0 0 0 0.2rem rgba(44, 85, 48, 0.25);
}

#trail-filters button {
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
    border-radius: 5px;
    padding: 8px 14px;
}

#trail-filters button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

#fit-trails-btn:hover {
    background: #5a6268 !important;
}

#clear-selection-btn:hover {
    background: #c82333 !important;
}

#load-osm-btn:hover {
    background: #7a1fa2 !important;
}

/* Custom marker styling */
.custom-div-icon {
    background: transparent;
    border: none;
}

/* Map container */
#trail-map-container {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

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

/* Trail information sections */
#trail-info {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#trail-info h3 {
    color: #2c5530;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Detailed trail info styling */
#detailed-trail-info {
    animation: slideIn 0.3s ease-out;
}

#detailed-trail-info h3 {
    border-bottom: 2px solid #2c5530;
    padding-bottom: 8px;
}

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

/* Loading states */
.trail-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.trail-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2c5530;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Error and success messages */
.trail-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.4;
}

.trail-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.trail-message-success {
    background: #d1edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.trail-message button {
    float: right;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.trail-message button:hover {
    opacity: 1;
}

/* OSM trail styling */
.osm-trail {
    cursor: pointer;
}

.osm-trail:hover {
    opacity: 1 !important;
    weight: 4;
}

/* Responsive design */
@media (max-width: 768px) {
    #detailed-trail-info > div > div {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    #trail-filters {
        text-align: center;
    }
    
    #trail-filters button {
        margin: 5px !important;
        display: block;
        width: 100%;
    }
    
    #trail-filters select {
        width: 100%;
        margin: 10px 0;
    }
    
    #trail-filters label {
        display: block;
        margin-bottom: 10px;
    }
    
    .leaflet-popup-content-wrapper {
        max-width: 250px !important;
    }
    
    #trail-map-container {
        height: 400px;
    }
}

@media (max-width: 480px) {
    #trail-info {
        padding: 15px;
    }
    
    #detailed-trail-info div {
        padding: 15px;
    }
    
    #trail-map-container {
        height: 350px;
    }
}

/* Print styles */
@media print {
    #trail-filters {
        display: none;
    }
    
    #trail-map-container {
        break-inside: avoid;
    }
}
