/* General Body Styles */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #F5F5F5; /* Off-White */
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
a{
    text-decoration:none;
}
/* Container */
.container {
    max-width: 960px; /* Slightly wider for tables */
    margin: 30px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: #6A0DAD; /* Deep Purple */
    text-align: center;
    margin-bottom: 20px;
}

/* Form Styles */
form {
    margin-top: 20px;
}

form div {
    margin-bottom: 15px;
}

form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="date"],
form input[type="file"],
form textarea,
form select { /* Added select */
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box; /* Ensure padding doesn't increase width */
}

form input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

form input[readonly],
form select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

form input[type="submit"] {
    background-color: #6A0DAD; /* Deep Purple */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.3s ease;
}

form input[type="submit"]:hover {
    background-color: #B399D4; /* Soft Mauve */
}

/* Error Messages */
.error {
    color: #8B0000; /* Burgundy for accents */
    font-size: 0.9em;
    margin-top: 5px;
    display: block;
}

.info-text {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
    display: block;
}

/* Flash Messages */
#msg-flash {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

/* Links */
a {
    color: #A7C7E7; /* Pale Blue */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Google Login Button */
.google-login {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.btn-google {
    display: inline-block;
    background-color: #db4437; /* Google Red */
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.btn-google:hover {
    background-color: #c23321;
}

/* Header Styles */
.main-header {
    background-color: #6A0DAD; /* Deep Purple */
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo a {
    color: white;
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.main-nav li {
    margin-left: 25px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: #A7C7E7; /* Pale Blue */
    text-decoration: none;
}



/* Hamburger button */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 4px 0;
    transition: 0.3s;
}

/* Rotate bars when active (X button) */
.menu-toggle.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Default nav links */
.nav-links {
    display: flex;
}

.upheader{
     display:none !important;
}
.downheader{
     display:block;
}

/* Mobile styles */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #6A0DAD; /* same as header */
    }
    .nav-links.active {
        display: flex; 
    }
    .nav-links ul {
        flex-direction: column;
        width: 100%;
    }
    .nav-links ul li {
        text-align: center;
        margin: 10px 0; 
    }
	
    .main-nav li {
       margin-left: 0px;
    }
    
    .downheader, .logo {
	display: none  !important;
	
    }
    .upheader{
	display: inline-flex  !important;
    }


}

.user-info {
    font-size: 14px;
    color: #F5F5F5;
    margin-left: 25px;
    white-space: nowrap; /* Prevent wrapping */
}

.user-info a {
    color: #98FF98; /* Mint Green */
    text-decoration: none;
}

.user-info a:hover {
    text-decoration: underline;
}

/* Main Content Area */
.content-area {
    flex: 1;
    padding: 20px;
}

/* Footer Styles */
.main-footer {
    background-color: #B399D4; /* Soft Mauve */
    color: white;
    text-align: center;
    padding: 15px 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background-color: #A7C7E7; /* Pale Blue */
    color: white;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.hero h1 {
    color: white;
    font-size: 3em;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 5px;
    font-size: 1em;
    text-decoration: none;
    transition: background-color 0.3s ease;
    margin-right: 5px; /* Spacing between buttons */
}

.btn-primary {
    background-color: #6A0DAD; /* Deep Purple */
    color: white;
    border: 1px solid #6A0DAD;
}

.btn-primary:hover {
    background-color: #55099b;
    border-color: #55099b;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #6A0DAD;
    border: 1px solid #6A0DAD;
}

.btn-secondary:hover {
    background-color: #eaeaea;
    color: #55099b;
}

.btn-action { /* For actions like edit/view */
    background-color: #98FF98; /* Mint Green */
    color: #333;
    border: 1px solid #98FF98;
}

.btn-action:hover {
    background-color: #7ce07c;
}

.btn-danger {
    background-color: #8B0000; /* Burgundy */
    color: white;
    border: 1px solid #8B0000;
}

.btn-danger:hover {
    background-color: #6e0000;
}


/* Item Grid (Placeholder) */
.latest-items {
    padding: 20px 0;
    text-align: center;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
    justify-content: center;
}

.item-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 15px;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.item-card img {
    max-width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}

.item-card h3 {
    font-size: 1.2em;
    margin: 10px 0;
    color: #6A0DAD;
}

.item-card p {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto; /* For responsive tables */
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table thead th {
    background-color: #B399D4; /* Soft Mauve */
    color: white;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #6A0DAD;
}

table tbody td {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

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

table tbody tr:hover {
    background-color: #f1f1f1;
}

.profile-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ddd;
}

.table-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
    background-color: #e6e6fa; /* Light purple tint */
    padding: 15px;
    border-radius: 8px;
}

.table-filters form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}

.table-filters label {
    margin-right: 5px;
    font-weight: normal;
    color: #444;
}

.table-filters select,
.table-filters input[type="text"] {
    width: auto;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.table-filters button {
    padding: 8px 15px;
    font-size: 14px;
}

.export-buttons {
    display: flex;
    gap: 10px;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(37, 36, 83, 0.41); /* rgba(0,0,0,0.6) Black w/ opacity */
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 5% from the top and centered */
    padding: 25px;
    border: 1px solid #888;
    width: 80%; /* Could be more responsive */
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    position: relative;
}

.modal-content h3 {
    margin-top: 0;
    text-align: left;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.modal-item-details {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.item-pictures-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.item-pictures-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Specific styling for the add item form for current pictures */
.current-pictures {
    margin-top: 15px;
    padding: 10px;
    background-color: #f0f8ff; /* Light blue background */
    border: 1px solid #a7c7e7; /* Pale Blue border */
    border-radius: 5px;
}

.current-pictures p {
    font-weight: bold;
    margin-bottom: 10px;
    color: #6A0DAD; /* Deep Purple */
}

.current-pictures img {
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* New styles for status tags */
.status-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    color: white;
    text-transform: capitalize;
    margin-left: 5px;
}

.status-submitted, .status-pending {
    background-color: #A7C7E7; /* Pale Blue */
}

.status-validated, .status-approved, .status-fulfilled {
    background-color: #98FF98; /* Mint Green */
}

.status-rejected, .status-cancelled {
    background-color: #8B0000; /* Burgundy */
}

.status-ordered {
    background-color: #FFD700; /* Gold */
    color: #333;
}

.status-returned {
    background-color: #FFA07A; /* Light Salmon */
}

/* Item Index Specifics */
.item-select-for-order {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.item-select-for-order input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.order-action-area {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Order Item Cards (for place.php) */
.order-items-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.order-item-card {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background-color: #fcfcfc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.order-item-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 15px;
}

.order-item-card h4 {
    margin: 0 0 5px 0;
    color: #6A0DAD;
    font-size: 1.1em;
}

.order-item-card p {
    margin: 0;
    font-size: 0.9em;
    color: #555;
}

/* Item Details Page (items/view.php) */
.item-details-page .item-info-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default to single column */
    gap: 30px;
    margin-top: 20px;
}

@media (min-width: 768px) {
    .item-details-page .item-info-grid {
        grid-template-columns: 1fr 2fr; /* Two columns on larger screens */
    }
}

.item-details-page .item-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: flex-start; /* Align images to top */
}

.item-details-page .item-images img {
    max-width: 100%; /* For responsiveness */
    height: auto;
    max-height: 300px;
    object-fit: contain; /* Show full image */
    border: 1px solid #eee;
    border-radius: 5px;
}

.item-details-page .item-details p {
    margin-bottom: 8px;
}

.item-details-page .item-details strong {
    color: #444;
}

.item-details-page .manager-comment {
    background-color: #f0f0f0;
    padding: 10px;
    border-left: 5px solid #6A0DAD;
    border-radius: 5px;
    margin-top: 15px;
    font-style: italic;
    color: #555;
}

.item-unavailable-message {
    padding: 10px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin-top: 15px;
    text-align: center;
    font-weight: bold;
}

/* Order View Page (orders/view_order.php) */
.order-details-page .order-summary {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #eee;
}

.order-details-page .order-summary p {
    margin-bottom: 5px;
}

.order-item-list-detailed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-item-detail-card {
    display: flex;
    align-items: flex-start; /* Align image and text at the top */
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background-color: #fcfcfc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.order-item-detail-card img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 20px;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.order-item-detail-card .item-info h4 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #6A0DAD;
    font-size: 1.3em;
}

.order-item-detail-card .item-info p {
    margin-bottom: 5px;
    font-size: 0.95em;
    color: #555;
}

.btn-back {
    margin-bottom: 20px;
    display: inline-block;
}

.mt-20 {
    margin-top: 20px !important;
}

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

/* Small button for item cards */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.9em;
}

/* ... (previous CSS) ... */

/* Report Cards for Index */
.report-list-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.report-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    padding: 25px;
    text-align: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.report-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.report-card h3 {
    color: #6A0DAD; /* Purple */
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.report-card p {
    color: #555;
    font-size: 1em;
    line-height: 1.5;
    margin-bottom: 20px;
}

.report-card .btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1em;
    text-decoration: none;
    background-color: #6A0DAD;
    color: white;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.report-card .btn:hover {
    background-color: #500099; /* Darker Purple */
}

/* Specific report pages */
.table-filters {
    background-color: #f8f8f8;
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.table-filters label {
    font-weight: bold;
    color: #333;
    margin-right: 5px;
}

.table-filters select,
.table-filters input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.9em;
    flex: 1; /* Allow inputs to grow */
    min-width: 150px; /* Minimum width for inputs */
}

.table-filters button[type="submit"] {
    padding: 8px 15px;
    background-color: #6A0DAD;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.table-filters button[type="submit"]:hover {
    background-color: #500099;
}

.table-filters .export-buttons {
    margin-left: auto; /* Push export buttons to the right */
    display: flex;
    gap: 10px;
}

/* Report sections (for items by sector) */
.report-section-cards {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px;
}

.report-section-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 20px;
}

.report-section-card h3 {
    color: #6A0DAD;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.report-section-card .description {
    font-style: italic;
    color: #777;
    margin-bottom: 15px;
}

/* Re-use table-responsive from previous CSS */

/* Adjustments for general button styling if needed */
.btn-action {
    background-color: #4CAF50; /* Green for action buttons like edit */
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-action:hover {
    background-color: #45a049;
}

.btn-danger {
    background-color: #f44336; /* Red for delete buttons */
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-danger:hover {
    background-color: #da190b;
}

.btn-secondary {
    background-color: #6c757d; /* Gray for secondary actions */
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; /* Include padding in width */
    font-size: 1em;
}

.form-control:focus {
    border-color: #6A0DAD;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(106, 13, 173, 0.25);
}

.is-invalid {
    border-color: #dc3545 !important;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.85em;
    margin-top: 5px;
    display: block;
}

input[type="submit"] {
    background-color: #6A0DAD;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

input[type="submit"]:hover {
    background-color: #500099;
}

/* ici modal */

/* --- Thumbnail Gallery Display on Main Page --- */
.item-thumbnail-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.gallery-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer; /* Changed to 'pointer' (finger) */
    transition: transform 0.2s ease-in-out, border-color 0.2s ease-in-out;
    border-radius: 5px;
}

.gallery-thumbnail:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: #007bff;
}

.gallery-thumbnail.no-click {
    cursor: default;
    opacity: 0.7;
}


/* --- Modal (Lightbox) Styles --- */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(37, 36, 83, 0.41); /* rgba(0,0,0,0.9) Changed to black background with opacity */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

/* Modal Content/Box - Max size 800x600px, responsive */
.modal-content {
  background-color: #fefefe;
  padding: 20px;
  border: 1px solid #888;
  border-radius: 8px;
  max-width: 800px; /* Maximum width */
  max-height: 600px; /* Maximum height */
  width: 90%; /* Responsive width */
  height: 90%; /* Responsive height */
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

/* Close Button */
.close-button {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  position: absolute;
  top: 10px;
  right: 20px;
  z-index: 2001;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus {
  color: #333;
  text-decoration: none;
}

/* Slideshow Container within Modal */
.slideshow-container-modal {
  width: 100%;
  height: calc(100% - 40px); /* Adjust height to account for dot indicators and top/bottom padding */
  position: relative;
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  margin-top: 10px;
  margin-bottom: 10px;
}

.mySlides {
  display: none;
  text-align: center;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- CRITICAL CHANGE: Picture inside modal scaling and centering --- */
.mySlides .modal-image-clickable {
  max-width: 100%; /* Important: Constrain image to 100% of its parent's width */
  max-height: 100%; /* Important: Constrain image to 100% of its parent's height */
  object-fit: contain; /* Scales the image down to fit, maintaining aspect ratio, without cropping */
  display: block; /* Ensures proper centering */
  margin: auto; /* Centers the image if it's smaller than the container */
  cursor: pointer;
}

/* Next & previous buttons for slideshow (inside modal) */
.slideshow-container-modal .prev,
.slideshow-container-modal .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  color: white;
  font-weight: bold;
  font-size: 20px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  background-color: rgba(0,0,0,0.5);
  text-decoration: none;
  transform: translateY(-50%);
  z-index: 2002;
}

.slideshow-container-modal .prev {
    left: 0; /* Ensures the left arrow is at the far left */
    border-radius: 0 3px 3px 0; /* Corrected: Rounded corners on the right side for 'prev' */
}

.slideshow-container-modal .next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.slideshow-container-modal .prev:hover,
.slideshow-container-modal .next:hover {
  background-color: rgba(0,0,0,0.8);
}

/* The dots/bullets/indicators for slideshow (inside modal) */
.dot-navigation-container { /* Style the container for dots */
    text-align: center;
    padding: 5px 0;
}

.slideshow-container-modal .dot {
  cursor: pointer;
  height: 12px;
  width: 12px;
  margin: 0 4px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.6s ease;
}

.slideshow-container-modal .active,
.slideshow-container-modal .dot:hover {
  background-color: #717171;
}

/* Fading animation */
.fade {
  animation-name: fade;
  animation-duration: 1.5s;
}

@keyframes fade {
  from {opacity: .4}
  to {opacity: 1}
}

/* --- Responsive adjustments (from previous step, ensure present) --- */
@media screen and (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        max-height: 95%;
        width: 95%;
        height: 95%;
        padding: 15px;
    }
    .modal-content .close-button {
        font-size: 24px;
        top: 8px;
        right: 15px;
    }
    .slideshow-container-modal {
        height: calc(100% - 30px);
    }
    .slideshow-container-modal .prev,
    .slideshow-container-modal .next {
        padding: 10px;
        font-size: 16px;
    }
    .slideshow-container-modal .dot {
        height: 10px;
        width: 10px;
        margin: 0 3px;
    }
}

@media screen and (max-width: 480px) {
    .modal-content {
        padding: 10px;
    }
    .slideshow-container-modal .prev,
    .slideshow-container-modal .next {
        font-size: 14px;
        padding: 8px;
    }
    .gallery-thumbnail {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 768px) {
    .item-card {
        flex: 0 1 calc(100% - 20px); /* 1 column on small screens */
        max-width: calc(100% - 20px);
    }
}

/* Ensure images fit within their containers */
.item-card img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Style for items already in the cart on the main listing page */
.item-card.in-cart {
    background-color: #f2f2f2; /* Light grey background */
    border: 1px solid #ddd;   /* Slightly darker border for distinction */
    opacity: 0.9;             /* Slightly reduce opacity to show it's "disabled" */
}

.item-card.in-cart .item-select-for-order input[type="checkbox"] {
    cursor: not-allowed; /* Indicate that the checkbox is not interactable */
}

/* --- Header Navigation Enhancements --- */

/* Align main nav and user widgets */
.dropdown-content {
    display: none; /* <--- THIS IS CRUCIAL */
    position: absolute;
    background-color: #a978c1;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 5px;
    top: 100%;
    left: 0;
    padding: 10px 10px;
}

/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
    display: block; /* <--- THIS IS CRUCIAL */
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex; /* Make top-level menu items flex */
}

.main-nav ul li {
    position: relative; /* Needed for dropdown positioning */
    margin-right: 20px;
}

.main-nav ul li a {
    text-decoration: none;
    color: #fff;
    padding: 10px;
    display: block;
    white-space: nowrap; /* Prevent menu items from wrapping */
}

.main-nav ul li a:hover,
.dropbtn:hover {
    color: #007bff; /* Highlight on hover */
}

/* Dropdown Button (parent link) */
.dropbtn {
    cursor: pointer;
}

/* Dropdown Content (hidden by default) */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #b399d4;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000; /* Ensure it appears above other content */
    border-radius: 5px;
    top: 100%; /* Position below the parent li */
    left: 0;
    padding: 10px 0;
    margin:-10px 0 0 0;
}

.dropdown-content a {
    color: black;
    padding: 8px 15px;
    text-decoration: none;
    display: block;
    text-align: left;
    white-space: nowrap; /* Prevent wrapping of sub-menu items */
}

.dropdown-content a:hover {
    background-color: #ddd;
    color: #007bff;
}

/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* --- Cart Icon and User Widgets --- */
.user-widgets {
    display: flex;
    align-items: center;
    gap: 15px; /* Spacing between elements */
}

.welcome-text,
.separator {
    color: #F5F5F5;
    white-space: nowrap; /* Prevent breaking across lines */
}

.profile-link,
.logout-link,
.auth-link {
    text-decoration: none;
    color: #F5F5F5;
    white-space: nowrap;
}

.profile-link:hover,
.logout-link:hover,
.auth-link:hover {
    color:#007bff;
    text-decoration: none;
}

.cart-count {
	position:relative;
       left:-25px;
       top:-15px;
       font-size:15px;
       text-align:center;
	font-weight:600;
       color:#f44336;
}

.cart-counts {
	position:relative;
       left:-25px;
       top:-15px;
       font-size:15px;
       text-align:center;
	font-weight:600;
       color:#f44336;
}


/* Adjust main-nav for smaller screens if needed */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }
    .main-nav ul {
        flex-direction: column;
        width: 100%;
    }
    .main-nav ul li {
        margin-right: 0;
        width: 100%;
        text-align: center;
    }
    .main-nav ul li a {
        padding: 10px;
    }
    .dropdown-content {
        position: static; /* Make dropdown content flow with document */
        width: 100%;
        box-shadow: none;
        border-top: 1px solid #eee;
        border-bottom: 1px solid #eee;
    }
    .user-widgets {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
}