/* Variables */
:root {
    --font-primary: 'Arial', 'Helvetica', sans-serif;
    --c-highlight: #43a047;
    --c-highlight-soft: #e7fce5;
    --c-highlight-type: #fff;
    --c-price: #B12704;
    --c-special: #3b99fc;
    --c-primary-dark: #131313;
    --c-primary: #313131;
    --c-primary-light: #999;
    --c-secondary: #fff;
    --c-shade-very-dark: #d2d2d2;
    --c-shade-dark: #e2e2e2;
    --c-shade: #f2f2f2;
    --c-shade-light: #f5f5f5;
    --c-shade-very-light: #f9f9f9;
    --c-shadow: rgba(0, 0, 0, .13);
    --c-light: rgba(255, 255, 255, .38);
    --c-very-light: rgba(255, 255, 255, .19);
    --m-border-radius-short: 5px;
    --m-border-radius: 13px;
    --m-distance-very-short: 6px;
    --m-distance-short: 13px;
    --m-distance: 23px;
    --m-distance-long: 33px;
    --f-primary-big: 1.162rem;
    --f-primary: 1rem;
    --f-small: .875rem;
    --f-very-small: .8162rem;
    --d-animation-short: 380ms;
    --d-animation-long: 620ms;
}

/* General Styles */
body {
    font-family: var(--font-primary);
    background-color: white;
}

a {
    text-decoration: none;
    background-color: transparent;
}

button,
input,
select,
textarea {
    background-color: transparent;
    border-style: none;
}

button,
select {
    text-transform: none;
    cursor: pointer;
}

button {
    overflow: visible;
}

/* Buttons */
.button,
button {
    background-color: var(--c-highlight);
    color: var(--c-highlight-type);
    border-radius: var(--m-border-radius-short);
    padding: 0 .75em;
    height: 44px;
    line-height: 44px;
    display: inline-flex;
    align-items: center;
    font-weight: bold;
    -webkit-user-drag: none;
    justify-content: center;
}

.button:hover,
button:hover {
    filter: brightness(1.162);
    box-shadow: 0 1px 13px var(--c-shadow);
}

.button.ghost-style,
button.ghost-style {
    border: 1px solid var(--c-highlight);
    background: none;
}

.button.alt-style,
button.alt-style {
    background-color: var(--c-highlight-type);
    color: var(--c-highlight);
}

button:disabled,
a.button:disabled {
    background-color: var(--c-shade-dark); /* Use a muted color for disabled buttons */
    color: var(--c-primary-light); /* Lighten the text color */
    cursor: not-allowed; /* Change the cursor to indicate it's not clickable */
    opacity: 0.6; /* Reduce opacity for a disabled look */
    box-shadow: none; /* Remove any shadow effects */
    pointer-events: none; /* Prevent interaction */
}

button.page-back {
    position: fixed;
    bottom: 15px;
    right: 15px;
}

/* Navbar */
nav {
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(13px) contrast(2);
    -webkit-backdrop-filter: blur(13px) contrast(2);
    position: fixed;
    top: 0;
    z-index: 1003;
    left: 0;
    width: 100%;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 20px;
}

nav .logo img {
    height: 50px;
    width: auto;
    margin: 10px 20px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    gap: 20px;
}

nav ul li a.button {
    height: 39px;
    line-height: 39px;
    font-weight: normal;
}

nav a.button.active {
    background-color: var(--c-highlight-soft);
    color: var(--c-highlight);
    box-shadow: 0 1px 13px var(--c-shadow);
}

/* Burger Menu */
.burger-menu {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 1004;
}

.menu {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

/* Table Styles */
table {
    width: 100%;
    padding: 10px 5px;
}

table td {
    padding: 3px 5px;
}

table tr:nth-child(even) {
    background-color: #f2f2f2;
}

table tr:nth-child(odd) {
    background-color: #ffffff;
}

table tr:hover {
    background-color: #d1e7fd;
}

table.detailed-listing {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table.detailed-listing th,
table.detailed-listing td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

table.detailed-listing th {
    background-color: #f4f4f4;
    font-weight: bold;
}

table.detailed-listing td a,
table.detailed-listing td button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    margin: 0;
}

table.detailed-listing td a:hover {
    color: var(--c-highlight);
    text-decoration: underline;
}

table.detailed-listing td.sub-table {
    padding: 0 0 0 30px;
    background-color: #f9f9f9;
}

table.detailed-listing td.sub-table table {
    margin: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
    nav .logo img {
        height: 40px;
        width: auto;
        margin: 10px 20px;
    }

    .burger-menu {
        display: block;
    }

    .menu {
        display: none;
        flex-direction: column;
        background-color: white;
        position: absolute;
        top: 60px;
        right: 0;
        width: 100%;
        border-top: 1px solid #616161;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1003;
    }

    .menu.active {
        display: flex;
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
    }

    nav ul li {
        padding: 0 20px;
        border-bottom: 1px solid #e2e2e2;
    }

    nav ul li:last-child {
        border-bottom: 1px solid #616161;
    }

    nav ul li a.button {
        background-color: transparent !important;
        color: var(--c-primary-dark) !important;
        width: 100%;
        text-align: left;
        border: none !important;
        border-radius: 0;
    }

    nav ul li:has(a.active) {
        background-color: var(--c-highlight-soft);
    }
    
    nav a.button.active {
        color: var(--c-highlight) !important;
        box-shadow: none;
    }

    main {
        margin-top: 70px;
    }

    table {
        font-size: 1.2rem;
    }

    #login-form .form-wrapper-input > div {
        flex-direction: column;
        gap: 0 !important;
    }

    #login-form .form-wrapper-input > div > input {
        height: 28px;
    }
}

