/* === ZMIENNA KOLORU PODŚWIETLENIA === */
:root {
    --current-day-highlight-bg: #fff3cd; /* Jasnożółty */
    --current-day-highlight-border: #ffeeba; /* Ciemniejszy żółty dla ramki */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(to bottom, #eef2f7, #dce4ec);
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === HEADER STYLE === */
header.app-header {
    background-color: #ffffff;
    padding: 10px 25px;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: calc(960px + 60px); /* Dopasowanie do kontenera */
    width: 100%;
    box-sizing: border-box;
    margin: 20px auto 0 auto;
    border-radius: 10px;
}

header.app-header .logo img {
    height: 45px;
    width: auto;
    display: block;
    margin-right: 20px;
}

header.app-header h1 {
    margin: 0;
    font-size: 1.5em;
    color: #0056b3;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden; /* Zapobiega wychodzeniu tekstu na mobilnych */
    text-overflow: ellipsis; /* Dodaje '...' jeśli tekst jest za długi */
}

/* === KONTENER GŁÓWNY === */
.container {
    max-width: calc(960px + 60px);
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto 30px auto; /* Centrowanie, margines dolny, góra 0 */
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    flex-grow: 1; /* Pozwala rosnąć */
}

/* === Nagłówki === */
h2 {
    font-size: 1.5em;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
    margin-top: 30px;
    margin-bottom: 20px;
}
h2:first-of-type {
     margin-top: 0; /* Usuń górny margines dla pierwszego H2 */
}

h3 {
    font-size: 1.2em;
    margin-top: 25px;
    margin-bottom: 15px;
    color: #444;
}

/* === Formularze === */
.form-group {
    margin-bottom: 20px;
}

label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
    display: block;
}

input[type="number"],
input[type="text"],
input[type="time"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
    margin-bottom: 10px;
    font-size: 15px;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    border-color: #80bdff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

button {
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.1s;
    width: 100%;
    margin-top: 15px;
}

button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0px);
}

#downloadScheduleBtn {
    background-color: #28a745;
    margin-top: 20px;
    display: none; /* Domyślnie ukryty */
}

#downloadScheduleBtn:hover {
    background-color: #218838;
}

#downloadScheduleBtn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* === Mapa === */
#map {
    width: 100%;
    height: 350px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #ddd;
}

/* === Wyniki === */
#results {
    margin-top: 35px;
    border-top: 1px solid #dee2e6;
    padding-top: 25px;
}

/* === Tabela Harmonogramu === */
#scheduleTable {
    overflow-y: scroll;
    height: 350px;
    border: 1px solid #ddd;
    margin-top: 15px;
    background-color: #fff;
}

#scheduleTable table {
    width: 100%;
    border-collapse: collapse;
}

#scheduleTable th,
#scheduleTable td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

#scheduleTable th {
    background-color: #e9ecef;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 1;
}

#scheduleTable tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

#scheduleTable tbody tr:hover {
    background-color: #e2e6ea;
}

/* === STYL PODŚWIETLENIA WIERSZA === */
#scheduleTable tbody tr.current-day-row {
    background-color: var(--current-day-highlight-bg) !important; /* Użycie zmiennej */
    font-weight: bold;
}

#scheduleTable tbody tr.current-day-row td {
    border-top: 1px solid var(--current-day-highlight-border);
    border-bottom: 1px solid var(--current-day-highlight-border);
}
/* === KONIEC STYLU === */

/* === Podsumowanie Kosztów === */
#totalAnnualHoursDisplay,
#savingsZeroOffset,
#savingsWithOffset,
#savingsWithOffsetAndReduction,
#reactivePowerCost {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #343a40;
    padding: 8px 15px;
    border-left: 4px solid #007bff; /* Domyślny niebieski */
    background-color: #e7f1ff; /* Jasnoniebieski */
    border-radius: 0 4px 4px 0;
}
#totalAnnualHoursDisplay { border-left-color: #fd7e14; background-color: #fff3e0; } /* Pomarańczowy */
#savingsZeroOffset { border-left-color: #6c757d; background-color: #f8f9fa;} /* Szary */
#savingsWithOffset { border-left-color: #17a2b8; background-color: #e2f6f9;} /* Turkusowy */
#savingsWithOffsetAndReduction { border-left-color: #28a745; background-color: #eaf6ec;} /* Zielony */
#reactivePowerCost { border-left-color: #ffc107; background-color: #fff8e1;} /* Żółty */

