:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --background-color: #f8f9fa;
    --border-color: #dee2e6;
    --bs-primary: #0d6efd;
    --bs-primary-rgb: 13, 110, 253;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-info: #0dcaf0;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;
}

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    min-height: 100vh;
}

.top-nav {
    background-color: white;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    height: 40px;
}

.company-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.cost-center, .supplier {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cost-center-icon {
    color: var(--secondary-color);
}

.cost-center-dropdown, .supplier-dropdown, .customer-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    margin-top: 0.25rem;
    z-index: 1000;
    display: none;
}

.customer-dropdown {
    max-height: 500px;
    overflow-y: auto;
}

.cost-center-dropdown.active, .supplier-dropdown.active, .customer-dropdown.active {
    display: block;
}

.cost-center-dropdown .dropdown-item, .supplier-dropdown .dropdown-item, .customer-dropdown .dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.cost-center-dropdown .dropdown-item:hover, .supplier-dropdown .dropdown-item:hover, .customer-dropdown .dropdown-item:hover {
    background-color: #e8f0f8;
}

.customer-dropdown {
    width: 480px;
}

.cost-center-dropdown .dropdown-item {
    overflow: hidden;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links a:hover {
    text-decoration: underline;
}

.view-navigation {
    padding: 1rem 2rem;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
}

.nav-button {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.nav-button:hover {
    background: var(--background-color);
}

.nav-button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* View Navigation */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Product Selection Page */
.product-selection {
    width: 100%;
}

.product-selection .row {
    --bs-gutter-x: 2rem;
}

.categories {
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 4px;
}

.categories li:hover,
.categories li.active {
    background-color: var(--background-color);
}

.categories .list-group-item.active {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-color: rgba(var(--bs-primary-rgb), 0.2);
    color: var(--bs-primary);
}

.categories .list-group-item.active i {
    color: var(--bs-primary);
}

.products-list {
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    transition: background-color 0.2s ease;
}

.product-row:last-child {
    border-bottom: none;
}

.product-row:hover {
    background-color: var(--bs-light);
}

.product-row.selected {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Order Form Styles */
.order-form {
}
.card-header.bg-primary2 {
    min-height: 57px;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.order-table th,
.order-table td {
    vertical-align: middle;
    padding: 0.75rem;
    border: 1px solid var(--bs-border-color);
    text-align: center;
}

.order-table th {
    background-color: #FBCF53;
    color: black;
}

.order-table th.holiday {
    background-color: var(--bs-danger) !important;
    color: white;
}

.order-table input[type="number"] {
    width: 40px;
    padding: 0.375rem;
    border: 1px solid #aaa;
    border-radius: 0.375rem;
    text-align: center;
}

.order-table input[type="number"]:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
    outline: none;
}

.order-table input[type="number"]:disabled {
    background-color: var(--bs-light);
    cursor: not-allowed;
}

/* Chrome, Safari, Edge, Opera */
.order-table input[type="number"]::-webkit-inner-spin-button,
.order-table input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
.order-table input[type="number"] {
    -moz-appearance: textfield;
}



.order-table tr:last-child {
    font-weight: bold;
    background-color: var(--background-color);
}

.week-selector {
    display: flex;
    align-items: center;
}

.week-selector button.next {
    padding: 0.5rem 1rem;
    border: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

.week-selector button:hover {
    opacity: 0.9;
}

.placeholder-value {
    opacity: 0.5;
}
.order-table input {
    color: #333399 !important;
}
.order-table input::placeholder {
    color: #999999 !important;
}

.table-responsive {
    border-radius: 0.375rem;
    background: white;
    max-height: calc(100vh - 200px); /* Set a max height to enable scrolling */
    overflow-y: auto;
}
#missingDeliveryForm .table-responsive {
    max-height: calc(100vh - 400px); /* Set a max height to enable scrolling */
}
/*
#specific-order-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}
*/
#specific-order-table thead th {
    background-color: #FBCF53; /* Ensure the background color is applied */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1); /* Add subtle shadow for separation */
}

.btn {
    transition: all 0.2s ease;
}

.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.15em;
    vertical-align: top;
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: 1px solid rgba(0, 0, 0, 0.25);
    appearance: none;
    print-color-adjust: exact;
    transition: all 0.2s ease-in-out;
}

.form-check-input[type="checkbox"] {
    border-radius: 0.25em;
}

.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Table cell styling */
td.weekend {
    background: #f8f8f8;
}

td.past-day, td.past-day > input {
    background: #f8f8f8 !important;
    color: #777 !important;
}
td.past-day > input {
    border: 1px solid var(--bs-border-color) !important;
}

td.holiday, td.holiday > input {
    background: #fee !important;
    color: #333 !important;
}

/* Product Selection Page */
.product-selection {
    width: 100%;
}

.product-selection .row {
    --bs-gutter-x: 2rem;
}

.categories {
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 4px;
}

.categories li:hover,
.categories li.active {
    background-color: var(--background-color);
}

.categories .list-group-item.active {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-color: rgba(var(--bs-primary-rgb), 0.2);
    color: var(--bs-primary);
}

.categories .list-group-item.active i {
    color: var(--bs-primary);
}

.products-list {
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    transition: background-color 0.2s ease;
}

.product-row:last-child {
    border-bottom: none;
}

.product-row:hover {
    background-color: var(--bs-light);
}

.product-row.selected {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* custom styles */
.bg-primary2 {
    background-color: #feefc6 !important;
    color: #333 !important;
}

#categories-box {
    position: sticky;
    top: 83px;
}
.dropdown-item > i {
    margin-right: 5px;
}
.z-10 {
    z-index: 10;
}

/* Sticky bottom row */
.sticky-bottom {
    position: sticky;
    bottom: 0;
    z-index: 9; /* Slightly lower than header to prevent overlap issues */
    background-color: white; /* Ensure background is solid */
    box-shadow: 0 -1px 2px rgba(0,0,0,0.1); /* Add subtle shadow for separation */
}

/* Style for the sum row */
.sum-row td {
    font-weight: bold;
    background-color: #f4f6f8;
    white-space: nowrap;
}

.date-day {
    margin-left: 6px;
    opacity: 0.4;
    font-size: 80%;
}

/* Spinner Animation */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s;
}

