* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    color: #FFFFFF;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background 0.3s ease;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://www.transparenttextures.com/patterns/wave.png');
    opacity: 0.05;
    z-index: -1;
}

body.order-theme, body.order-theme-en, body.order-theme-ml {
    background: linear-gradient(135deg, #2C1A4A, #3E2A6B);
}

body.inventory-theme, body.inventory-theme-en, body.inventory-theme-ml {
    background: linear-gradient(135deg, #2C1A4A, #3E2A6B);
}

body.order-theme-en, body.order-theme-ml, body.inventory-theme-en, body.inventory-theme-ml {
    direction: ltr;
}

.banner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: block;
    border-bottom: 3px solid #D4AF37;
}

.banner img {
    width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    background: #FFF8E7;
    padding: 20px;
    border-radius: 20px;
    border: 2px solid #D4AF37;
    position: relative;
}

/* Language Selector */
.language-selector {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #FFF8E7;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #D4AF37;
}

.language-selector select {
    width: 200px;
    padding: 8px 30px 8px 10px;
    border-radius: 5px;
    border: 2px solid #D4AF37;
    background: #FFF8E7;
    font-size: 16px;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
}

.language-selector select:focus {
    outline: none;
    border-color: #1E3A8A;
}

.language-selector::after {
    content: '\f078'; /* FontAwesome chevron-down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    color: #D4AF37;
    pointer-events: none;
}

body.order-theme-en .language-selector::after,
body.order-theme-ml .language-selector::after,
body.inventory-theme-en .language-selector::after,
body.inventory-theme-ml .language-selector::after {
    right: auto;
    left: 10px;
}

h1 {
    text-align: center;
    color: #FFFFFF;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    font-size: 28px;
    position: relative;
    overflow: hidden;
}

body.order-theme h1, body.order-theme-en h1, body.order-theme-ml h1 {
    background: #1E3A8A;
}

body.inventory-theme h1, body.inventory-theme-en h1, body.inventory-theme-ml h1 {
    background: #16A34A;
}

h1::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    color: #FFFFFF;
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

.tab-btn[data-tab="order"] {
    background: #1E3A8A;
}

.tab-btn[data-tab="inventory"] {
    background: #16A34A;
}

.tab-btn.active {
    background: #D4AF37;
}

.tab-btn:hover {
    background: #D4AF37;
}

.tab-content {
    text-align: center;
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: bold;
}

body.order-theme .tab-content, body.order-theme-en .tab-content, body.order-theme-ml .tab-content {
    color: #1E3A8A;
}

body.inventory-theme .tab-content, body.inventory-theme-en .tab-content, body.inventory-theme-ml .tab-content {
    color: #16A34A;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

body.order-theme .input-group i, body.order-theme-en .input-group i, body.order-theme-ml .input-group i {
    color: #1E3A8A;
    right: 15px;
}

body.inventory-theme .input-group i, body.inventory-theme-en .input-group i, body.inventory-theme-ml .input-group i {
    color: #16A34A;
    right: 15px;
}

body.order-theme-en .input-group i, body.order-theme-ml .input-group i,
body.inventory-theme-en .input-group i, body.inventory-theme-ml .input-group i {
    right: auto;
    left: 15px;
}

input, select {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border-radius: 8px;
    font-size: 16px;
    border: 2px solid #D4AF37;
    background: #FFF8E7;
    transition: border-color 0.3s ease;
}

body.order-theme-en input, body.order-theme-ml input,
body.inventory-theme-en input, body.inventory-theme-ml input,
body.order-theme-en select, body.order-theme-ml select,
body.inventory-theme-en select, body.inventory-theme-ml select {
    padding: 12px 15px 12px 45px;
}

input:focus, select:focus {
    outline: none;
}

body.order-theme input:focus, body.order-theme select:focus,
body.order-theme-en input:focus, body.order-theme-ml input:focus,
body.order-theme-en select:focus, body.order-theme-ml select:focus {
    border-color: #1E3A8A;
}

body.inventory-theme input:focus, body.inventory-theme select:focus,
body.inventory-theme-en input:focus, body.inventory-theme-ml input:focus,
body.inventory-theme-en select:focus, body.inventory-theme-ml select:focus {
    border-color: #16A34A;
}

.items-table {
    border: 2px solid #D4AF37;
    border-radius: 10px;
    margin-bottom: 20px;
    background: #FFF8E7;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #D4AF37;
}

th {
    color: #FFFFFF;
    font-size: 16px;
    position: sticky;
    top: 0;
    z-index: 1;
}

body.order-theme th, body.order-theme-en th, body.order-theme-ml th {
    background: #1E3A8A;
}

body.inventory-theme th, body.inventory-theme-en th, body.inventory-theme-ml th {
    background: #16A34A;
}

th:nth-child(1) { width: 50%; }
th.order-column, th.inventory-column { width: 20%; }
th:nth-child(3) { width: 30%; }

td {
    font-size: 14px;
    color: #1A1A1A;
}

td:nth-child(1) {
    font-weight: bold;
    font-size: 16px;
}

body.order-theme td:nth-child(1), body.order-theme-en td:nth-child(1), body.order-theme-ml td:nth-child(1) {
    color: #1E3A8A;
}

body.inventory-theme td:nth-child(1), body.inventory-theme-en td:nth-child(1), body.inventory-theme-ml td:nth-child(1) {
    color: #16A34A;
}

td:nth-child(2) { padding: 5px; }
td:nth-child(3) { font-size: 12px; color: #666; }

tr:nth-child(even) {
    background: rgba(212, 175, 55, 0.1);
}

tr:hover {
    background: rgba(212, 175, 55, 0.2);
}

.item input {
    width: 70px;
    padding: 6px;
    text-align: center;
    border: 2px solid #D4AF37;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

body.order-theme .item input:focus, body.order-theme-en .item input:focus, body.order-theme-ml .item input:focus {
    border-color: #1E3A8A;
}

body.inventory-theme .item input:focus, body.inventory-theme-en .item input:focus, body.inventory-theme-ml .item input:focus {
    border-color: #16A34A;
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 15px;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

body.order-theme .submit-btn, body.order-theme-en .submit-btn, body.order-theme-ml .submit-btn {
    background: #1E3A8A;
}

body.inventory-theme .submit-btn, body.inventory-theme-en .submit-btn, body.inventory-theme-ml .submit-btn {
    background: #16A34A;
}

.submit-btn:hover {
    background: #D4AF37;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: #FFF8E7;
    max-width: 700px;
    width: 90%;
    margin: 50px auto;
    padding: 25px;
    border-radius: 15px;
    position: relative;
    border: 3px solid #D4AF37;
    max-height: 80vh;
    overflow-y: auto;
    box-sizing: border-box;
}

body.order-theme .modal-content, body.order-theme-en .modal-content, body.order-theme-ml .modal-content {
    border-color: #1E3A8A;
}

body.inventory-theme .modal-content, body.inventory-theme-en .modal-content, body.inventory-theme-ml .modal-content {
    border-color: #16A34A;
}

.close-btn {
    position: absolute;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
}

body.order-theme .close-btn, body.order-theme-en .close-btn, body.order-theme-ml .close-btn {
    color: #1E3A8A;
    left: 15px;
}

body.inventory-theme .close-btn, body.inventory-theme-en .close-btn, body.inventory-theme-ml .close-btn {
    color: #16A34A;
    left: 15px;
}

body.order-theme-en .close-btn, body.order-theme-ml .close-btn,
body.inventory-theme-en .close-btn, body.inventory-theme-ml .close-btn {
    left: auto;
    right: 15px;
}

.close-btn:hover {
    color: #D4AF37;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 26px;
    text-align: center;
    font-weight: bold;
}

body.order-theme .modal-content h2, body.order-theme-en .modal-content h2, body.order-theme-ml .modal-content h2 {
    color: #1E3A8A;
}

body.inventory-theme .modal-content h2, body.inventory-theme-en .modal-content h2, body.inventory-theme-ml .modal-content h2 {
    color: #16A34A;
}

.review-header {
    background: rgba(212, 175, 55, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #D4AF37;
}

.review-header p {
    margin: 5px 0;
    font-size: 16px;
    color: #1A1A1A;
}

.review-header strong {
    font-weight: bold;
}

body.order-theme .review-header strong, body.order-theme-en .review-header strong, body.order-theme-ml .review-header strong {
    color: #1E3A8A;
}

body.inventory-theme .review-header strong, body.inventory-theme-en .review-header strong, body.inventory-theme-ml .review-header strong {
    color: #16A34A;
}

.modal-content table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #FFF8E7;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #D4AF37;
    max-height: 50vh;
    display: block;
}

.modal-content thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

body.order-theme .modal-content thead, body.order-theme-en .modal-content thead, body.order-theme-ml .modal-content thead {
    background: #1E3A8A;
}

body.inventory-theme .modal-content thead, body.inventory-theme-en .modal-content thead, body.inventory-theme-ml .modal-content thead {
    background: #16A34A;
}

.modal-content tbody {
    display: block;
    max-height: 40vh;
    overflow-y: auto;
}

.modal-content tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.modal-content th, .modal-content td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #D4AF37;
}

.modal-content th {
    color: #FFFFFF;
    font-size: 16px;
    font-weight: bold;
}

.modal-content td {
    font-size: 14px;
    color: #1A1A1A;
}

.modal-content td:nth-child(1) {
    font-weight: bold;
}

body.order-theme .modal-content td:nth-child(1), body.order-theme-en .modal-content td:nth-child(1), body.order-theme-ml .modal-content td:nth-child(1) {
    color: #1E3A8A;
}

body.inventory-theme .modal-content td:nth-child(1), body.inventory-theme-en .modal-content td:nth-child(1), body.inventory-theme-ml .modal-content td:nth-child(1) {
    color: #16A34A;
}

.modal-content td:nth-child(2) {
    font-weight: bold;
    color: #1A1A1A;
}

.modal-content td:nth-child(3) {
    color: #666;
}

.modal-content tr:nth-child(even) {
    background: rgba(212, 175, 55, 0.1);
}

.modal-content tr:hover {
    background: rgba(212, 175, 55, 0.2);
}

.modal-content th:nth-child(1), .modal-content td:nth-child(1) { width: 50%; }
.modal-content th:nth-child(2), .modal-content td:nth-child(2) { width: 25%; }
.modal-content th:nth-child(3), .modal-content td:nth-child(3) { width: 25%; }

.modal-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 25px;
    position: sticky;
    bottom: 0;
    background: #FFF8E7;
    padding: 10px 0;
    border-top: 1px solid #D4AF37;
}

.confirm-btn, .cancel-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    color: #FFFFFF;
}

.confirm-btn {
    background: #1E3A8A;
}

body.inventory-theme .confirm-btn, body.inventory-theme-en .confirm-btn, body.inventory-theme-ml .confirm-btn {
    background: #16A34A;
}

.confirm-btn:hover {
    background: #D4AF37;
}

.cancel-btn {
    background: #D4AF37;
}

.cancel-btn:hover {
    background: #1E3A8A;
}

body.inventory-theme .cancel-btn:hover, body.inventory-theme-en .cancel-btn:hover, body.inventory-theme-ml .cancel-btn:hover {
    background: #16A34A;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 15px;
        margin: 15px;
    }

    .language-selector select {
        width: 100%;
        font-size: 14px;
    }

    h1 {
        font-size: 22px;
    }

    .tabs {
        flex-direction: column;
        gap: 10px;
    }

    .tab-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .input-group {
        margin-bottom: 15px;
    }

    input, select {
        padding: 10px 40px 10px 15px;
        font-size: 14px;
    }

    body.order-theme-en input, body.order-theme-ml input,
    body.inventory-theme-en input, body.inventory-theme-ml input,
    body.order-theme-en select, body.order-theme-ml select,
    body.inventory-theme-en select, body.inventory-theme-ml select {
        padding: 10px 15px 10px 40px;
    }

    .input-group i {
        font-size: 16px;
    }

    body.order-theme .input-group i, body.order-theme-en .input-group i, body.order-theme-ml .input-group i,
    body.inventory-theme .input-group i, body.inventory-theme-en .input-group i, body.inventory-theme-ml .input-group i {
        right: 10px;
    }

    body.order-theme-en .input-group i, body.order-theme-ml .input-group i,
    body.inventory-theme-en .input-group i, body.inventory-theme-ml .input-group i {
        right: auto;
        left: 10px;
    }

    .items-table {
        border: none;
    }

    table {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tbody, tr {
        display: block;
    }

    tr {
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 15px;
        border: 2px solid #D4AF37;
        border-radius: 8px;
        background: #FFF8E7;
        padding: 10px;
    }

    td {
        display: block;
        width: 100%;
        padding: 8px 10px;
        border: none;
        font-size: 14px;
    }

    body.order-theme td, body.inventory-theme td {
        text-align: right;
    }

    body.order-theme-en td, body.order-theme-ml td,
    body.inventory-theme-en td, body.inventory-theme-ml td {
        text-align: left;
    }

    td:nth-child(1) {
        font-size: 16px;
        font-weight: bold;
        border-bottom: 1px solid #D4AF37;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    td:nth-child(2) {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 10px;
    }

    body.order-theme td:nth-child(2):before, body.inventory-theme td:nth-child(2):before {
        content: "الكمية: ";
        font-weight: bold;
        color: #1A1A1A;
    }

    body.order-theme-en td:nth-child(2):before, body.order-theme-ml td:nth-child(2):before,
    body.inventory-theme-en td:nth-child(2):before, body.inventory-theme-ml td:nth-child(2):before {
        content: "Quantity: ";
    }

    td:nth-child(3) {
        font-size: 12px;
        color: #666;
        padding-top: 5px;
    }

    body.order-theme td:nth-child(3):before, body.inventory-theme td:nth-child(3):before {
        content: "وحدة القياس: ";
        font-weight: bold;
        color: #666;
    }

    body.order-theme-en td:nth-child(3):before, body.order-theme-ml td:nth-child(3):before,
    body.inventory-theme-en td:nth-child(3):before, body.inventory-theme-ml td:nth-child(3):before {
        content: "Unit: ";
    }

    .item input {
        width: 60px;
        padding: 5px;
        font-size: 12px;
    }

    .submit-btn {
        padding: 12px;
        font-size: 16px;
    }

    .modal-content {
        margin: 20px;
        max-width: 90%;
        padding: 15px;
        max-height: 90vh;
    }

    .modal-content table {
        max-height: 60vh;
    }

    .modal-content tbody {
        max-height: 50vh;
    }

    .modal-content h2 {
        font-size: 20px;
    }

    .review-header {
        padding: 10px;
        margin-bottom: 15px;
    }

    .review-header p {
        font-size: 14px;
    }

    .modal-content th, .modal-content td {
        font-size: 12px;
        padding: 8px;
    }

    .modal-actions {
        flex-direction: column;
        gap: 10px;
        padding: 10px 0;
    }

    .confirm-btn, .cancel-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
}