/* Stili per il Widget Meteo MSV - UIkit Compatible */
.weather-widget-msv,
.weather-shortcode-widget .weather-widget-msv {
    padding: 20px !important;
    margin-bottom: 20px !important;
    max-width: 100% !important;
}
.weather-widget-msv {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
    align-content: center;
    align-items: flex-start;
}
.weather-last-update {
    flex-grow: 1;
    width: 100%;
}
.weather-widget-msv *,
.weather-shortcode-widget .weather-widget-msv * {
    box-sizing: border-box !important;
}

.weather-widget-msv .weather-item {
    margin-bottom: 20px !important;
    padding-bottom: 5px !important;
    display: block !important;
}

.weather-widget-msv .weather-item:last-child {
    border-bottom: none !important;
    margin-bottom: 10px !important;
    padding-bottom: 0 !important;
}

.weather-widget-msv .weather-item h4 {
    margin: 0 0 12px 0 !important;
    color: #9f2710 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    text-transform: uppercase;
    letter-spacing: normal !important;
    line-height: 1.5 !important;
}

.weather-widget-msv .weather-icon {
    margin-right: 8px !important;
    font-size: 18px !important;
    display: inline-block !important;
    width: 24px !important;
    text-align: center !important;
}

/* Elementi dati stile UIkit */
.weather-widget-msv .weather-item > div {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin: 6px 0 !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
}

.weather-widget-msv .weather-item > div:hover {
    background: #f0f0f0 !important;
    transition: background-color 0.15s ease-in-out !important;
}

.weather-widget-msv .label {
    color: #666 !important;
    font-weight: 400 !important;
    font-size: 13px !important;
}

.weather-widget-msv .value {
    color: #333 !important;
    font-weight: 500 !important;
    font-size: 14px !important;
}

/* Valori colorati stile UIkit */

.weather-widget-msv .temp-indoor .value, .weather-widget-msv .temp-outdoor .value, .weather-widget-msv .humidity-outdoor .value,
.weather-widget-msv .humidity-indoor .value, .weather-widget-msv .wind-speed .value,
.weather-widget-msv .wind-direction .value,
.weather-widget-msv .wind-gust .value, .weather-item.pressure .value {
    color: #9f2710 !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
}

/* Stati pioggia stile UIkit */
.weather-widget-msv .rain-status {
    margin: 8px 0 !important;
}

.weather-widget-msv .rain-status .status {
    padding: 4px 8px !important;
    border-radius: 3px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: inline-block !important;
}

.weather-widget-msv .rain-status .status.raining {
    background: #9f2710 !important;
    color: white !important;
}

.weather-widget-msv .rain-status .status.rained {
    background: #faa05a !important;
    color: white !important;
}

.weather-widget-msv .rain-status .status.no-rain {
    background: #32d296 !important;
    color: white !important;
}

/* Ultimo aggiornamento stile UIkit */
.weather-widget-msv .weather-last-update {
    text-align: center !important;
    margin-top: 0px !important;
    padding-top: 10px !important;
    border-top: 1px solid #9f2710 !important;
    color: #9f2710 !important;
}

