/* Ogólny styl dla strony */
body {
    font-family: 'Arial', sans-serif;
    background-color: #2a2a2a;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Ukryj poziome przewijanie */
    max-width: 100vw; /* Ograniczenie szerokości do szerokości ekranu */
}

/* Tabela */
table {
    width: 95%;
    max-width: 100%; /* Ograniczenie szerokości tabeli */
    border-collapse: collapse;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
}

table th, table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #444;
}

table th {
    background-color: #444;
    color: #fff;
    text-transform: uppercase;
    font-weight: bold;
}

table tr:nth-child(even) {
    background-color: #333;
}

table tr:hover {
    background-color: #555;
}

/* Przycisk w tabeli */
table td button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px; /* Wyrównanie przycisków */
    margin-right: 10px; /* Przerwa między przyciskami */
    margin-bottom: 10px; /* Dodaj odstęp między przyciskami */
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px; /* Stała wysokość */
    width: 80px; /* Stała szerokość */
    transition: background-color 0.3s;
}

table td button:hover {
    background-color: #218838;
}

table td button:active {
    background-color: #218838;
}

#tireFormContainer {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.tire-options {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.tire-options label {
    margin-right: 10px;
    width: 100px;
}

.tire-options input[type="text"] {
    flex: 1;
    margin-right: 10px;
}

.checkmark-label {
    font-size: 18px;
    color: green;
    cursor: pointer;
}

/* Styl wyszukiwania */
#searchContainer {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-start;
    padding-left: 36%;
}

#searchInput {
    padding: 12px;
    width: 50%;
    max-width: 500px;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #333;
    color: #fff;
    font-size: 16px;
}

/* Przycisk do dodawania klienta */
#addButton {
    display: block;
    width: 100%;
    max-width: 200px;
    padding: 12px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 40%;
    margin-right: auto;
    font-size: 16px;
    text-align: center;
}

#addButton:hover {
    background-color: #1e7e34;
}

#addButton:active {
    background-color: #1e7e34;
}

/* Styl responsywny - na telefonach */
@media (max-width: 768px) {
    h1 {
        text-align: left;
    }

    #searchContainer {
        justify-content: flex-start;
        padding-left: 10px;
    }

    #addButton {
        width: 100%;
        max-width: none;
        margin-left: 0;
        margin-right: auto;
        margin-top: 10px;
    }

    table {
        margin-left: 10px;
        margin-right: 10px;
    }

    table td button {
        height: 40px; /* Stała wysokość na telefonach */
        width: 120px; /* Stała szerokość na telefonach */
        margin-right: 0; /* Usuń margines po ostatnim przycisku */
        margin-bottom: 10px; /* Dodaj odstęp między przyciskami */
    }

    table td button:last-child {
        margin-right: 0; /* Usuń margines po ostatnim przycisku */
    }

    #addFormContainer, #editFormContainer {
        padding: 15px;
        max-width: 100%; /* Formularz zajmuje całą szerokość ekranu na telefonie */
    }
}

/* Górna nawigacja */
.top-navbar {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #fff;
    justify-content: space-between;
}

.logo h1 {
    font-size: 24px;
    color: #fff;
}

#entryCount {
    position: absolute;        /* Ustawienie absolutnej pozycji */
    top: 20px;                 /* Odstęp od góry */
    left: 48%;               /* Odstęp od lewej strony (dostosuj do swoich potrzeb) */
    background-color: #48b301; /* Kolor tła */
    color: white;              /* Kolor tekstu */
    padding: 5px 10px;         /* Padding */
    border-radius: 5px;       /* Zaokrąglone rogi */
    font-size: 14px;           /* Rozmiar czcionki */
}


.menu-toggle {
    display: none;
    font-size: 24px;
    color: #fff;
    cursor: pointer;
}

.menu {
    display: flex;
    list-style: none;
    margin-right: 20px;
}

.menu li {
    position: relative;
    margin: 0 15px;
}

.menu a {
    text-decoration: none;
    background-color: #48b301;
    color: #fff;
    font-size: 18px;
    padding: 10px 15px;
    transition: background-color 0.3s ease, color 0.3s ease;
    border-radius: 5px;
}

.menu a:hover {
    background-color: #1e7e34;
    color: #fff;
}

.tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    font-size: 14px;
    padding: 5px 8px;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.menu li:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Responsywność */