/* === Redukcja Mocy === */
.power-reduction-settings {
    margin-top: 25px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 20px;
    background-color: #f8f9fa;
}
.power-reduction-settings h2 { margin-top: 0; font-size: 1.25em; }
.power-reduction-group { display: flex; flex-wrap: wrap; align-items: center; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dashed #dee2e6; }
.power-reduction-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.power-reduction-group label { margin-right: 8px; flex-shrink: 0; display: inline-flex; align-items: center; vertical-align: middle; margin-bottom: 0; }
.power-reduction-group input[type="checkbox"] { margin-right: 8px; vertical-align: middle; width: auto; transform: scale(1.1); }
.power-reduction-group input[type="number"] { width: 75px; margin-right: 15px; vertical-align: middle; text-align: right; }
.power-reduction-group input[type="time"] { width: 100px; margin-right: 15px; vertical-align: middle; }

/* === Wykresy === */
#powerReductionChart,
#dailyLightingChart {
    width: 100%;
    max-height: 350px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 25px;
    background-color: #fff;
}

/* === Stopka === */
footer.app-footer {
    background-color: #ffffff;
    padding: 15px 25px;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.08);
    margin-top: auto; /* Ważne dla przyklejenia do dołu */
    max-width: calc(960px + 60px);
    width: 100%;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
footer.app-footer .logo img {
    height: 30px;
    width: auto;
    display: block;
    margin-right: 15px;
}
footer.app-footer .footer-link a {
     color: #0056b3;
     text-decoration: none;
     font-size: 14px;
     transition: color 0.2s;
}
footer.app-footer .footer-link a:hover {
     color: #007bff;
     text-decoration: underline;
 }

/* === Responsywność === */
@media (max-width: 1080px) { /* Dostosowanie max-width dla header, container, footer */
     header.app-header, .container, footer.app-footer {
         max-width: 95%;
         margin-left: auto;
         margin-right: auto;
    }
}
@media (max-width: 992px) { /* Zmiany layoutu redukcji mocy */
      .power-reduction-group { display: block; }
       .power-reduction-group label, .power-reduction-group input { display: block; width: 100%; margin-right: 0; margin-bottom: 5px; }
       .power-reduction-group input[type="checkbox"] { display: inline-block; width: auto; margin-right: 5px; margin-bottom: 10px; }
       .power-reduction-group label[for^="powerReductionEnabled"] { display: inline-block; width: auto; font-weight: bold; }
       .power-reduction-group input[type="number"], .power-reduction-group input[type="time"]{ width: calc(100% - 22px); margin-left: 22px; }
       label[for^="powerReductionStart"], label[for^="powerReductionEnd"], label[for^="powerReductionPercent"] { margin-left: 22px; font-weight: normal; }
 }
 @media (max-width: 768px) { /* Dostosowania dla małych ekranów */
     body { background: #f0f4f8; }
     header.app-header, .container, footer.app-footer { margin-left: 0; margin-right: 0; max-width: 100%; border-radius: 0; }
     header.app-header { margin-bottom: 0; padding: 8px 15px; justify-content: flex-start; }
     header.app-header h1 { font-size: 1.1em; margin-left: 10px;}
     .container { margin-top: 0; margin-bottom: 10px; padding: 15px;}
     footer.app-footer { margin-top: 10px; margin-bottom: 0; padding: 10px 15px; justify-content: center;}
     footer.app-footer .footer-link { margin-top: 5px; text-align: center; width: 100%;} /* Centrowanie linku */
     h1 { font-size: 1.6em; } h2 { font-size: 1.2em; } h3 { font-size: 1.0em;}
     input[type="number"], input[type="text"], input[type="time"] { font-size: 14px; padding: 8px; }
     button { font-size: 14px; padding: 10px 15px; }
     #map { height: 220px; } #scheduleTable { height: 220px; }
     #scheduleTable th, #scheduleTable td { font-size: 12px; padding: 6px 8px; }
     #powerReductionChart, #dailyLightingChart { height: 220px; margin-top: 20px; }
     #totalAnnualHoursDisplay, #savingsZeroOffset, #savingsWithOffset, #savingsWithOffsetAndReduction, #reactivePowerCost { font-size: 13px; padding: 6px 10px; }
     header.app-header .logo img { height: 35px;} footer.app-footer .logo img { height: 25px;}
 }

/* === FORMULARZ KONTAKTOWY === */
.contact-section h2 {
    font-size: 1.5em;
    margin-bottom: 25px;
    color: #0056b3;
}
.contact-section .form-group {
    margin-bottom: 15px;
}
.contact-section input[type="text"],
.contact-section input[type="tel"],
.contact-section input[type="email"],
.contact-section textarea {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #fff;
}
.contact-section textarea {
    resize: vertical;
}
.contact-section .form-group-consent label {
    font-size: 14px;
    display: block;
    margin-top: 10px;
}
.contact-section .form-group-consent input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}
.contact-section button.btn-dwg {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}
.contact-section button.btn-dwg:hover {
    background-color: #0056b3;
}
.contact-info-more {
    margin-top: 20px;
    font-size: 14px;
    color: #555;
}