.weather-widget-msv .weather-last-update small {
    color: #999 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Errori stile UIkit */
.weather-widget-error {
    background: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
    border-radius: 5px !important;
    padding: 15px !important;
    color: #721c24 !important;
    font-size: 14px !important;
    margin: 10px 0 !important;
}

/* Dark mode support per UIkit */
@media (prefers-color-scheme: dark) {
    .weather-widget-msv,
    .weather-shortcode-widget .weather-widget-msv {
        background: #1e1e1e !important;
        border-color: #333 !important;
        color: #e5e5e5 !important;
    }
    
    .weather-widget-msv .weather-item > div {
        background: #2a2a2a !important;
    }
    
    .weather-widget-msv .weather-item > div:hover {
        background: #333 !important;
    }
    
    .weather-widget-msv .label {
        color: #aaa !important;
    }
    
    .weather-widget-msv .value {
        color: #e5e5e5 !important;
    }
    
    .weather-widget-msv .weather-item h4 {
        color: #9f2710 !important;
    }
}

/* UIkit responsive breakpoints */
@media (max-width: 959px) {
    .weather-widget-msv {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }
    
    .weather-widget-msv .weather-item h4 {
        font-size: 15px !important;
    }
    
    .weather-widget-msv .weather-item > div {
        padding: 6px 10px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 639px) {
    .weather-widget-msv .weather-item > div {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 8px 10px !important;
    }
    
    .weather-widget-msv .value {
        margin-top: 4px !important;
        font-weight: 600 !important;
    }
    
    .weather-widget-msv .weather-icon {
        margin-right: 6px !important;
        font-size: 16px !important;
    }
}

.weather-widget-msv .weather-icon {
    margin-right: 6px;
    font-size: 16px;
}

.weather-widget-msv .weather-icon.thermometer:before {
    content: "🌡️";
}

.weather-widget-msv .weather-icon.droplet:before {
    content: "💧";
}

.weather-widget-msv .weather-icon.wind:before {
    content: "💨";
}

.weather-widget-msv .weather-icon.rain:before {
    content: "🌧️";
}

.weather-widget-msv .weather-icon.pressure:before {
    content: "🌪️";
}

.weather-widget-msv .weather-item > div {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
    font-size: 13px;
}

.weather-widget-msv .label {
    color: #666;
    font-weight: normal;
}

.weather-widget-msv .value {
    color: #333;
    font-weight: bold;
}



.weather-widget-msv .rain-status .status {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.weather-widget-msv .rain-status .status.raining {
    background: #1976d2;
    color: white;
}

.weather-widget-msv .rain-status .status.rained {
    background: #0288d1;
    color: white;
}

.weather-widget-msv .rain-status .status.no-rain {
    background: #4caf50;
    color: white;
}

.weather-widget-msv .weather-last-update {
    text-align: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.weather-widget-msv .weather-last-update small {
    color: #888;
    font-size: 11px;
}

.weather-widget-error {
    background: #ffebee;
    border: 1px solid #f44336;
    border-radius: 4px;
    padding: 10px;
    color: #c62828;
    font-size: 13px;
}

/* Stili per il Widget Webcam MSV - UIkit Compatible */
.webcam-widget-msv,
.webcam-shortcode-widget .webcam-widget-msv {
    background: #fff !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 5px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,.08) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
}

.webcam-widget-msv *,
.webcam-shortcode-widget .webcam-widget-msv * {
    box-sizing: border-box !important;
}

.webcam-container {
    position: relative !important;
    display: inline-block !important;
    border-radius: 5px !important;
    overflow: hidden !important;
    box-shadow: 0 5px 15px rgba(0,0,0,.1) !important;
    background: #000 !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    transition: box-shadow 0.1s ease-in-out !important;
}

.webcam-container:hover {
    box-shadow: 0 14px 25px rgba(0,0,0,.16) !important;
}

.webcam-container img {
    display: block !important;
    border-radius: 5px !important;
    transition: opacity 0.3s ease !important;
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
    border: none !important;
}

.webcam-container img.loading {
    opacity: 0.7 !important;
    filter: blur(1px) !important;
}

/* Overlay stile UIkit */
.webcam-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(transparent, rgba(0,0,0,0.8)) !important;
    color: white !important;
    padding: 12px !important;
    font-size: 12px !important;
}

.webcam-timestamp {
    text-align: left !important;
    margin-bottom: 8px !important;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif !important;
    font-weight: 400 !important;
    opacity: 0.9 !important;
}

.webcam-controls {
    text-align: right !important;
}

/* Pulsante stile UIkit */
.webcam-refresh-btn {
    background: rgba(30,135,240,0.9) !important;
    border: 1px solid rgba(30,135,240,0.9) !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 3px !important;
    font-size: 11px !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-weight: 500 !important;
    outline: none !important;
}

.webcam-refresh-btn:hover {
    background: rgba(30,135,240,1) !important;
    border-color: rgba(30,135,240,1) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 5px 15px rgba(30,135,240,0.4) !important;
}

.webcam-refresh-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(30,135,240,0.3) !important;
}

.webcam-refresh-btn .dashicons {
    font-size: 12px !important;
    vertical-align: text-top !important;
    margin-right: 4px !important;
}

/* Loading indicator stile UIkit */
.webcam-loading {
    text-align: center !important;
    padding: 15px !important;
    color: #666 !important;
    font-size: 13px !important;
    background: #f8f8f8 !important;
    border-radius: 5px !important;
    margin: 10px 0 !important;
}

.webcam-loading .dashicons.spin {
    animation: uk-spin 2s linear infinite !important;
    margin-right: 8px !important;
}

@keyframes uk-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Errori stile UIkit */
.webcam-widget-error {
    background: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
    border-radius: 5px !important;
    padding: 15px !important;
    color: #721c24 !important;
    font-size: 14px !important;
    margin: 10px 0 !important;
    text-align: center !important;
}

/* Dark mode support per UIkit */
@media (prefers-color-scheme: dark) {
    .webcam-widget-msv,
    .webcam-shortcode-widget .webcam-widget-msv {
        background: #1e1e1e !important;
        border-color: #333 !important;
    }
    
    .webcam-loading {
        background: #2a2a2a !important;
        color: #aaa !important;
    }
    
    .webcam-timestamp {
        color: #e5e5e5 !important;
    }
}

/* UIkit responsive breakpoints per webcam */
@media (max-width: 959px) {
    .webcam-widget-msv {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }
    
    .webcam-overlay {
        padding: 10px !important;
        font-size: 11px !important;
    }
    
    .webcam-refresh-btn {
        padding: 5px 10px !important;
        font-size: 10px !important;
    }
}

@media (max-width: 639px) {
    .webcam-overlay {
        position: static !important;
        background: rgba(0,0,0,0.85) !important;
        border-radius: 0 0 5px 5px !important;
        padding: 8px !important;
    }
    
    .webcam-timestamp,
    .webcam-controls {
        text-align: center !important;
        margin-bottom: 5px !important;
    }
    
    .webcam-controls {
        margin-bottom: 0 !important;
    }
}

.webcam-container img.loading {
    opacity: 0.7;
}

.webcam-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 8px;
    font-size: 12px;
}

.webcam-timestamp {
    text-align: left;
    margin-bottom: 5px;
}

.webcam-controls {
    text-align: right;
}

.webcam-refresh-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.webcam-refresh-btn:hover {
    background: rgba(255,255,255,0.3);
}

.webcam-refresh-btn .dashicons {
    font-size: 12px;
    vertical-align: text-top;
}

.webcam-loading {
    text-align: center;
    padding: 10px;
    color: #666;
    font-size: 13px;
}

.webcam-loading .dashicons.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.webcam-widget-error {
    background: #ffebee;
    border: 1px solid #f44336;
    border-radius: 4px;
    padding: 10px;
    color: #c62828;
    font-size: 13px;
}

/* Stili specifici per shortcode e compatibilità UIkit */
.weather-shortcode-container,
.webcam-shortcode-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Titoli stile UIkit */
.weather-widget-title,
.webcam-widget-title {
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    color: #333 !important;
    border: none !important;
    background: none !important;
    text-transform: none !important;
    line-height: 1.4 !important;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif !important;
}

/* Placeholder per builder stile UIkit */
.weather-widget-placeholder,
.webcam-widget-placeholder {
    background: #f8f8f8 !important;
    border: 2px dashed #e5e5e5 !important;
    padding: 30px 20px !important;
    text-align: center !important;
    color: #666 !important;
    border-radius: 5px !important;
    margin: 20px 0 !important;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

.weather-widget-placeholder:before,
.webcam-widget-placeholder:before {
    content: "📊" !important;
    font-size: 24px !important;
    display: block !important;
    margin-bottom: 8px !important;
}

.webcam-widget-placeholder:before {
    content: "📷" !important;
}

/* Errori stile UIkit */
.weather-widget-error,
.webcam-widget-error {
    background: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
    border-radius: 5px !important;
    padding: 15px !important;
    color: #721c24 !important;
    font-size: 14px !important;
    margin: 20px 0 !important;
    text-align: center !important;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif !important;
}

.weather-widget-error:before,
.webcam-widget-error:before {
    content: "⚠️" !important;
    font-size: 18px !important;
    display: block !important;
    margin-bottom: 5px !important;
}

/* Override specifici per YOOtheme Pro e UIkit */
.uk-section .weather-shortcode-container,
.uk-section .webcam-shortcode-container {
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.uk-section .weather-widget-msv,
.uk-section .webcam-widget-msv {
    margin-bottom: 30px !important;
}

/* Integrazione con UIkit grid */
.uk-grid > .weather-shortcode-container,
.uk-grid > .webcam-shortcode-container {
    margin-bottom: 0 !important;
}

.uk-grid .weather-widget-msv,
.uk-grid .webcam-widget-msv {
    margin-bottom: 0 !important;
}

/* Dark mode UIkit */
@media (prefers-color-scheme: dark) {
    .weather-widget-title,
    .webcam-widget-title {
        color: #e5e5e5 !important;
    }
    
    .weather-widget-placeholder,
    .webcam-widget-placeholder {
        background: #2a2a2a !important;
        border-color: #444 !important;
        color: #aaa !important;
    }
}

/* Miglioramenti responsivi UIkit */
@media (max-width: 959px) {
    .weather-widget-title,
    .webcam-widget-title {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }
    
    .weather-widget-placeholder,
    .webcam-widget-placeholder {
        padding: 20px 15px !important;
        font-size: 13px !important;
        margin: 15px 0 !important;
    }
}

@media (max-width: 639px) {
    .weather-widget-title,
    .webcam-widget-title {
        font-size: 16px !important;
        margin-bottom: 12px !important;
    }
    
    .weather-widget-placeholder,
    .webcam-widget-placeholder {
        padding: 15px 10px !important;
        font-size: 12px !important;
        margin: 10px 0 !important;
    }
}

/* Fix per dashicons se non caricate in UIkit */
.webcam-refresh-btn .dashicons:before {
    content: "↻" !important;
    font-family: Arial, sans-serif !important;
    font-weight: bold !important;
}

/* Animazioni UIkit style */
.weather-widget-msv,
.webcam-widget-msv {
    animation: uk-fade 0.5s ease-in-out !important;
}

@keyframes uk-fade {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Print styles */
@media print {
    .weather-widget-msv,
    .webcam-widget-msv {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        break-inside: avoid !important;
    }
    
    .webcam-refresh-btn,
    .webcam-controls {
        display: none !important;
    }
}

/* Stili per l'admin */
.webcam-meto-admin .form-table th {
    width: 200px;
}

.webcam-meto-admin .postbox {
    margin-top: 20px;
}

.webcam-meto-admin .postbox .inside {
    padding: 15px;
}

.webcam-meto-admin .notice.inline {
    margin: 5px 0;
    padding: 8px 12px;
}
