/**
 * NTP Weather Charting Frontend Styles
 */

.ntp-weather-chart-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ntp-weather-chart-controls {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.ntp-weather-chart-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    min-width: 120px;
    transition: border-color 0.2s ease;
}

.ntp-weather-chart-controls select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.ntp-weather-chart-controls label {
    font-weight: 500;
    color: #333;
    margin-right: 5px;
}

.ntp-custom-date-range {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
}

.ntp-custom-date-range input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.ntp-custom-date-range input[type="date"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.ntp-apply-date-range {
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.ntp-apply-date-range:hover {
    background: #005a87;
}

.ntp-apply-date-range:active {
    transform: translateY(1px);
}

.ntp-weather-chart-wrapper {
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ntp-weather-chart-wrapper canvas {
    max-width: 100%;
    height: auto;
}

.ntp-chart-loading,
.ntp-chart-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    min-width: 200px;
}

.ntp-chart-loading {
    color: #0073aa;
    font-weight: 500;
}

.ntp-chart-loading::before {
    content: '';
    display: block;
    width: 30px;
    height: 30px;
    margin: 0 auto 15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: ntp-spin 1s linear infinite;
}

.ntp-chart-error {
    color: #dc3232;
    font-weight: 500;
}

.ntp-chart-error::before {
    content: '⚠';
    display: block;
    font-size: 24px;
    margin-bottom: 10px;
}

@keyframes ntp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chart legend styling */
.ntp-weather-chart-container .chartjs-legend {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.ntp-weather-chart-container .chartjs-legend ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.ntp-weather-chart-container .chartjs-legend li {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #666;
}

.ntp-weather-chart-container .chartjs-legend li span {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

/* Responsive design */
@media (max-width: 768px) {
    .ntp-weather-chart-container {
        padding: 15px;
        margin: 15px 0;
    }
    
    .ntp-weather-chart-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .ntp-weather-chart-controls select {
        min-width: auto;
        width: 100%;
    }
    
    .ntp-custom-date-range {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ntp-custom-date-range input[type="date"] {
        width: 100%;
    }
    
    .ntp-weather-chart-wrapper {
        min-height: 250px;
    }
    
    .ntp-chart-loading,
    .ntp-chart-error {
        min-width: 150px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .ntp-weather-chart-container {
        padding: 10px;
        margin: 10px 0;
    }
    
    .ntp-weather-chart-controls {
        gap: 8px;
    }
    
    .ntp-weather-chart-controls select {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .ntp-weather-chart-wrapper {
        min-height: 200px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ntp-weather-chart-container {
        background: #2c2c2c;
        border-color: #444;
        color: #fff;
    }
    
    .ntp-weather-chart-controls {
        border-bottom-color: #444;
    }
    
    .ntp-weather-chart-controls select {
        background: #3c3c3c;
        border-color: #555;
        color: #fff;
    }
    
    .ntp-weather-chart-controls select:focus {
        border-color: #0073aa;
    }
    
    .ntp-custom-date-range {
        background: #3c3c3c;
        border-color: #555;
    }
    
    .ntp-custom-date-range input[type="date"] {
        background: #2c2c2c;
        border-color: #555;
        color: #fff;
    }
    
    .ntp-chart-loading,
    .ntp-chart-error {
        background: rgba(44, 44, 44, 0.95);
        border-color: #555;
    }
}

/* Print styles */
@media print {
    .ntp-weather-chart-controls {
        display: none;
    }
    
    .ntp-weather-chart-container {
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    .ntp-weather-chart-wrapper {
        min-height: auto;
    }
}

/* Frontend Dashboard Styles */
.ntp-weather-dashboard-frontend {
    margin: 20px 0;
}

.ntp-weather-dashboard-frontend h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
}

.ntp-weather-dashboard-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.ntp-weather-dashboard-grid.layout-2x2 {
    grid-template-columns: repeat(2, 1fr);
}

.ntp-weather-dashboard-grid.layout-1x4 {
    grid-template-columns: 1fr;
}

.ntp-weather-dashboard-grid.layout-4x1 {
    grid-template-columns: repeat(4, 1fr);
}

.ntp-weather-dashboard-chart {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ntp-weather-dashboard-chart h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    text-align: center;
}

/* Responsive adjustments for dashboard */
@media (max-width: 768px) {
    .ntp-weather-dashboard-grid.layout-2x2,
    .ntp-weather-dashboard-grid.layout-4x1 {
        grid-template-columns: 1fr;
    }
    
    .ntp-weather-dashboard-chart {
        padding: 15px;
    }
} 