.spinner-overlay.active {
    visibility: visible;
    opacity: 1;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.delivery-info {
    font-weight: normal;
    font-size: 0.9rem;
    opacity: 0.8;
    color: #333;
}

/* Promotion styling */
tr.promotion td {
    background-color: #fff8e1 !important; /* Light yellow background */
}
/*
tr.promotion td.holiday {
    background-color: #fee !important;
}
tr.promotion td.weekend {
    background-color: #f0f0f0 !important;
}
*/
td.holiday input, td.weekend input,
td.holiday .btn-decrement, td.weekend .btn-decrement,
td.holiday .btn-increment, td.weekend .btn-increment {
    display: none;
}

.btn-decrement, .btn-increment {
    visibility: hidden;
    opacity: 0 !important;
}
td:hover .btn-decrement, td:hover .btn-increment {
    visibility: visible;
    opacity: 1 !important;
}

tr.promotion td:first-child {
    position: relative;
    color: red;
}

/* Hide all Promotions in order template */
#weekly-order-template tr.promotion {
    display: none;
}

/* Hide Promotion for product-999 in other weeks */
.product-999:not(.week-16) {
    display: none;
}
.product-998:not(.week-22) {
    display: none;
}
/* PAPA Kekse am Freitag nicht verkaufen */
.product-998.week-22 td.weekday-fr input {
    display: none;
}

.product-price {
    color:#999 !important;
    font-size: 0.9rem;
    float: right;
}

.form-control {
    display: inline;
}

.btn.disabled {
    opacity: 0.2;
}

li.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
li.disabled a {
    cursor: not-allowed;
}

.text-muted {
    opacity: 0.5;
}
.hidden {
    display: none !important;
}
.product-row.disabled,
.product-row.disabled .form-check-input,
.product-row.disabled .product-label,
.product-row.disabled .product-price {
    cursor: not-allowed;
}

.order-table tr.disabled,
.order-table tr.disabled .value-input-weekly,
.order-table tr.disabled .btn {
    opacity: 0.5;
    cursor: not-allowed !important;
}

.hidden {
    display: none;
}

/* Product category visibility */
.product-category {
    display: none;
}

.product-category.active {
    display: flex;
}

/* Show all products when 'all' category is selected */
.show-all-categories .product-category {
    display: flex;
}

/* Login Modal Styles */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s;
    overflow-y: auto;
}

/* Hide the main app content when the login modal is active */
body.login-active .app-container {
    display: none;
}

/* This will prevent any content from being visible behind the login screen */
body.login-active {
    background-color: #f8f9fa;
}

.login-modal.active {
    visibility: visible;
    opacity: 1;
}

.login-container {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-header h2 {
    color: #333;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

.login-form input {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.login-form input:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.value-input-wrapper {
    flex-wrap: nowrap;
}
.total, .product-price {
    text-wrap: nowrap;
}
.product-name {
    text-align: left;
}

.btn-warning:disabled {
    opacity: 0.3;
    cursor: not-allowed !important;
}

.xsmall {
    font-size: .7em;
}

/* Login Modal */
.login-page {
    display: flex;
    min-height: 100vh; /* minimum full screen height */
    width: 100vw;
    flex-direction: row;
    background-color: #ffffff;
}
.login-page .login-header {
    text-align: left;
}

.login-page h2 {
    font-weight: 600;
}
  
/* Right column (1/3 width) */
.login-page .right-column {
    width: 40%;
    /*min-width: 400px;*/
    background-color: #ffffff;
    padding: 20px 40px;
    margin: auto;
}
  
/* Left column (2/3 width) */
.login-page .left-column {
    width: 60%;
    background: url(/img/bakerix-background-1400.webp);
    background-size: cover;
    background-position: center;
    padding: 20px;
    position: relative;
}

.login-container-responsive {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.login-container-responsive .cta {
    margin-top: 80px;
    margin-bottom: 40px;
    color: #444;
}
.login-container-responsive h3 {
    font-size: 1.2rem;
}

.login-page .grey-block {
    background-color: #333;
    color: #ffc107;
    opacity: 0.8;
    padding: 10px;
    border-radius: 10px;
    font-size: 1.8rem;
    line-height: 1.8rem;
    display: inline-block;
    margin-bottom: 20px;
    font-weight: 600;
}

.login-page .yellow-block {
    background-color: #ffc107;
    color: #000;
    opacity: 0.8;
    padding: 10px;
    border-radius: 10px;
    font-size: 2.4rem;
    line-height: 2.4rem;
    display: inline-block;
    margin-top: 100px;
    font-weight: 600;
}

.login-page .logo {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

/* Startup Container */
.startup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.startup-container img {
    max-width: 200px;
}

/* Responsive styles for screens < 480px */
@media (max-width: 840px) {
    .login-page {
      flex-direction: column;
    }
  
    .login-page .right-column,
    .login-page .left-column {
      width: 100%;
    }
  
    /* Display right column on top */
    .login-page .right-column {
      order: 0;
    }
  
    .login-page .left-column {
      order: 1;
      min-height: 800px;
      min-width: 360px;
    }

    #login-logo {
        top: 10px !important;
    }
}