/* General Styles */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content {
    flex: 1;
    margin-bottom: 60px; /* Adjust this value to match the height of the footer */
}

/* Headline Styles */
.headline-responsive {
  font-size: 2rem; /* Default size for small devices */
  font-weight: 400;
}

@media (min-width: 576px) {
  .headline-responsive {
    font-size: 3rem; /* Medium devices */
    font-weight: 400;
  }
}

@media (min-width: 768px) {
  .headline-responsive {
    font-size: 4rem; /* Large devices */
    font-weight: 400;
  }
}

@media (min-width: 992px) {
  .headline-responsive {
    font-size: 4.5rem; /* Extra large devices */
    font-weight: 200;
  }
}

@media (min-width: 1200px) {
  .headline-responsive {
    font-size: 5rem; /* Extra extra large devices */
    font-weight: 200;
  }
}

/* Navbar Styles */
.navbar {
    position: fixed;
	font-weight: bold;
    top: 0;
    width: 100%;
    z-index: 1000; /* Ensure it is above other elements */
    background-color: #f8f9fa; /* Ensure a background color is set */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Optional shadow for better visibility */
}

.navbar-brand {
    margin-right: 20px; /* Add margin to separate from nav items */
    padding: 10px; /* Optional: Add padding */
    /* border-right: 1px solid #ccc;  Or use a background color */
    background: #f8f9fa !important;
}

.navbar-user {
    display: inline-block;
    padding-top: .3125rem;
    padding-bottom: .3125rem;
    margin-right: 1rem;
    font-size: 1.25rem;
    line-height: inherit;
    white-space: nowrap;
    font-size: 1.0rem;
    margin-right: 20px;
    color: rgba(0,0,0,.9);
    margin-right: 20px; /* Add margin to separate from nav items */
    padding: 10px; /* Optional: Add padding */
    background: #f8f9fa !important;
}

.navbar-nav {
    flex-grow: 1;
    display: flex;
    align-items: center;
    /* padding-left: 20px;  Add padding to separate from brand */
}

li.nav-item {
    list-style: none; /* Removes bullets or numbers */
    padding: 0;
    margin: 0;
}

.modal-xxl {
    max-height: 80vh;
    overflow-y: auto;
}

.toast-container {
    position: fixed;
    top: 1rem; /* Adjust as needed */
    left: 50%;
	width: 320px;
    transform: translateX(-50%);
    z-index: 1050;
    padding: 1rem;
	top: 80px;
}

.toast-body {
    font-size: 13px; /* Smaller body text for mobile readability */
    padding: 0.75rem 1rem;
    background-color: #fff; /* Ensure the body remains white */
	color: #000;
}

.custom-toast {
    position: fixed;
    top: 5rem;
    left: 50%;
	min-width: 320px;
    transform: translate(-50%, -50%);
    z-index: 1060;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.custom-toast.show {
    opacity: 1;
}

/* Container Responsive */
.container {
    margin-top: 80px; /* Adjust this value based on your navbar's height */
    margin-bottom: 120px; /* Adjust this value based on your navbar's height */
}

@media (min-width: 576px) {
  .container {
    margin-top: 80px; /* Adjust this value based on your navbar's height */
    margin-bottom: 120px; /* Adjust this value based on your navbar's height */
  }
}

@media (min-width: 768px) {
  .container {
    margin-top: 80px; /* Adjust this value based on your navbar's height */
    margin-bottom: 80px; /* Adjust this value based on your navbar's height */
  }
}

@media (min-width: 992px) {
  .container {
    margin-top: 80px; /* Adjust this value based on your navbar's height */
    margin-bottom: 80px; /* Adjust this value based on your navbar's height */
  }
}

@media (min-width: 1200px) {
  .container {
    margin-top: 80px; /* Adjust this value based on your navbar's height */
    margin-bottom: 80px; /* Adjust this value based on your navbar's height */
  }
}

/* Footer Styles */
.fixed-footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    background-color: #f8f9fa;
    text-align: center;
    padding: 10px 0;
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000; /* Ensure the footer is above other content */
}

