/* kalendarz-sal.css - WERSJA RESPONSYWNA Z CZERWONYM PRZYCISKIEM */
.kalendarz-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.kalendarz-container h1,
.kalendarz-container h2 {
    text-align: center;
    font-weight: 600;
    color: #d9534f;
}

.kalendarz-section {
    max-width: 1100px;
    margin: 0 auto 40px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.kalendarz-section-title {
    background: #f7f7f7;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
    padding: 15px 20px;
    margin: 0;
    font-size: 1.2em;
}

/* Style wyszukiwarki */
.search-form {
    padding: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9em;
}

input[type="date"],
select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
    background-color: #fff;
}

/* === ZMIANA TUTAJ: Wymuszamy style dla WSZYSTKICH przycisków w kontenerze === */
.kalendarz-container button {
    padding: 10px 20px;
    background-color: #dc3545 !important;
    color: white !important;
    cursor: pointer;
    border: none !important;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.kalendarz-container button:hover {
    background-color: #c82333 !important;
}

.kalendarz-container .nav-btn {
    background-color: #0d6efd !important;
    /* Niebieski dla przycisków nawigacji */
}

.kalendarz-container .nav-btn:hover {
    background-color: #0b5ed7 !important;
}

/* === KONIEC ZMIAN === */

.results {
    padding: 0 20px 20px;
}

/* STYLE DLA WYNIKÓW */
.result-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.result-item h3 {
    font-size: 1em !important;
    margin: 0;
    color: #d9534f;
    flex-grow: 1;
}

.result-item span {
    font-size: 0.9em;
    text-align: right;
    min-width: 150px;
}

.available {
    color: #5cb85c;
    font-weight: bold;
    font-size: 1.1em;
    /*  ⬅️ powiększony status */
    text-transform: uppercase;
    /* ładniej wygląda jako duże litery */
}

.not-available {
    color: #d9534f;
    font-weight: bold;
    font-size: 1.1em;
    /*  ⬅️ ten sam rozmiar */
    text-transform: uppercase;
}

/* Style kalendarza (tabela) */
.calendar-wrapper {
    padding: 20px;
}

/* === ZAKTUALIZOWANE STYLE NAWIGACJI === */
#kalendarz-controls {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

#current-month-year {
    font-size: 1.8em;
    color: #d9534f;
    margin: 0;
    flex: 1;
    text-align: center;
}

.nav-btn {
    min-width: 140px;
    white-space: nowrap;
}

#kalendarz-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

#kalendarz table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 800px;
    /* Minimalna szerokość dla czytelności */
}

#kalendarz th,
#kalendarz td {
    border: 1px solid #e0e0e0;
    text-align: center;
    padding: 0;
    font-size: 12px;
    vertical-align: middle;
    height: 38px;
    min-width: 35px;
}

#kalendarz th {
    background-color: #f7f7f7;
    position: sticky;
    top: 0;
    z-index: 1;
    font-weight: 600;
}

#kalendarz td:first-child,
#kalendarz th:first-child {
    width: 200px;
    min-width: 150px;
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #f7f7f7;
    font-weight: bold;
    text-align: left;
    padding-left: 10px;
    border-right: 2px solid #ccc;
}

#kalendarz .weekend {
    background-color: #f9f9f9;
}

#kalendarz .available {
    background-color: #fff;
}

#kalendarz .occupied-full {
    background-color: #ff4d4d;
    color: white;
}

#kalendarz .occupied-am {
    background: linear-gradient(to right, #ffcccc 50%, white 50%);
}

#kalendarz .occupied-pm {
    background: linear-gradient(to left, #ffcccc 50%, white 50%);
}

/* Legenda */
.legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.legend-color {
    width: 15px;
    height: 15px;
    border: 1px solid #ccc;
    border-radius: 2px;
}

/* === Styl sekcji kontaktowej === */
.contact-info {
    text-align: center;
    font-size: 1.6em;
    /* powiększony tekst */
    font-weight: 700;
    /* pogrubienie */
    color: #d9534f;
    /* czerwony – ten sam odcień co nagłówki */
    margin-top: 35px;
    margin-bottom: 25px;
    line-height: 1.3;
}