@media (max-width: 768px) {
    .logo {
        flex-grow: 1;
        text-align: center;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        top: 10px;
        right: 20px;
    }

    .menu {
        display: none;
        flex-direction: column;
        align-items: center;
        background-color: #333;
        width: 100%;
        padding: 20px 0;
    }

    .menu.active {
        display: flex;
    }

    .menu li {
        margin: 15px 0;
    }

    .tooltip {
        display: none;
    }

    .logo.hidden {
        display: none;
    }
}

/* Popup */
.popup {
    display: none; /* Domyślnie popup jest ukryty */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Ciemne tło za popupem */
    z-index: 1000; /* Zwiększa priorytet wyświetlania popupu */
    display: flex; /* Dodaj flexbox */
    justify-content: center; /* Wyrównanie poziome */
    align-items: center; /* Wyrównanie pionowe */
}

/* Zawartość popupu */
.popup-content {
    background-color: #2a2a2a;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative; /* Ważne dla przycisku zamknięcia */
}

/* X - przycisk zamknięcia */
.popup-close {
    color: #fff;
    background-color: transparent; /* Przezroczyste tło */
    font-size: 24px; /* Zwiększenie rozmiaru czcionki */
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    padding: 5px;
    border: none; /* Brak obramowania */
    transition: color 0.3s ease, background-color 0.3s ease; /* Dodanie efektu przejścia */
}

.popup-close:hover,
.popup-close:focus {
    color: #ff0000; /* Zmiana koloru tekstu na czerwony przy najechaniu */
    background-color: rgba(255, 255, 255, 0.2); /* Dodanie półprzezroczystego tła przy najechaniu */
    border-radius: 50%; /* Zaokrąglone rogi */
    text-decoration: none;
    cursor: pointer;
}

/* Popup */
.inforeifen {
    display: none; /* Domyślnie popup jest ukryty */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Ciemne tło za popupem */
    z-index: 1000; /* Zwiększa priorytet wyświetlania popupu */
    justify-content: center; /* Wyrównanie poziome */
    align-items: center; /* Wyrównanie pionowe */
}

/* Zawartość popupu */
.inforeifen-content {
    background-color: #2a2a2a;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative; /* Ważne dla przycisku zamknięcia */
}

/* X - przycisk zamknięcia */
.inforeifen-close {
    color: #ff0000;
    font-size: 30px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
}

.inforeifen-close:hover,
.inforeifen-close:focus {
    color: rgb(116, 0, 0);
    text-decoration: none;
    cursor: pointer;
}

/* Popup potwierdzenia usunięcia */
#deletePopup .popup-content {
    background-color: #2a2a2a;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative; /* Ważne dla przycisku zamknięcia */
}

#deletePopup .popup-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #ffffff;
}

#deletePopup .popup-content p {
    font-size: 18px;
    margin-bottom: 20px;
    color: #ffffff;
}

#deletePopup .popup-content button {
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 0 10px;
}

#deletePopup .popup-content button:hover {
    background-color: #45a049;
}

#deletePopup .popup-content button:active {
    background-color: #3e8e41;
}

/* Popup potwierdzenia zmiany statusu */
#changeStatusPopup .popup-content {
    background-color: #2a2a2a;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative; /* Ważne dla przycisku zamknięcia */
    margin: auto; /* Center horizontally */
}

#changeStatusPopup .popup-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #ffffff;
}

#changeStatusPopup .popup-content p {
    font-size: 18px;
    margin-bottom: 20px;
    color: #ffffff;
}

#changeStatusPopup .popup-content button {
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 0 10px;
}

#changeStatusPopup .popup-content button:hover {
    background-color: #45a049;
}

#changeStatusPopup .popup-content button:active {
    background-color: #3e8e41;
}

/* Nagłówek formularza */
h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #ffffff;
}

/* Formularze */
form {
    display: flex;
    flex-direction: column;
}

/* Etykiety */
form label {
    text-align: left;
    margin-bottom: 8px;
    font-size: 14px;
    color: #ffffff;
}

/* Pola formularza */
form input {
    padding: 12px;
    margin: 10px 0;
    width: 100%;
    color: white;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 14px;
}

/* Przyciski */
form button {
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

form button:hover {
    background-color: #45a049;
}

form button:active {
    background-color: #3e8e41;
}

a {
    text-decoration: none;
    color: #333;
    font-size: 18px;
    padding: 10px;
    display: inline-block;
}

a:hover {
    color: #007bff;
}

h1 {
    font-size: 2em;
    color: #333;
    margin-bottom: 20px;
}

/* Przycisk "Powrót" */
#backButton {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
}

#backButton:hover {
    background-color: #0056b3;
}