/* Scanner Styles */
.scanner-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ensure the container maintains its position and hides overflow */
#scanner-container {
    position: relative;
    width: 100%;           /* Full width of the parent container */
    height: 100%;          /* Full height of the parent container */
    max-width: 100vw;      /* Restrict width to the viewport width */
    max-height: 100vh;     /* Restrict height to the viewport height */
    overflow: hidden;      /* Crop overflow outside the container */
    display: flex;         /* Enable centering */
    justify-content: center;
    align-items: center;
    background-color: black; /* Optional: Add a background for contrast */
}

/* Crop the video feed to the desired scanning area */
#scanner-container video {
    width: auto;          /* Maintain video aspect ratio */
    height: auto;         /* Maintain video aspect ratio */
    max-width: none;      /* Prevent resizing to fit the parent */
    max-height: none;     /* Prevent resizing to fit the parent */
    position: absolute;   /* Allow precise positioning */
    top: 50%;             /* Center vertically */
    left: 50%;            /* Center horizontally */
    transform: translate(-50%, -50%) scale(1.5); /* Adjust scaling for better visibility */
}

video {
    width: 90vw;
}

.overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 30%;
    border: 2px solid red;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* Table Styles */
.table-container {
    max-height: 400px;
    overflow-y: scroll;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f9f9f9;
}

.table-striped tbody tr:nth-of-type(even) {
    background-color: #ffffff;
}

.table-responsive {
    margin-top: 1rem;
}

/* Responsive Table Styles */
@media (max-width: 576px) {
    .table-responsive {
        overflow-x: auto;
    }

    /* Adjust font size for better visibility on small screens */
    .table th, .table td {
        font-size: 0.8rem; /* Slightly smaller text */
        white-space: normal !important; /* Allow text to wrap */
        word-wrap: break-word; /* Break long words */
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
    }
}

/* Manual Entry Form */
.manual-entry-form {
    margin: 20px 0;
}

/* Button Styles */
.button-container {
    margin-top: 20px;
}

.btn-full-width {
    width: 100%;
}

@media (max-width: 576px) {
    .btn-full-width {
        width: 100%;
    }
}

/* Admin Login Page Styles */
.login-container {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    padding-top: 50px;
    margin-top: 80px;
    margin-bottom: 80px;
}

/* Admin Manage Bazaar Page Styles */
.form-row {
    margin-bottom: 1rem;
}

.expander {
    margin-bottom: 1rem;
}

