/*body { background: red !important; }*/

* {
    box-sizing: border-box;
}

body {
    background-color: #5f3a2a;
    /*jasnobrazowy*/
    font-family: Arial, sans-serif;
    /* dopisany fallback sans-serif */
    font-size: 16px;
    color: #ffffff;
    /*biały*/
    margin: 0;
    line-height: 1.6;
}

/* =====================
STRUKTURA NAGŁÓWKA
===================== */
.header-images {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    padding: 0 20px;
    align-items: flex-start;
}

.header-img-1 {
    display: block;
    width: 760px;
    max-width: calc(100vw - 40px);
    height: auto;
}

.header-img-2 {
    display: block;
    width: 564px;
    max-width: calc(100vw - 40px);
    height: auto;
}

@media (max-width: 767px) {
    .header-images {
        display: block;
        width: calc(100% - 40px);
        margin: 0 20px;
        padding: 0;
    }

    .header-img-1 {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0;
    }

    .header-img-2 {
        display: none;
    }
}

/* =====================
WYROZNIONE CZCIONKI - Kolory  rozmiary i rodzaje
===================== */

/* ===== KOLORY ===== */
/*.jasnobrazowy { color: #441500; } */
/*.ciemnobrazowy { color: #3a1200; } */

/*.bialy { color: #ffffff; }*/

.jasnopomaranczowa {
    color: #ffcc77;
}

/* zakładki, główne teksty */
.pomaranczowa {
    color: #ffa500;
}

/* tytuły */

.jasnozielony {
    color: lime;
}

/* wolna koja */
.zolty {
    color: yellow;
}

/* rezerwacja */
.czerwony {
    color: red;
}

/* zajęta */
.szary {
    color: gray;
}

/* niedostępna */

/* ===== ROZMIARY ===== */
.mala {
    font-size: 12px;
}

.normal {
    font-size: 18px;
}

/* obecny standard dziedziczone wiec niepotrzebne ?*/
.duza {
    font-size: 20px;
}

/* nagłówki - zakładki */
.bardzoduza {
    font-size: 24px;
    margin-top: 0;
}

.duza.jasnopomaranczowa.ladna {
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin: 10px 0;
}

.duza.jasnopomaranczowa.ladna a {
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s;
}

.duza.jasnopomaranczowa.ladna a:hover {
    background: rgba(255, 204, 119, 0.1);
}

/* typu Sezon */

/*====== Rodzaje ======= */
.ladna {
    font-family: Georgia, Palatino, serif;
}

.kursywa {
    font-style: italic;
}

/*======== linki bez oznaczeń =========== */
a {
    color: inherit;
    text-decoration: none;
}

#menuBtn {
    display: none;
}

/* =====================
KONTENER DWÓCH BLOKÓW
(lewy + prawy)
===================== */
.kontenery {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 20px;
}

