/**
 * Weather Widget Styles for CicloBanat
 */

/* Weather Marker Container */
.weather-marker-container {
    background: transparent !important;
    border: none !important;
}

.weather-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid #2c5aa0;
    min-width: 55px;
    position: relative;
}

.weather-marker::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid #2c5aa0;
}

.weather-marker-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-marker-icon img {
    width: 35px;
    height: 35px;
}

.weather-marker-temp {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-top: -5px;
}

.weather-marker-score {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: white;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Cycling Score Colors */
.cycling-score.excellent,
.weather-marker.excellent {
    border-color: #28a745;
}
.cycling-score.excellent {
    background: #28a745;
}

.cycling-score.good,
.weather-marker.good {
    border-color: #5cb85c;
}
.cycling-score.good {
    background: #5cb85c;
}

.cycling-score.moderate,
.weather-marker.moderate {
    border-color: #ffc107;
}
.cycling-score.moderate {
    background: #ffc107;
    color: #333;
}

.cycling-score.poor,
.weather-marker.poor {
    border-color: #fd7e14;
}
.cycling-score.poor {
    background: #fd7e14;
}

.cycling-score.not-recommended,
.weather-marker.not-recommended {
    border-color: #dc3545;
}
.cycling-score.not-recommended {
    background: #dc3545;
}

/* Weather Popup */
.weather-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
}

.weather-popup .leaflet-popup-content {
    margin: 0;
    width: 280px !important;
}

.weather-popup-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.weather-popup-title {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3a5f 100%);
    color: white;
    padding: 12px 15px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.weather-popup-title i {
    margin-right: 8px;
}

.weather-popup-main {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.weather-popup-icon {
    width: 70px;
    height: 70px;
    margin-right: 10px;
}

.weather-popup-temp {
    display: flex;
    flex-direction: column;
}

.weather-popup-temp .temp-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    line-height: 1;
}

.weather-popup-temp .temp-condition {
    font-size: 14px;
    color: #666;
    text-transform: capitalize;
    margin-top: 5px;
}

.weather-popup-details {
    padding: 12px 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: white;
    border-bottom: 1px solid #eee;
}

.weather-detail {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #555;
}

.weather-detail i {
    width: 20px;
    color: #2c5aa0;
    margin-right: 6px;
}

.weather-popup-cycling {
    padding: 12px 15px;
    background: white;
}

.cycling-header {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.cycling-header i {
    margin-right: 6px;
    color: #2c5aa0;
}

.cycling-score-display {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: white;
}

.cycling-score-display.excellent {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.cycling-score-display.good {
    background: linear-gradient(135deg, #5cb85c, #28a745);
}

.cycling-score-display.moderate {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #333;
}

.cycling-score-display.poor {
    background: linear-gradient(135deg, #fd7e14, #dc3545);
}

.cycling-score-display.not-recommended {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.cycling-score-display .score-value {
    font-size: 24px;
    font-weight: bold;
    margin-right: 10px;
}

.cycling-score-display .score-label {
    font-size: 13px;
    flex: 1;
}

.weather-popup-warnings {
    padding: 12px 15px;
    background: #fff3cd;
    border-top: 1px solid #ffc107;
}

.weather-popup-warnings strong {
    color: #856404;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.weather-popup-warnings i {
    margin-right: 6px;
    color: #ffc107;
}

.weather-popup-warnings ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
    font-size: 12px;
    color: #856404;
}

.weather-popup-warnings li {
    margin-bottom: 4px;
}

/* Weather Summary Widget */
.weather-summary-widget {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.weather-summary-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.weather-summary-header img {
    margin-right: 10px;
}

.weather-summary-temp {
    display: flex;
    flex-direction: column;
}

.weather-summary-temp .temp {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.weather-summary-temp .location {
    font-size: 14px;
    color: #666;
}

.weather-summary-cycling {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    color: white;
    margin-bottom: 10px;
}

.weather-summary-cycling i {
    margin-right: 8px;
}

.weather-summary-cycling span {
    flex: 1;
}

.weather-summary-cycling .score {
    font-weight: bold;
}

.weather-summary-updated {
    text-align: center;
    color: #999;
}

.weather-summary-loading,
.weather-summary-error {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* Weather Legend */
.weather-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.weather-legend-item {
    display: flex;
    align-items: center;
    font-size: 13px;
}

.weather-legend-item .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 6px;
}

.weather-legend-item .legend-color.excellent {
    background: #28a745;
}

.weather-legend-item .legend-color.good {
    background: #5cb85c;
}

.weather-legend-item .legend-color.moderate {
    background: #ffc107;
}

.weather-legend-item .legend-color.poor {
    background: #fd7e14;
}

.weather-legend-item .legend-color.not-recommended {
    background: #dc3545;
}

/* Weather Card for Pages */
.weather-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.weather-card-header {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3a5f 100%);
    color: white;
    padding: 15px 20px;
}

.weather-card-header h5 {
    margin: 0;
    font-weight: 600;
}

.weather-card-body {
    padding: 20px;
}

.weather-locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.weather-location-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.weather-location-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.weather-location-icon {
    width: 50px;
    height: 50px;
    margin-right: 12px;
}

.weather-location-info {
    flex: 1;
}

.weather-location-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.weather-location-temp {
    font-size: 20px;
    font-weight: bold;
    color: #2c5aa0;
}

.weather-location-condition {
    font-size: 12px;
    color: #666;
    text-transform: capitalize;
}

.weather-location-score {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
}

/* Map Controls */
.leaflet-control-weather {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    padding: 8px;
}

.leaflet-control-weather button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #2c5aa0;
    font-size: 18px;
}

.leaflet-control-weather button:hover {
    color: #1e3a5f;
}

/* Responsive */
@media (max-width: 768px) {
    .weather-popup .leaflet-popup-content {
        width: 260px !important;
    }
    
    .weather-popup-details {
        grid-template-columns: 1fr;
    }
    
    .weather-locations-grid {
        grid-template-columns: 1fr;
    }
}