/* Main Content */
main {
    margin-top: 80px;
    margin-bottom: 45px;
    padding: 0 10px;
}

/* Additional Styles */
div.task-details {
    padding: 5px 8px;
}

small {
    font-size: 0.8rem;
    color: var(--c-primary-light);
}

main>h1 {
    font-size: 2rem;
    margin: 0;
    text-align: center;
}

div.user-info {
    margin: 10px 0 25px 0;
}

div.user-info h2 {
    font-size: 1.5rem;
    margin: 10px 0 0 0;
}

div.user-info p {
    font-size: 1rem;
    margin: 0;
}

div.user-info p small {
    font-size: 1rem;
    color: var(--c-primary-light);
}

#just-scan-info {
    border: 1px solid var(--c-shade-dark);
    padding: var(--m-distance-short);
    display: block;
    border-radius: var(--m-border-radius-short);
    font-size: var(--f-small);
    text-align: left;
}

#just-scan-info h2 {
    font-size: 1.2rem;
    margin: 0;
}

#just-scan-info p {
    margin: 8px 0 0 0;
}

div.order-info {
    margin: 20px 0 25px 0;
}

div.order-info h2 {
    font-size: 1.5rem;
    margin: 10px 0 0 0;
}

div.order-info p {
    font-size: 1rem;
    margin: 5px 0;
}

div.order-info p small {
    font-size: 1rem;
    color: var(--c-primary-light);
}

.ellipsis-1 {
    display: -webkit-box;
    margin-bottom: 0px !important;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    max-height: 1.5rem;
    line-height: 1.5rem;
    transition: max-height 0.3s ease;
}

.ellipsis-2 {
    display: -webkit-box;
    margin-bottom: 0px !important;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    max-height: 1.5rem;
    line-height: 3rem;
    transition: max-height 0.3s ease;
}

.ellipsis-2 {
    display: -webkit-box;
    margin-bottom: 0px !important;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    max-height: 1.5rem;
    line-height: 4.5rem;
    transition: max-height 0.3s ease;
}

.order-note {
    display: -webkit-box;
    margin-bottom: 0px !important;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    max-height: 3rem;
    line-height: 1.5rem;
    transition: max-height 0.3s ease;
}

.order-note.expanded {
    line-clamp: unset;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
    max-height: none;
}

.toggle-note {
    font-size: 0.9rem;
    color: var(--c-primary-light);
    text-decoration: underline;
    cursor: pointer;
    line-height: 1.5rem;
    /* Match the line height of the text */
}

.timer-box p {
    font-weight: bold;
    margin: 8px 0;
}

.timer-box p>span {
    font-weight: normal;
    float: right;
}

.timer-button {
    width: 100%;
    margin-top: 10px;
}

.timer-button.stop-btn {
    background-color: var(--c-price);
}

/* Task Details */
.task-details:nth-child(even) {
    background-color: #f2f2f2;
}

.task-details:nth-child(odd) {
    background-color: #ffffff;
}

.task-details p {
    font-size: 16px;
    margin: 5px 0;
    text-align: right;
}

.task-details p strong {
    float: left;
    margin-right: 10px;
}

/* Table Row Styles */
.align-left {
    text-align: start;
}

.align-center {
    text-align: center;
}

.align-right {
    text-align: end;
}

/* Flexbox */
.center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.center-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.analysis-summary {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: start;
    gap: 40px;
}

.analysis-summary > div:first-child {
    min-width: 370px;
}

.analysis-summary > div:has(#date-filter-my),
.analysis-summary > div:has(#date-filter-pmy) {
    display: flex;
    justify-content: center;
    align-items: center;
}

.analysis-summary > div #date-filter-my {
    margin: 0;
}

/* Paginator */
.pagination {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    gap: 10px;
    margin: 20px 0;
}

.pagination .button {
    height: 30px;
    line-height: 30px;
}

/* Form Create */
form input,
form select,
form textarea {
    background-color: white;
    border-radius: var(--m-border-radius-short);
    border: 1px solid var(--c-shade-dark);
}

form input:disabled,
form select:disabled,
form textarea:disabled {
    background-color: var(--c-shade-very-light);
    color: var(--c-primary-light);
}