@media (min-width: 1200px) {
    .kontenery {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* =====================
LEWY BLOK 
===================== */
.blok-tresc {
    width: 100%;
    max-width: 900px;
    background-color: #4b2e22;
    /*ciemnobrazowy */
    padding: 2.5%;
    box-sizing: border-box;
    border-radius: 15px;
}

@media (min-width: 1400px) {
    .blok-tresc {
        max-width: 1100px;
    }
}

/* =====================
PRAWY BLOK 
===================== */
.blok-prawy {
    width: 100%;
    max-width: 300px;
    background-color: #4b2e22;
    /*ciemnobrazowy*/
    padding: 20px;
    box-sizing: border-box;
    border-radius: 15px;
}

.sidebar-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.sidebar-img-small {
    width: 100px;
    height: auto;
    border-radius: 4px;
}


/* =====================
STYL TABELI REJSOW -> RESPONSYWNY (KARTY / TABELA)
===================== */
.table-responsive {
    width: 100%;
    margin-top: 20px;
}

/* --- WIDOK MOBILNY (KARTY) --- */
@media (max-width: 767px) {

    table.sezon thead,
    table.sezon th {
        display: none;
    }

    table.sezon {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0 15px;
        background: transparent;
    }

    table.sezon tbody {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Ukrywamy pierwszy wiersz (nagłówki) w widoku kart */
    table.sezon tr:first-child {
        display: none !important;
    }

    table.sezon tr {
        display: flex;
        flex-direction: column;
        background-color: #4b2e22;
        border: 1px solid #ffcc77;
        border-radius: 15px;
        padding: 15px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        height: 100%;
        box-sizing: border-box;
    }

    table.sezon tr:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
        border-color: #ffa500;
    }

    table.sezon td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid rgba(255, 204, 119, 0.1);
        text-align: left !important;
    }

    table.sezon td:last-child {
        border-bottom: none;
    }

    /* Etykiety z data-label w kartach */
    table.sezon td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #ffcc77;
        margin-right: 15px;
        min-width: 100px;
        font-size: 0.9em;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        opacity: 0.8;
    }

    /* Stackowanie pól w kartach */
    table.sezon td[data-label="Nr rejsu / Koje"],
    table.sezon td[data-label="Trasa"] {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    table.sezon td[data-label="Nr rejsu / Koje"]::before,
    table.sezon td[data-label="Trasa"]::before {
        margin-bottom: 8px;
        margin-right: 0;
        text-align: center;
        width: 100%;
    }
}

.btn-zapisz {
    background-color: transparent;
    border: 1px solid #ffa500;
    color: #ffa500;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    display: inline-block;
    vertical-align: middle;
}

.btn-zapisz:hover {
    background-color: rgba(255, 165, 0, 0.1);
    border-color: #ffcc77;
    color: #ffcc77;
    box-shadow: 0 0 12px rgba(255, 165, 0, 0.3);
    transform: translateY(-1px);
}

/* --- WIDOK TABLET / DESKTOP (KLASYCZNA TABELA) --- */
@media (min-width: 768px) {
    table.sezon {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        margin-bottom: 20px;
        background-color: #4b2e22;
        border-radius: 15px;
        overflow: hidden;
        border: 1px solid rgba(255, 204, 119, 0.4);
        /* Zwiększona widoczność */
    }

    table.sezon th {
        background-color: #4b2e22;
        color: #ffffff;
        padding: 12px 8px;
        text-align: center;
        font-size: 0.9em;
        border-right: 1px solid rgba(255, 204, 119, 0.2);
        border-bottom: 1px solid rgba(255, 204, 119, 0.2);
    }

    table.sezon td {
        padding: 12px 8px;
        border-right: 1px solid rgba(255, 204, 119, 0.2);
        border-bottom: 1px solid rgba(255, 204, 119, 0.2);
        vertical-align: middle;
    }

    /* Usuwamy obramowania stykające się z ramką zewnętrzną tabeli */
    table.sezon th:last-child,
    table.sezon td:last-child {
        border-right: none;
    }

    table.sezon tr:last-child td {
        border-bottom: none;
    }

    /* Dodatkowe wymuszenie zaokrągleń dla komórek narożnych (bulletproof) */
    table.sezon tr:first-child th:first-child {
        border-top-left-radius: 15px;
    }

    table.sezon tr:first-child th:last-child {
        border-top-right-radius: 15px;
    }

    table.sezon tr:last-child td:first-child {
        border-bottom-left-radius: 15px;
    }

    table.sezon tr:last-child td:last-child {
        border-bottom-right-radius: 15px;
    }

    table.sezon tr:hover {
        background-color: rgba(255, 204, 119, 0.05);
    }

    .pomaranczowa {
        color: #ffa500;
    }

    /* Jeszcze lżejszy przycisk w widoku tabeli (desktop) */
    .btn-zapisz {
        padding: 5px 10px;
        font-size: 12px;
        letter-spacing: 0.8px;
        border-radius: 6px;
        font-weight: 400;
        border: 1px solid rgba(255, 165, 0, 0.5);
        color: rgba(255, 165, 0, 0.9);
    }
}


/* Kolumna z kojami - wyśrodkowanie ID i rzędu koi */
table.sezon td.rejs {
    justify-content: center;
}

.rejs-id {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.berths-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
    /* Force horizontal */
}

/* Zapewnienie, że tekst w trasie nie jest wyśrodkowany jeśli jest długi (opcjonalnie) 
   ale dla kart lepiej wygląda symmetryczne ułożenie */
table.sezon td[data-label="Trasa"] {
    padding-bottom: 12px;
}


/* =====================
KOJE (I) - klik
===================== */
.koja {
    font-weight: bold;
    font-size: 18px;
    /* margin-right: 8px;  -- Usunięte, używamy gap w .berths-row */
    cursor: default;
    user-select: none;
    text-align: center;
}

.legenda-item {
    display: inline-block;
    white-space: nowrap;
    margin-right: 15px;
}


.wolna {
    color: lime;
}

.rezerwacja {
    color: yellow;
}

.zajeta {
    color: red;
}

.niedostepna {
    color: gray;
}

.hint {
    font-size: 14px;
    /* to wysokość IIII ? */
    color: #ffcc77;
    opacity: 0.9;
}

/* ZAKŁADKI – usunięcie starej logiki bo mamy flexbox */
/* Stara sekcja @media (max-width: 1100px) została zastąpiona nowym podejściem flexboxowym */

.koja {
    pointer-events: none;
}

/* =====================
MODAL STYLES
===================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    overflow-y: auto;
    transition: all 0.3s ease;
}

.modal-content {
    background-color: #4b2e22;
    margin: 5% auto;
    padding: 40px;
    border: 1px solid #ffcc77;
    width: 90%;
    max-width: 600px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@media (max-width: 600px) {
    .modal-content {
        margin: 10% auto;
        padding: 25px 20px;
        width: 95%;
        border-radius: 15px;
    }

    .close-button {
        right: 15px;
        top: 10px;
    }

    #voyage-info {
        padding: 15px;
        font-size: 0.9em;
    }

    #voyage-info p {
        margin: 5px 0;
    }

    h2 {
        font-size: 1.5em;
        margin-top: 5px;
    }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-button {
    position: absolute;
    right: 25px;
    top: 20px;
    color: #ffcc77;
    font-size: 35px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s ease;
}

.close-button:hover {
    color: #ffa500;
    transform: scale(1.1);
}

#voyage-info {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 204, 119, 0.05);
    border-radius: 12px;
    border-left: 4px solid #ffa500;
}

#voyage-info p {
    margin: 8px 0;
    font-size: 1.1em;
}

hr {
    border: none;
    border-top: 1px solid rgba(255, 204, 119, 0.2);
    margin: 30px 0;
}

/* =====================
FORM STYLES
===================== */
#bookingForm {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.form-group {
    flex: 1 1 calc(50% - 10px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 250px;
}

.form-group.full-width {
    flex: 1 1 100%;
}

.btn-zapisz.full-width {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    margin-top: 10px;
}

@media (max-width: 600px) {
    #bookingForm {
        flex-direction: column;
        gap: 15px;
    }

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

    .modal-content {
        margin: 10% auto;
        padding: 25px 15px;
        width: 95%;
        border-radius: 12px;
    }
}


