/* Dashboard Minutowy - style dla widoku minutowego pompy */

body {
    background-color: #1a1a1a;
    color: #ddd;
    font-family: 'Montserrat', sans-serif;
}

.loading, .error, .no-data {
    padding: 40px;
    text-align: center;
    font-size: 1.2rem;
    background-color: #2a2a2a;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.error {
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

.no-data {
    color: #3498db;
    border-left: 4px solid #3498db;
}

/* Kontrolki zakresu czasu */
.controls {
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    background-color: #2a2a2a;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.time-range-selector {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 15px;
    flex: 3;
}

.date-time-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.date-time-input label {
    font-size: 0.9rem;
    color: #aaa;
}

.date-time-input input {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 5px;
    color: #fff;
    padding: 8px 12px;
    font-size: 1rem;
    min-width: 240px;
}

.range-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-self: flex-end;
}

.range-buttons button {
    background-color: #333;
    border: 1px solid #444;
    border-radius: 5px;
    color: #ddd;
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.range-buttons button:hover {
    background-color: #444;
}

.range-buttons button.active {
    background-color: #2980b9;
    border-color: #3498db;
    color: #fff;
}

.fetch-button {
    background-color: #27ae60;
    border: none;
    border-radius: 5px;
    color: #fff;
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fetch-button:hover {
    background-color: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
}

.price-model-selector {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.price-model-selector label {
    font-size: 0.9rem;
    color: #aaa;
}

.price-model-selector select {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 5px;
    color: #fff;
    padding: 8px 12px;
    font-size: 1rem;
    cursor: pointer;
}

/* Kafelki podsumowujące */
.summary-tiles {
    margin-bottom: 30px;
}

.summary-section-title {
    color: #fff;
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #444;
    padding-bottom: 10px;
}

.cwu-section .summary-section-title {
    border-bottom-color: #3498db;
    color: #3498db;
}

.co-section .summary-section-title {
    border-bottom-color: #e67e22;
    color: #e67e22;
}

.summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.summary-tile {
    background-color: #2a2a2a;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.summary-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}




.tile-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.5rem;
}

.tile-content {
    flex: 1;
}

.tile-value {
    font-size: 1.6rem;
    margin: 0;
    font-weight: 700;
    color: #fff;
}

.tile-label {
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 5px;
}

/* Ikony kafelków */
.energy-consumed .tile-icon {
    background-color: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.energy-consumed {
    border-left: 4px solid #3498db;
}

.energy-produced .tile-icon {
    background-color: rgba(230, 126, 34, 0.2);
    color: #e67e22;
}

.energy-produced {
    border-left: 4px solid #e67e22;
}

.avg-temperature .tile-icon {
    background-color: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
}

.avg-temperature {
    border-left: 4px solid #9b59b6;
}

.average-cop .tile-icon {
    background-color: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.average-cop {
    border-left: 4px solid #2ecc71;
}

.minimum-temperature .tile-icon {
    background-color: rgba(41, 128, 185, 0.2);
    color: #3498db;
}

.minimum-temperature {
    border-left: 4px solid #3498db;
}

.heat-cost .tile-icon {
    background-color: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.heat-cost {
    border-left: 4px solid #f1c40f;
}

.total-cost .tile-icon {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.total-cost {
    border-left: 4px solid #e74c3c;
}

/* Styl dla kafelka statystyk defrostów - motyw lodowy (biało-szary) */
.defrost-stats .tile-icon {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ecf0f1;
}

.defrost-stats {
    border-left: 4px solid #ecf0f1;
}

.defrost-stats .tile-value {
    color: #fff;
}

.defrost-stats .tile-label {
    color: #bdc3c7;
}

.avg-building-temperature .tile-icon {
    background-color: rgba(46, 204, 113, 0.2); /* Zielony - taki jak dla COP */
    color: #2ecc71; /* Zielony */
}

.avg-building-temperature {
    border-left: 4px solid #2ecc71;
}

/* Style dla sekcji CWU */
.energy-produced-cwu .tile-icon {
    background-color: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.total-cost-cwu .tile-icon {
    background-color: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.heat-cost-cwu .tile-icon {
    background-color: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.energy-produced-cwu {
    border-left: 4px solid #3498db;
}

.total-cost-cwu {
    border-left: 4px solid #3498db;
}

.heat-cost-cwu {
    border-left: 4px solid #3498db;
}

/* Style dla sekcji CO */
.energy-produced-co .tile-icon {
    background-color: rgba(230, 126, 34, 0.2);
    color: #e67e22;
}

.total-cost-co .tile-icon {
    background-color: rgba(230, 126, 34, 0.2);
    color: #e67e22;
}

.heat-cost-co .tile-icon {
    background-color: rgba(230, 126, 34, 0.2);
    color: #e67e22;
}

.energy-produced-co {
    border-left: 4px solid #e67e22;
}

.total-cost-co {
    border-left: 4px solid #e67e22;
}

.heat-cost-co {
    border-left: 4px solid #e67e22;
}

/* Wykresy */
.chart-container {
    background-color: #2a2a2a;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.chart-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 500;
    color: #aaa;
    text-align: center;
}

canvas {
    width: 100% !important;
    height: 350px !important;
}

/* Tabela danych */
.data-section {
    background-color: #2a2a2a;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.data-toggle {
    background-color: #2980b9;
    border: none;
    border-radius: 5px;
    color: #fff;
    padding: 10px 15px;
    font-size: 1rem;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    transition: all 0.2s ease;
}

.data-toggle:hover {
    background-color: #3498db;
}

.data-toggle.active {
    background-color: #c0392b;
}

.data-content {
    display: none;
    overflow-x: auto;
    margin-top: 20px;
}

.data-content.active {
    display: block;
}

.data-content table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.9rem;
}

.data-content th, .data-content td {
    padding: 10px;
    text-align: right;
    border-bottom: 1px solid #333;
}

.data-content th {
    background-color: #2a2a2a;
    font-weight: 500;
    color: #ddd;
}

.data-content th:first-child, .data-content td:first-child {
    text-align: left;
}

.value-cell {
    font-family: 'Roboto Mono', monospace;
}

.value-cell.energy {
    color: #3498db;
}

.value-cell.temperature {
    color: #9b59b6;
}

.value-cell.cop {
    color: #2ecc71;
}

.value-cell.flow {
    color: #f39c12;
}

.value-cell.cost {
    color: #e74c3c;
}

/* Responsywność */
@media (max-width: 992px) {
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .time-range-selector, .price-model-selector {
        width: 100%;
    }
    
    .range-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .summary-row {
        grid-template-columns: 1fr;
    }
    
    .time-range-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .fetch-button {
        margin-top: 10px;
    }
    
    .data-content th, .data-content td {
        padding: 8px 5px;
        font-size: 0.8rem;
    }
} 