html, body {
    height: 100%;
}
body {
    margin: 0;
    /* Increase top padding to fully expose content below the fixed header */
    padding-top: 210px;
    background-color: #121212;
    color: #f0f0f0;
}
.page-wrapper {
    /* Subtract navbar height so short pages avoid unnecessary scrolling */
    min-height: calc(100vh - 210px);
    display: flex;
    flex-direction: column;
}
main {
    flex: 1;
}

h2, h3 {
    text-align: center;
}

/* Centered layout for the login page form */
.login-form {
    max-width: none;
    margin: auto;
}

.login-form label {
    white-space: nowrap;
}



label, input, button {
    margin: 5px 0;
    padding: 8px;
}


.actions {
    margin-top: 20px;
}

/* Optional wrapper for centering form buttons */
.form-actions {
    text-align: center;
    width: 100%;
    margin-top: 1rem;
}

.custom-btn {
    display: inline-block;
    margin: 10px;
    padding: 12px 24px;
    background-color: #17383E;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.custom-btn:hover {
    background-color: #145360;
}

/* Stylizacja nagłówka */
header {
    background-color: #17383E;
    color: white;
    padding: 20px;
    background-image: url("https://retrievershop.pl/wp-content/uploads/2024/08/paw-pattern-2.svg");
    background-size: cover;
    text-align: center;
}

header .logo img {
    height: 200px;
    vertical-align: middle;
}

/* Logo in the navigation bar */
.navbar-brand img {
    height: 140px;
}


footer {
    margin-top: auto;
    text-align: center;
}

footer a {
    color: #17383E;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.barcode-feedback {
    position: fixed;
    top: 220px;
    right: 1rem;
    max-width: 360px;
    width: min(90vw, 360px);
    z-index: 1100;
    pointer-events: none;
}

.barcode-feedback .alert {
    margin-bottom: 0.5rem;
    pointer-events: auto;
}

/* Ustawienie szerokości tabeli */
table {
    width: 100%; /* Zmniejsz szerokość, aby tabela była bardziej kompaktowa */
    border-collapse: collapse;
    margin-top: 5px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Ustawienie węższej szerokości dla kolumn rozmiarów */
th:nth-child(n+3):nth-child(-n+8),
td:nth-child(n+3):nth-child(-n+8) {
    width: 80px; /* Stała szerokość umożliwia przewijanie na małych ekranach */
    max-width: 80px;
    text-align: center;
    padding: 0; /* Usuń nadmiarowe odstępy */
}

/* Szerokości kolumn w historii drukowania (1,4,1,1,2,2,1 z podziału na 12) */
.history-table col:nth-child(1) { width: 8.33%; }
.history-table col:nth-child(2) { width: 33.33%; }
.history-table col:nth-child(3) { width: 8.33%; }
.history-table col:nth-child(4) { width: 8.33%; }
.history-table col:nth-child(5) { width: 16.67%; }
.history-table col:nth-child(6) { width: 16.67%; }
.history-table col:nth-child(7) { width: 8.33%; }

/* Ensure long tables remain usable on small screens */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    display: block;
}

/* Nagłówki tabeli */
th {
    padding: 8px 12px; /* Zachowaj odstępy tylko w nagłówkach */
    background-color: #17383E;
    color: #fff;
}

/* Stylizacja przycisków wewnątrz tabeli */
.form-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-quantity {
    width: 30px;
    height: 30px;
    font-size: 16px;
    padding: 0;
    margin: 0 2px;
}

.quantity-value {
    min-width: 20px;
    text-align: center;
}

/* Zmniejszenie odstępów w wersji mobilnej */
@media (max-width: 768px) {
    table {
        width: 100%;
    }
    th, td {
        padding: 6px;
        font-size: 0.9em;
    }
}

.log-container {
    max-height: 600px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ccc;
    background-color: #f8f8f8;
    margin: 20px auto;
    width: 90%;
}

.log-content {
    font-family: monospace;
    text-align: left;
    white-space: pre-wrap;
}

#scanner-container {
    width: 100%;
    height: 60vh;
    margin: 0 auto;
}

@media (max-width: 768px) {
    #scanner-container {
        height: 80vh;
    }
}

/* Adjust layout for fixed navbar */

/* Mobile slide-in menu */
@media (max-width: 768px) {
    #mobileMenuBtn {
        margin-right: 1rem;
    }
    .mobile-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 250px;
        height: 100%;
        background-color: #17383E;
        padding: 1rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1050;
        display: flex;
        flex-direction: column;
    }
    .mobile-menu ul {
        flex-grow: 1;
    }
    .mobile-menu.open {
        transform: translateX(0);
    }
    .mobile-menu a {
        color: #fff;
        text-decoration: none;
        display: block;
        padding: 8px 0;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .mobile-menu a:hover {
        background-color: rgba(255, 255, 255, 0.25);
        color: #fff;
    }
}

@media (min-width: 768px) {
    .navbar-nav .nav-link {
        color: #fff;
        padding-left: 1rem;
        padding-right: 1rem;
        transition: background-color 0.2s ease, color 0.2s ease;
    }
    .navbar-nav .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.25);
        color: #fff;
        text-decoration: none;
    }


    .navbar-nav .dropdown-menu {
        position: absolute;
        left: 0;
        top: 100%;
        width: auto;
        min-width: 0;
        transform-origin: top left;
        transform: scaleX(0);
        transition: transform 0.2s ease;
        display: block;
        visibility: hidden;
        opacity: 0;
    }

    .navbar-nav .dropdown-menu.show {
        transform: scaleX(1);
        visibility: visible;
        opacity: 1;
    }
}

.dropdown-menu .dropdown-item {
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-menu .dropdown-item:hover {
    background-color: #1e6a82;
    color: #fff;
}

@media (min-width: 768px) {
    main.container-fluid {
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    .container-fluid.full-width {
        max-width: none;
    }
}




.form-control,
.form-select {
    background-color: #333;
    color: #f0f0f0;
    border-color: #555;
}

/* Additional mobile menu styling */
.mobile-logo {
    height: 40px;
    display: block;
}

/* Orders table column widths - override Bootstrap */
#orders-table-v2 { table-layout: fixed !important; width: 100% !important; }

#orders-table-v2 th,
#orders-table-v2 td { vertical-align: middle !important; }

#orders-table-v2 th:nth-child(1),
#orders-table-v2 td:nth-child(1) { width: 10% !important; }

#orders-table-v2 th:nth-child(2),
#orders-table-v2 td:nth-child(2) { width: 10% !important; }

#orders-table-v2 th:nth-child(3),
#orders-table-v2 td:nth-child(3) { width: 50% !important; }

#orders-table-v2 th:nth-child(4),
#orders-table-v2 td:nth-child(4) { width: 10% !important; }

#orders-table-v2 th:nth-child(5),
#orders-table-v2 td:nth-child(5) { width: 5% !important; }

#orders-table-v2 th:nth-child(6),
#orders-table-v2 td:nth-child(6) { width: 10% !important; }

#orders-table-v2 th:nth-child(7),
#orders-table-v2 td:nth-child(7) { width: 5% !important; }

#orders-table-v2 td:nth-child(3) { 
    white-space: nowrap !important; 
    overflow: hidden !important; 
    text-overflow: ellipsis !important; 
}

@media (max-width: 768px) {
    #mobileMenu .custom-btn {
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
    .mobile-close {
        position: absolute;
        top: 0;
        right: 0;
    }
}

/* Globalny overlay ladowania */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loading-spinner {
    text-align: center;
}