.form-group label {
    font-size: 0.9em;
    color: #ffcc77;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 204, 119, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    color: #ffffff;
    font-family: inherit;
    font-size: 1em;
    width: 100%;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ffa500;
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.2);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

#bookingForm .btn-zapisz {
    margin-top: 10px;
    padding: 15px;
    font-size: 1.1em;
    width: 100%;
}

/* @media (max-width: 767px) {
    img[src*="tlo3.png"] {
        display: none;
    }
} */

/* MENU – tylko telefon */
@media (max-width: 767px) {

    #menuBtn {
        display: block;
        margin: 10px 20px;
        padding: 10px;
        background: #4b2e22;
        color: #ffcc77;
        border: 1px solid #ffcc77;
        border-radius: 8px;
    }

    .duza.jasnopomaranczowa.ladna {
        display: none; /* ukryte na start */
        flex-direction: column;
    }

    .duza.jasnopomaranczowa.ladna.show {
        display: flex; /* pokaż po kliknięciu */
    }
}
/* INFO – domyślnie (komputer) */
#infoBtn {
    display: none;
}

#infoBox {
    display: block;
}

/* INFO – telefon */
@media (max-width: 767px) {

    #infoBtn {
        display: block;
        margin: 10px 0;
        padding: 10px;
        background: #4b2e22;
        color: #ffcc77;
        border: 1px solid #ffcc77;
        border-radius: 8px;
    }

    #infoBox {
        display: none;
        text-align: left;
    }

    #infoBox.show {
        display: block;
    }
}

/* SELECT source - osobny styl */
#source {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 204, 119, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    color: #ffcc77;
    font-family: Arial, sans-serif;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
}

#source:focus {
    outline: none;
    border-color: #ffa500;
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.2);
}

#source option {
    color: #ffcc77;
    background-color: #4b2e22;
}