@import url('fonts.css');

/* General Styles */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Ubuntu', Arial, Calibri, sans-serif;
    color: #555;
    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;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
}

/* 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;
}

/* Charte AFC */

/* Liens courants */
a {
    color: #337AB7;
}

/* Bandeau supérieur de marque */
.afc-topbar {
    background: #E3005D;
    color: #fff;
    font-size: .85rem;
    text-align: center;
    padding: 6px 12px;
}
.afc-topbar a {
    color: #fff;
    text-decoration: underline;
}

/* Navbar de marque + accents */
.navbar-brand span {
    color: #E3005D;
    font-weight: 500;
}
.nav-link.active,
.navbar-nav .active > .nav-link {
    color: #E3005D;
}

/* Boutons primaires AFC (style pill) */
.btn-primary {
    background: #E3005D;
    border-color: #E3005D;
    border-radius: 22px;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: #b3004a;
    border-color: #b3004a;
}

/* Bouton de connexion (navbar) */
#loginButton,
.navbar a.btn-primary {
    border-radius: 22px;
}

/* Accent par défaut : bouton "Back to top" aux couleurs AFC */
#back-to-top {
    background-color: #E3005D;
}
/* Charte AFC — marque navbar (styles déplacés depuis inline pour CSP) */
.afc-brand-logo { margin-right: 18px; }
.afc-brand-text { font-weight: 500; color: #E3005D; }

/* Accès rapide — espace de démonstration (login) */
.demo-access-group { margin-top: 0.25rem; margin-bottom: 0.5rem; color: #E3005D; font-weight: 600; }
.demo-access-btn { margin-right: 0.5rem; margin-bottom: 0.5rem; }

/* Charte AFC — bandeau fixe au-dessus de la navbar fixe + compensation du contenu.
   Ces valeurs sont un REPLI : js/mise-en-page.js mesure les hauteurs réelles et les
   corrige, car le bandeau passe sur deux ou trois lignes sur un téléphone. */
.afc-topbar { position: fixed; top: 0; left: 0; width: 100%; z-index: 1031; box-sizing: border-box; }
.navbar { top: 30px; }
.container { margin-top: 110px; }

/* Sur un téléphone, le bandeau prenait trois lignes — un cinquième de l'écran avant
   même d'avoir lu quoi que ce soit. On n'y garde que l'essentiel. */
@media (max-width: 767.98px) {
    .afc-topbar { font-size: 0.78rem; padding: 0.25rem 0.5rem; line-height: 1.25; }
    .afc-topbar .afc-baseline { display: none; }

    /* Titres de page : 2 rem sur 390 px, c'est deux lignes pour trois mots. */
    h1, .headline-responsive { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3, .sumPrice { font-size: 1.15rem; }
    h4 { font-size: 1.05rem; }

    /* Un peu d'air en moins : plus de contenu utile par écran. */
    .container { padding-left: 0.75rem; padding-right: 0.75rem; }
    .card-body { padding: 0.75rem; }
    .table td, .table th { padding: 0.4rem; }
}

/* Repli sans JavaScript : sur petit écran, le bandeau occupe deux à trois lignes. */
@media (max-width: 767.98px) {
    .navbar { top: 52px; }
    .container { margin-top: 132px; }
}

@media (max-width: 400px) {
    .navbar { top: 74px; }
    .container { margin-top: 154px; }
}

/* Rien ne doit déborder en largeur : une bande fixe en largeur 100 % À LAQUELLE on
   ajoute du remplissage dépasse l'écran et provoque un défilement horizontal. */
html, body { max-width: 100%; overflow-x: hidden; }
.fixed-footer { box-sizing: border-box; }
.toast-container { max-width: calc(100vw - 2rem); }
.custom-toast { max-width: calc(100vw - 2rem); }

/* ============================================================
   Accessibilité (RGAA / WCAG 2.1 AA) — contrastes & focus
   ============================================================ */

/* Liens de navigation : gris Bootstrap (3.75:1) -> foncé conforme (>= 4.5:1) */
.navbar-light .navbar-nav .nav-link {
    color: #2b2b2b;
}
.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus {
    color: #000;
}
.navbar-light .navbar-nav .nav-link.active,
.navbar-light .navbar-nav .active > .nav-link {
    color: #E3005D;
}

/* Bordures des champs : trop claires (1.49:1) -> >= 3:1 */
.form-control,
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="tel"], input[type="date"],
select.form-control, textarea.form-control {
    border-color: #6c757d;
}

/* Focus champ : bordure + halo rose AFC (visible) */
.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
    border-color: #E3005D;
    box-shadow: 0 0 0 0.2rem rgba(227, 0, 93, 0.30);
}

/* Focus clavier VISIBLE sur tous les éléments interactifs (RGAA 10.7) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #1d5a8a;
    outline-offset: 2px;
}

/* Liens texte : #337AB7 (4.56) -> légèrement foncé pour marge AA */
a {
    color: #1d5a8a;
}

/* Liens du bandeau (sur fond rose) restent blancs soulignés — contraste OK */
.afc-topbar a {
    color: #fff;
}


/* ============================================================
   Page « Mes articles » — trois tuiles repliables
   ============================================================ */

.tuile-entete {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #f1f1f4;
    font-weight: 600;
}

.tuile-entete:hover { background-color: #e7e7ec; }

.tuile-titre { font-size: 1.05rem; }

/* Le chevron pivote quand la tuile est ouverte : on voit d'un coup d'œil ce qui est déplié. */
.tuile-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
    font-size: 1.1rem;
    line-height: 1;
}

.tuile-entete[aria-expanded="true"] .tuile-chevron { transform: rotate(180deg); }

/* Articles retirés de la vente : dans la même tuile que la liste, mais visiblement en retrait. */
.articles-retires { background-color: #f6f6f8; }
.articles-retires .card-header { background-color: transparent; font-weight: 600; color: #555; }
.articles-retires .card-body, .articles-retires table { color: #6c757d; }