.contact-info a {
    color: #d9534f;
    text-decoration: none;
    /* usuwa podkreślenie */
}

.contact-info a:hover {
    text-decoration: underline;
    /* delikatne podkreślenie przy najechaniu */
}

/* ========== MEDIA QUERIES DLA RESPONSYWNOŚCI ========== */

/* Tablety */
@media (max-width: 768px) {
    .kalendarz-container {
        padding: 5px;
    }

    .kalendarz-section {
        margin-bottom: 20px;
        border-radius: 6px;
    }

    .kalendarz-section-title {
        padding: 12px 15px;
        font-size: 1.1em;
    }

    .search-form {
        padding: 15px;
    }

    .form-row {
        gap: 10px;
        margin-bottom: 10px;
    }

    .form-group {
        min-width: 100%;
        flex: 0 0 100%;
    }

    /* === NOWY UKŁAD PRZYCISKÓW NA MOBILE === */
    #kalendarz-controls {
        flex-direction: column;
        gap: 10px;
        position: relative;
        min-height: 120px;
    }

    #prev-month {
        order: 1;
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    #current-month-year {
        order: 2;
        font-size: 1.4em;
        margin: 10px 0;
    }

    #next-month {
        order: 3;
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    .calendar-wrapper {
        padding: 15px;
    }

    #kalendarz th,
    #kalendarz td {
        height: 32px;
        font-size: 11px;
    }

    #kalendarz td:first-child,
    #kalendarz th:first-child {
        width: 150px;
        min-width: 120px;
        padding-left: 8px;
        font-size: 11px;
    }

    .contact-info {
        font-size: 1.3em;
        margin-top: 25px;
        margin-bottom: 15px;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .result-item span {
        text-align: left;
        min-width: auto;
    }
}

/* Telefony */
@media (max-width: 480px) {
    .kalendarz-section-title {
        padding: 10px 12px;
        font-size: 1em;
    }

    .search-form {
        padding: 12px;
    }

    .form-row {
        gap: 8px;
    }

    input[type="date"],
    select {
        padding: 8px 10px;
        font-size: 0.9em;
    }

    .kalendarz-container button {
        padding: 12px 16px;
        font-size: 0.9em;
        width: 100%;
        max-width: 200px;
    }

    #current-month-year {
        font-size: 1.2em;
    }

    /* === DOPRECYZOWANIE PRZYCISKÓW NA TELEFONIE === */
    #kalendarz-controls {
        min-height: 110px;
    }

    .nav-btn {
        min-width: 180px;
        padding: 12px 20px;
    }

    .calendar-wrapper {
        padding: 10px;
    }

    #kalendarz th,
    #kalendarz td {
        height: 28px;
        font-size: 10px;
    }

    #kalendarz td:first-child,
    #kalendarz th:first-child {
        width: 120px;
        min-width: 100px;
        padding-left: 6px;
        font-size: 10px;
    }

    .legend {
        gap: 10px;
        padding: 8px;
    }

    .legend-item {
        font-size: 11px;
    }

    .legend-color {
        width: 12px;
        height: 12px;
    }

    .contact-info {
        font-size: 1.1em;
        margin-top: 20px;
        margin-bottom: 10px;
    }

    .available,
    .not-available {
        font-size: 1em;
    }
}

/* Bardzo małe ekrany */
@media (max-width: 360px) {

    #kalendarz td:first-child,
    #kalendarz th:first-child {
        width: 100px;
        min-width: 90px;
        font-size: 9px;
        padding-left: 4px;
    }

    #kalendarz th,
    #kalendarz td {
        height: 25px;
        font-size: 9px;
    }

    .contact-info {
        font-size: 1em;
    }

    .nav-btn {
        min-width: 160px;
        padding: 10px 16px;
    }
}

/* Druk */
@media print {

    .search-form,
    .contact-info {
        display: none;
    }

    .kalendarz-section {
        box-shadow: none;
        border: 1px solid #000;
    }

    #kalendarz-wrapper {
        overflow-x: visible;
    }

    .nav-btn {
        display: none;
    }
}