/* General container */
.menu-wrapper {
padding: 2rem;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
direction: rtl;
max-width: 1200px;
margin: 2rem auto;
background: linear-gradient(135deg, #0c0032, #1a002d);
border-radius: 15px;
box-shadow: 0 4px 30px rgba(58, 0, 130, 0.5);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
color: #e0d7ff;
border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Menu header */
.menu-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
flex-wrap: wrap; /* Allows wrapping on smaller screens */
gap: 1rem;
}

.menu-header h2 {
font-size: 2.2rem;
color: #d6cfff;
margin: 0;
text-shadow: 0 0 8px #9a7aff;
user-select: none;
}

.menu-actions {
display: flex;
flex-wrap: wrap;
gap: 0.75rem; /* Reduced gap for smaller buttons */
}

.menu-actions button,
.menu-header button {
background: linear-gradient(135deg, #7e57c2, #5e35b1);
color: #eee;
border: none;
padding: 0.6rem 1.2rem; /* Reduced padding for smaller buttons */
border-radius: 12px;
cursor: pointer;
font-size: 1rem; /* Smaller font size */
font-weight: 600;
box-shadow: 0 0 10px #8e6fe3cc; /* Slightly smaller shadow */
transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.menu-actions button:hover,
.menu-header button:hover {
background: linear-gradient(135deg, #9a7aff, #7e57c2);
box-shadow: 0 0 18px #b3a5ffcc; /* Adjusted shadow on hover */
transform: translateY(-2px); /* A subtle lift effect */
}

.menu-actions button:active,
.menu-header button:active {
transform: translateY(0); /* Button returns to original position on click */
box-shadow: 0 0 8px #8e6fe3cc;
}

/* Category items */
.category-item {
background: rgba(58, 0, 130, 0.3);
margin-bottom: 1.2rem;
border-radius: 15px;
box-shadow: 0 4px 12px rgba(58, 0, 130, 0.4);
transition: background 0.3s ease;
overflow: hidden;
}

.category-item:hover {
background: rgba(90, 35, 180, 0.5);
box-shadow: 0 8px 24px #9a7affbb;
}

/* Category header */
.category-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.9rem 1.4rem;
font-weight: 600;
font-size: 1.25rem;
color: #d3c7ff;
user-select: none;
}

.category-name {
flex-grow: 1;
}

/* Category action buttons */
.category-actions button {
margin-left: 0.5rem;
padding: 0.35rem 1rem;
border: none;
border-radius: 10px;
cursor: pointer;
font-size: 1rem;
font-weight: 600;
color: #f5f3ff;
background: linear-gradient(135deg, #6a4bc9, #4a3693);
box-shadow: 0 0 10px transparent;
transition: all 0.3s ease;
user-select: none;
}

.category-actions button:hover {
transform: scale(1.07);
background: linear-gradient(135deg, #9a7aff, #7e57c2);
box-shadow: 0 0 20px #b3a5ffcc;
}

/* Products table */
.products-table {
width: 100%;
border-collapse: separate;
border-spacing: 0 10px;
background: transparent;
margin: 1rem 0 1.5rem 0;
user-select: none;
}

.products-table thead tr {
background: linear-gradient(135deg, #321e68, #3b0a66);
box-shadow: 0 4px 10px #4b2ca9aa;
border-radius: 15px;
}

.products-table th,
.products-table td {
padding: 0.8rem 1rem;
text-align: center;
font-size: 1rem;
color: #ccc;
vertical-align: middle;
font-weight: 500;
border: none;
}

.products-table th {
font-weight: 700;
color: #d3c7ff;
}

.products-table tbody tr {
background: rgba(58, 0, 130, 0.3);
box-shadow: 0 4px 12px rgba(58, 0, 130, 0.4);
border-radius: 15px;
transition: background 0.3s ease;
}

.products-table tbody tr:hover {
background: rgba(90, 35, 180, 0.5);
box-shadow: 0 8px 24px #9a7affbb;
}

/* Small product image */
.product-img-small {
width: 60px;
height: 40px;
object-fit: cover;
border-radius: 10px;
box-shadow: 0 0 8px rgba(150, 100, 255, 0.6);
}

/* Product action buttons */
.products-table td button {
margin: 0 0.3rem;
padding: 0.4rem 0.9rem;
border: none;
border-radius: 10px;
cursor: pointer;
font-size: 0.95rem;
font-weight: 600;
transition: all 0.3s ease;
color: #f5f3ff;
background: linear-gradient(135deg, #6a4bc9, #4a3693);
box-shadow: 0 0 10px transparent;
user-select: none;
}

.products-table td button:hover {
transform: scale(1.08);
background: linear-gradient(135deg, #9a7aff, #7e57c2);
box-shadow: 0 0 20px #b3a5ffcc;
opacity: 0.95;
}

/* Add product button */
.btn-add-product {
display: inline-block;
background: linear-gradient(135deg, #7e57c2, #5e35b1);
color: #eee;
padding: 0.85rem 1.8rem;
font-size: 1.15rem;
font-weight: 700;
border: none;
border-radius: 14px;
cursor: pointer;
box-shadow: 0 0 18px #8e6fe3cc;
transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.25s ease;
user-select: none;
text-align: center;
margin-bottom: 1rem;
margin-right: 1rem;
}

.btn-add-product:hover {
background: linear-gradient(135deg, #9a7aff, #7e57c2);
box-shadow: 0 0 30px #b3a5ffcc;
transform: scale(1.07);
}

/* Modal form */
.form-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(10, 0, 40, 0.85);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
backdrop-filter: blur(15px);
-webkit-backdrop-filter: blur(15px);
}

.form-modal {
background: rgba(30, 10, 60, 0.9);
padding: 2rem 2.5rem;
border-radius: 18px;
box-shadow: 0 0 40px #7a64ffaa;
width: 350px;
max-width: 90%;
color: #e0d7ff;
font-size: 1rem;
user-select: none;
display: flex;
flex-direction: column;
gap: 1.2rem;
}

.form-modal h3 {
margin: 0;
font-size: 1.5rem;
color: #b0a5ff;
text-align: center;
text-shadow: 0 0 8px #9a7aff;
}

.form-modal input[type="text"],
.form-modal input[type="number"],
.form-modal input[type="file"],
.form-modal select,
.form-modal textarea {
background: rgba(58, 0, 130, 0.45);
border: none;
border-radius: 12px;
padding: 0.85rem 1.2rem;
color: #ddd;
font-size: 1.05rem;
outline: none;
box-shadow: inset 0 0 12px #7c64ffaa;
transition: box-shadow 0.3s ease, background-color 0.3s ease;
direction: rtl;
width: 100%;
resize: vertical;
user-select: text;
}

.form-modal input[type="text"]:focus,
.form-modal input[type="number"]:focus,
.form-modal input[type="file"]:focus,
.form-modal select:focus,
.form-modal textarea:focus {
box-shadow: 0 0 18px #a497ffcc;
background: rgba(58, 0, 130, 0.75);
color: #fff;
}

.form-buttons {
display: flex;
justify-content: space-around;
gap: 1rem;
}

.form-buttons button {
flex: 1;
padding: 0.7rem 0;
border-radius: 12px;
border: none;
font-weight: 700;
font-size: 1.05rem;
cursor: pointer;
transition: background 0.3s ease, box-shadow 0.3s ease;
user-select: none;
box-shadow: 0 0 15px transparent;
color: #e0d7ff;
}

.form-buttons button.submit-btn {
background: linear-gradient(135deg, #5a2db3, #4a2c92);
box-shadow: 0 0 25px #916affcc;
}

.form-buttons button.submit-btn:hover {
background: linear-gradient(135deg, #8e6fe3, #735bcc);
box-shadow: 0 0 35px #b3a5ffcc;
}

.form-buttons button.cancel-btn {
background: linear-gradient(135deg, #4a2a6f, #321e68);
box-shadow: 0 0 15px #7345bbcc;
}

.form-buttons button.cancel-btn:hover {
background: linear-gradient(135deg, #735bcc, #593ea9);
box-shadow: 0 0 25px #9a7affcc;
}

/* Error message */
.error-message {
color: #ff6b6b;
font-weight: 700;
font-size: 0.9rem;
text-align: center;
user-select: none;
}

/* Report-specific styles */
.report-controls {
display: flex;
flex-direction: column;
gap: 1rem;
padding: 1.5rem;
border-radius: 8px;
background-color: rgba(58, 0, 130, 0.3);
box-shadow: 0 4px 6px rgba(58, 0, 130, 0.4);
margin-bottom: 2rem;
color: #d3c7ff;
}

.report-controls h3 {
margin-bottom: 0.5rem;
color: #d6cfff;
text-shadow: 0 0 8px #9a7aff;
}

.report-controls select {
background: rgba(58, 0, 130, 0.45);
border: none;
border-radius: 12px;
padding: 0.85rem 1.2rem;
color: #ddd;
font-size: 1.05rem;
outline: none;
box-shadow: inset 0 0 12px #7c64ffaa;
transition: box-shadow 0.3s ease, background-color 0.3s ease;
direction: rtl;
width: 100%;
}

.report-controls button {
background: linear-gradient(135deg, #7e57c2, #5e35b1);
color: #eee;
border: none;
padding: 0.75rem 1.6rem;
border-radius: 12px;
cursor: pointer;
font-size: 1.15rem;
font-weight: 600;
box-shadow: 0 0 15px #8e6fe3cc;
transition: background 0.3s ease, box-shadow 0.3s ease;
}

.report-controls button:hover {
background: linear-gradient(135deg, #9a7aff, #7e57c2);
box-shadow: 0 0 25px #b3a5ffcc;
}

.report-results {
background-color: rgba(58, 0, 130, 0.3);
padding: 2rem;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(58, 0, 130, 0.4);
}

.report-summary {
font-size: 1.1rem;
line-height: 1.8;
}

.report-summary h4 {
border-bottom: 2px solid #5a2db3;
padding-bottom: 0.5rem;
margin-top: 1.5rem;
color: #d3c7ff;
}

.report-summary p {
margin: 0.5rem 0;
}

.text-success {
color: #28a745;
font-weight: bold;
}

.text-danger {
color: #dc3545;
font-weight: bold;
}

.report-table {
width: 100%;
border-collapse: collapse;
margin-top: 1rem;
}

.report-table th, .report-table td {
border: 1px solid #4a2c92;
padding: 12px;
text-align: right;
color: #d3c7ff;
}

.report-table thead {
background-color: rgba(90, 35, 180, 0.5);
color: #fff;
}

.report-table tbody tr:nth-child(even) {
background-color: rgba(58, 0, 130, 0.2);
}

.report-table tbody tr {
background-color: rgba(58, 0, 130, 0.3);
}

.report-table tbody tr:hover {
background-color: rgba(90, 35, 180, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
.menu-wrapper {
padding: 1rem 1.2rem;
margin: 1rem;
}
.menu-header {
flex-direction: column;
align-items: flex-start;
}
.menu-header h2 {
font-size: 1.8rem;
text-align: right;
}
.menu-actions {
flex-direction: column;
width: 100%;
}
.menu-actions button {
width: 100%;
text-align: center;
padding: 0.8rem 1rem;
}
.products-table th,
.products-table td {
font-size: 0.9rem;
padding: 0.6rem 0.8rem;
}
.product-img-small {
width: 50px;
height: 35px;
}
.category-header {
flex-direction: column;
align-items: flex-start;
gap: 0.5rem;
}
.category-actions {
width: 100%;
display: flex;
justify-content: flex-end;
flex-wrap: wrap;
gap: 0.5rem;
}
.form-modal {
width: 95%;
padding: 1.5rem 1.2rem;
}
.form-buttons {
flex-direction: column;
}
.form-buttons button {
width: 100%;
}
}

/* Light Theme */
body[data-theme="light"] .menu-wrapper {
background: linear-gradient(135deg, #f9f9fc, #e0e0f7);
color: #2c2c34;
border: 1px solid rgba(0, 0, 0, 0.08);
box-shadow: 0 4px 30px rgba(100, 100, 150, 0.15);
backdrop-filter: none;
-webkit-backdrop-filter: none;
}

body[data-theme="light"] .menu-header h2 {
color: #5a4a9e;
text-shadow: none;
}

body[data-theme="light"] .menu-actions button,
body[data-theme="light"] .menu-header button {
background: linear-gradient(135deg, #7b68ee, #6a5acd);
color: #fff;
box-shadow: 0 0 12px #7b68eeaa;
transition: background 0.3s ease, box-shadow 0.3s ease;
}

body[data-theme="light"] .menu-actions button:hover,
body[data-theme="light"] .menu-header button:hover {
background: linear-gradient(135deg, #9a87ff, #7b68ee);
box-shadow: 0 0 20px #9a87ffcc;
}

body[data-theme="light"] .category-item {
background: rgba(230, 230, 255, 0.7);
box-shadow: 0 4px 12px rgba(150, 150, 200, 0.3);
transition: background 0.3s ease;
color: #3a3a4d;
}

body[data-theme="light"] .category-item:hover {
background: rgba(200, 200, 255, 0.9);
box-shadow: 0 8px 24px #9a87ffbb;
}

body[data-theme="light"] .category-header {
color: #4b4b65;
}

body[data-theme="light"] .category-actions button {
background: linear-gradient(135deg, #8a7fe9, #6e6ad1);
color: #fff;
box-shadow: 0 0 8px transparent;
transition: all 0.3s ease;
}

body[data-theme="light"] .category-actions button:hover {
background: linear-gradient(135deg, #b3a5ff, #9a87ff);
box-shadow: 0 0 18px #b3a5ffcc;
transform: scale(1.07);
}

body[data-theme="light"] .products-table thead tr {
background: linear-gradient(135deg, #a1a1d6, #8c8cce);
box-shadow: 0 4px 10px #7b68eeaa;
color: #333366;
}

body[data-theme="light"] .products-table th,
body[data-theme="light"] .products-table td {
color: #4a4a6a;
font-weight: 600;
}

body[data-theme="light"] .products-table tbody tr {
background: rgba(230, 230, 255, 0.8);
box-shadow: 0 4px 12px rgba(150, 150, 200, 0.3);
border-radius: 15px;
transition: background 0.3s ease;
}

body[data-theme="light"] .products-table tbody tr:hover {
background: rgba(210, 210, 255, 1);
box-shadow: 0 8px 24px #b3a5ffbb;
}

body[data-theme="light"] .product-img-small {
box-shadow: 0 0 8px rgba(120, 100, 255, 0.5);
}

body[data-theme="light"] .products-table td button {
background: linear-gradient(135deg, #8a7fe9, #6e6ad1);
color: #fff;
box-shadow: 0 0 10px transparent;
transition: all 0.3s ease;
}

body[data-theme="light"] .products-table td button:hover {
background: linear-gradient(135deg, #b3a5ff, #9a87ff);
box-shadow: 0 0 20px #b3a5ffcc;
transform: scale(1.08);
opacity: 0.95;
}

body[data-theme="light"] .btn-add-product {
background: linear-gradient(135deg, #7b68ee, #6a5acd);
color: #fff;
box-shadow: 0 0 18px #7b68eecc;
}

body[data-theme="light"] .btn-add-product:hover {
background: linear-gradient(135deg, #9a87ff, #7b68ee);
box-shadow: 0 0 30px #9a87ffcc;
transform: scale(1.07);
}

body[data-theme="light"] .form-overlay {
background: rgba(245, 245, 255, 0.9);
backdrop-filter: none;
-webkit-backdrop-filter: none;
}

body[data-theme="light"] .form-modal {
background: #f2f2ff;
color: #3a3a5a;
box-shadow: 0 0 40px #9a87ffcc;
}

body[data-theme="light"] .form-modal h3 {
color: #6e6ad1;
text-shadow: none;
}

body[data-theme="light"] .form-modal input[type="text"],
body[data-theme="light"] .form-modal input[type="number"],
body[data-theme="light"] .form-modal input[type="file"],
body[data-theme="light"] .form-modal select,
body[data-theme="light"] .form-modal textarea {
background: #eaeaff;
color: #333366;
box-shadow: inset 0 0 12px #b3a5ffcc;
}

body[data-theme="light"] .form-modal input[type="text"]:focus,
body[data-theme="light"] .form-modal input[type="number"]:focus,
body[data-theme="light"] .form-modal input[type="file"]:focus,
body[data-theme="light"] .form-modal select:focus,
body[data-theme="light"] .form-modal textarea:focus {
background: #d3d3ff;
color: #1a1a5a;
box-shadow: 0 0 18px #9a87ffcc;
}

body[data-theme="light"] .form-buttons button {
color: #3a3a5a;
box-shadow: 0 0 15px transparent;
}

body[data-theme="light"] .form-buttons button.submit-btn {
background: linear-gradient(135deg, #6a5acd, #5a4a9e);
box-shadow: 0 0 25px #7b68eecc;
color: #fff;
}

body[data-theme="light"] .form-buttons button.submit-btn:hover {
background: linear-gradient(135deg, #9a87ff, #7b68ee);
box-shadow: 0 0 35px #b3a5ffcc;
}

body[data-theme="light"] .form-buttons button.cancel-btn {
background: linear-gradient(135deg, #7b68ee, #5a4a9e);
box-shadow: 0 0 15px #7b68eecc;
color: #fff;
}

body[data-theme="light"] .form-buttons button.cancel-btn:hover {
background: linear-gradient(135deg, #9a87ff, #7b68ee);
box-shadow: 0 0 25px #b3a5ffcc;
}

body[data-theme="light"] .error-message {
color: #d9534f;
}

/* Report-specific styles for light theme */
body[data-theme="light"] .report-controls {
background-color: rgba(230, 230, 255, 0.7);
box-shadow: 0 4px 6px rgba(150, 150, 200, 0.3);
color: #4b4b65;
}

body[data-theme="light"] .report-controls h3 {
color: #5a4a9e;
text-shadow: none;
}

body[data-theme="light"] .report-controls select {
background: #eaeaff;
color: #333366;
box-shadow: inset 0 0 12px #b3a5ffcc;
}

body[data-theme="light"] .report-controls select:focus {
background: #d3d3ff;
color: #1a1a5a;
box-shadow: 0 0 18px #9a87ffcc;
}

body[data-theme="light"] .report-controls button {
background: linear-gradient(135deg, #7b68ee, #6a5acd);
color: #fff;
box-shadow: 0 0 12px #7b68eeaa;
}

body[data-theme="light"] .report-controls button:hover {
background: linear-gradient(135deg, #9a87ff, #7b68ee);
box-shadow: 0 0 20px #9a87ffcc;
}

body[data-theme="light"] .report-results {
background-color: rgba(230, 230, 255, 0.8);
box-shadow: 0 4px 6px rgba(150, 150, 200, 0.3);
}

body[data-theme="light"] .report-summary h4 {
border-bottom: 2px solid #9a87ff;
color: #4b4b65;
}

body[data-theme="light"] .report-table th, body[data-theme="light"] .report-table td {
border: 1px solid #c0c0e0;
color: #4a4a6a;
}

body[data-theme="light"] .report-table thead {
background-color: rgba(161, 161, 214, 0.7);
color: #333366;
}

body[data-theme="light"] .report-table tbody tr:nth-child(even) {
 background-color: rgba(230, 230, 255, 0.5);
}

body[data-theme="light"] .report-table tbody tr {
background-color: rgba(230, 230, 255, 0.8);
}

body[data-theme="light"] .report-table tbody tr:hover {
background-color: rgba(210, 210, 255, 1);
}