form#login-form {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}
form#login-form > div {
    background-color: var(--c-shade-very-light);
    border-radius: var(--m-border-radius);
    border: 1px solid var(--c-shade-dark);
    padding: var(--m-distance);
    margin: var(--m-distance);
}
form#login-form .form-wrapper-input {
    line-height: 28px;
    margin-bottom: 10px;
}
form#login-form .form-wrapper-input div {
    text-wrap-mode: nowrap;
    display: flex;
    gap: 10px;
}
form#login-form .form-wrapper-input input {
    width: 100%;
}
form#login-form .form-wrapper-button {
    display: flex;
    justify-content: center;
    margin-top: 25px;
}
form#login-form .form-wrapper-button button {
    width: 100%;
}

form.form-creation {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

form.form-creation>div {
    width: 50svw;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    background-color: var(--c-shade-very-light);
    border-radius: var(--m-border-radius);
    border: 1px solid var(--c-shade-dark);
    padding: var(--m-distance);
    margin: var(--m-distance);
}

form.form-creation>div>div {
    display: flex;
    flex-direction: column;
}

form.form-creation input,
form.form-creation select,
form.form-creation textarea {
    border-radius: var(--m-border-radius-short);
    border: 1px solid var(--c-shade-dark);
    resize: vertical;
}

form.form-creation input,
form.form-creation select:not([multiple]) {
    height: 28px;
}

form.form-creation textarea,
form.form-creation select[multiple] {
    min-height: 58px;
}

#date-filter-my,
#date-filter-pmy {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

#date-filter-my > div,
#date-filter-pmy > div {
    background-color: var(--c-shade-very-light);
    border-radius: var(--m-border-radius-short);
    border: 1px solid var(--c-shade-dark);
    padding: var(--m-distance-short);
    margin: var(--m-distance-short);
    display: flex;
    gap: 15px;
    align-items: center;
}

#date-filter-my > div select,
#date-filter-pmy > div select {
    height: 30px;
    min-width: 30px;
    max-width: 200px;
}

#date-filter-my button,
#date-filter-pmy button {
    height: 35px;
}

/* Modal Styles */
.qr-code-view {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
}

.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
    /* Show modal when active */
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    max-width: 90%;
    /* Ensure it fits smaller screens */
    max-height: 90%;
    /* Prevent overflow */
    overflow: auto;
    /* Add scroll if content overflows */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.modal-content img {
    max-width: 100%;
    height: auto;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
}

.close-btn:hover {
    color: #ff0000;
    /* Highlight close button on hover */
}

/* Style for error messages */
.errorlist {
    list-style: none;
    padding: 0;
    margin: 5px 0 0 0;
    color: var(--c-price);
    /* Use a red color for errors */
    font-size: var(--f-small);
    font-weight: bold;
}

.errorlist li {
    margin: 0;
    padding: 0;
}

/* Highlight invalid form fields */
form .error {
    border: 1px solid var(--c-price);
    /* Red border for invalid fields */
    background-color: #ffe6e6;
    /* Light red background for invalid fields */
}

/* Messages Container */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

/* Individual Message */
.message {
    border-radius: var(--m-border-radius-short);
    padding: var(--m-distance-short);
    box-shadow: 0 2px 5px var(--c-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn var(--d-animation-short) ease-in-out;
    position: relative;
}

/* Message Types */
.message.info {
    background-color: var(--c-highlight-soft);
    color: var(--c-primary-dark);
    border: 1px solid var(--c-highlight);
}

.message.success {
    background-color: #e7fce5;
    color: #2e7d32;
    border: 1px solid #43a047;
}

.message.warning {
    background-color: #fff8e1;
    color: #f9a825;
    border: 1px solid #fbc02d;
}

.message.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #e53935;
}

/* Message Text */
.message p {
    margin: 0;
    font-size: var(--f-small);
    flex-grow: 1;
}

/* Close Button */
.message-close {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: bold;
    color: var(--c-primary-light);
    cursor: pointer;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.message-close:hover {
    color: var(--c-price);
}

/* Fade-in Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.negative-quantity {
    color: var(--c-highlight);
    font-weight: bold !important;
}

.table-container {
    overflow-x: scroll; /* Enable horizontal scrolling */
    border: 1px solid var(--c-shade-dark); /* Optional: Add a border for better visibility */
    border-radius: var(--m-border-radius-short); /* Optional: Add rounded corners */
    padding: var(--m-distance-very-short); /* Optional: Add padding inside the container */
}

.order-search-filter {
    display: flex;
    justify-content: end;
    gap: 10px;
    margin-bottom: 20px;
}
.order-search-filter > div {
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: var(--m-border-radius-short);
}

.order-search-filter input[name="search"] {
    min-width: 220px;
}

.order-search-filter input,
.order-search-filter select {
    padding: 5px;
    border: 1px solid var(--c-shade-dark);
    border-radius: var(--m-border-radius-short);
}

.order-search-filter button {
    height: 29px;
    width: 80px;
}