.expander-header {
    cursor: pointer;
    background-color: #f8f9fa;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

.expander-content {
    display: none;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
}

.expander-content:not(.card-body) {
    padding: 0.5rem;
}

/* Admin Manage Users Page Styles */
.form-check-label {
    margin-bottom: 0.5rem;
}

/* System Settings Page Styles */
.settings-group {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.true {
    color: green;
}

.false {
    color: red;
}

/* New Styles from admin_manage_sellers.php */

/* Fee Paid Row */
.fee-paid {
    background-color: #d4edda; /* Light green background for paid fees */
}

/* Action Cell */
.action-cell {
    text-align: center;
    padding-top: 5px;
}

/* Action Dropdown */
.action-dropdown {
    margin-bottom: 5px;
}

/* Done Status */
.done {
    background-color: #d4edda;
}

/* Responsive Design Adjustments */
@media (max-width: 576px) {
    .navbar-nav {
        text-align: center;
    }
    .navbar-brand {
        font-size: 1.2rem;
    }
    .table th, .table td {
        font-size: 0.9rem;
    }
    .form-inline input, .form-inline button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* CSS for the outer table */
.outer-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}
.outer-table td {
	border: 2px solid black; /* Visible borders for the outer table */
	vertical-align: middle;
	padding: 0px; /* Reduce padding for compact layout */
	/* width: 33%; Each column occupies 1/3 of the width */
}

/* CSS for the inner table (price tag) */
.price {
	font-size: 20px;
	line-height: 0rem;
}

.product-number {
	text-align: center;
}

td p {
	margin: 0;
	text-wrap: auto;
	text-align: left;
	width: 128%;
	margin-left: 5px;
}
.barcode-table {
	width: 100%;
	table-layout: fixed;
}
.barcode-table td {
	border: none; /* Hide inner table borders */
	padding: 5px; /* Reduce padding to shrink the height */
}


/* QR Code styling for consistent alignment */
.barcode-table .qrcode {
	display: block;
	margin: 0 auto;
}

.seller-nr {
	font-size: 22px;
	font-weight: bold;
}
	
/* Print Styles */
@media print {	
	.cover-page-hint {
		display: block !important;
		font-size: 25px;
	}
	
	
    /* Cover Page: Manually Rotate the Seller Number */
    /* Cover Page: Rotate & Center Seller Number */
    .cover-page {
        width: 21cm; /* A4 width */
        height: 29.7cm; /* A4 height */
        position: absolute;
		display: block !important;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-90deg); /* Center & Rotate */
        font-size: 400px; /* Large text */
        font-weight: bold;
        text-align: center;
        white-space: nowrap; /* Prevents wrapping */
        page-break-after: always !important; /* Ensures price tags start on a new page */
    }
	
	/* Ensure other pages remain in portrait mode */
    @page {
        size: A4 portrait;
    }
	
    .barcode-table td {
		border: none; /* Hide inner table borders */
		padding: 5px; /* Reduce padding to shrink the height */
    }
    
    /* CSS for the inner table (price tag) */
    td {
      padding: 20px; /* Increase padding for print */
    }
    
    td p {
		margin: 0;
		white-space: normal; /* Ensure text wraps */
		word-wrap: break-word; /* Allow word wrapping */
		overflow-wrap: break-word; /* Ensure content wraps properly */
		text-align: left;
		width: 128%;
		margin-left: 5px;
		padding: 4px 0; /* Add vertical padding */
    }
	
    /* Ensure QR code column has enough space */
    td.qr-code {
      width: 150px; /* Adjust as needed for QR code size */
    }
    
    .no-print {
        display: none !important; /* Buttons are always hidden during print */
    }
    .no-print-commission .provision {
        display: none !important; /* "Provision" elements are hidden during print when no-print-commission is applied */
    }
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    display: none; /* Start hidden */
    justify-content: center;
    align-items: center;
    font-size: 24px;
    z-index: 2000;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 0; /* Ensure no padding interferes with centering */
    text-align: center;
    display: flex; /* Ensure flexbox properties are applied */
}

/* Center the icon */
#back-to-top i {
    margin: 0; /* Remove any default margin */
    line-height: 1; /* Reset line-height for the icon */
}

/* New Styles from system_log.php */
.filter-sort-group {
    margin-bottom: 20px;
}

.group-header {
    cursor: pointer;
    background-color: #f8f9fa;
    font-weight: bold;
}

.hidden {
    display: none;
}

table {
    width: 100%;
    table-layout: auto;
}

th, td {
    white-space: nowrap;
}

td.username {
    max-width: 150px; /* Adjust this value as needed */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* New Style from index.php */
.required:after {
    content: "*";
    color: red;
    margin-left: 5px;
}


/* New Styles from seller_products.php */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.action-buttons .btn {
    margin-bottom: 10px;
}

/* New Styles from pickup.php */
.signature-pad {
    border: 1px solid #000;
    width: 100%;
    height: 200px;
}

/* Dashboard tile grid (admin_dashboard.php, index.php offline mode) */
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
}
.dashboard-table td {
    border: 1px solid #ddd;
    width: 120px;
    height: 120px;
    padding: 0;
}
.dashboard-table .btn {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-align: center;
}

/* Centred message/redirect page (seller_edit.php, set_password.php) */
.message-container {
    max-width: 600px;
    margin: 50px auto;
    text-align: center;
}

/* Password set form wrapper (set_password.php) */
.form-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 15px;
    border-radius: 5px;
    background-color: #f7f7f7;
}

/* Seller-ID management table row states (manage_seller_ids.php) */
.verified {
    background-color: #d4edda;
}
.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Print: verified sellers list (print_verified_sellers.php) */
.print-sellers table.table {
    font-size: 0.95rem;
}
