/** NAVBAR **/
.navbar-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.navbar-nav .nav-link {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: #333;
}

.navbar-nav .nav-link:hover {
  color: #0056b3;
}

.navbar-nav .nav-link i.fa-solid,
.navbar-nav .nav-link i.fa-regular {
  font-size: 1.2rem;
  margin-right: 0.3rem;
}



/* TOGGLE DARK MODE */
[data-bs-theme="dark"] .bg-body {
    background-color: #2c2f33 !important;
    color: #eee !important;
}

/* Assure aussi que tous les éléments texte à l'intérieur soient visibles */
[data-bs-theme="dark"] .bg-body .nav-link,
[data-bs-theme="dark"] .bg-body .navbar-brand,
[data-bs-theme="dark"] .bg-body #right_action .btn {
    color: #eee !important;
}

/* Hover */
[data-bs-theme="dark"] .bg-body .nav-link:hover,
[data-bs-theme="dark"] .bg-body .nav-link:focus {
    color: #f0ad4e !important;
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: #9ec9ff;
    border-color: #9ec9ff;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    background-color: #9ec9ff;
    color: #000;
}

[data-bs-theme="dark"] .btn-outline-danger {
    color: #f88;
    border-color: #f88;
}

[data-bs-theme="dark"] .btn-outline-danger:hover {
    background-color: #f88;
    color: #000;
}
.checkbox {
	opacity: 0;
	position: absolute;
}

.checkbox-label {
	background-color: #111;
	width: 50px;
	height: 26px;
	border-radius: 50px;
	position: relative;
	padding: 5px;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.fa-moon {
	color: #f1c40f;
}

.fa-sun {
	color: #f39c12;
}

.checkbox-label .ball {
	background-color: #fff;
	width: 22px;
	height: 22px;
	position: absolute;
	left: 2px;
	top: 2px;
	border-radius: 50%;
	transition: transform 0.2s linear;
}

.checkbox:checked + .checkbox-label .ball {
	transform: translateX(24px);
}

/* INVOICE PREVIEW ZOOM IN */

#image-preview {
	cursor: zoom-in;
	transition: border 0.3s, box-shadow 0.3s;
  }
  
  #image-preview:hover {
	border: 2px solid #007bff;
	box-shadow: 0 4px 6px rgba(0, 123, 255, 0.3);
  }

#image-modal {
	display: none;
	position: fixed;
	z-index: 1050;
	top: 0;
	left: 0;
	width: 90vw;
  	height: 90vh;
	background-color: rgba(0, 0, 0, 0.9);
	justify-content: center;
	align-items: center;
}

/* utile?*/
#image-modal img {
	width: 90vw;
  	height: 90vh;
	object-fit: contain; /* garde les proportions, pas d’étirement */
	background-color: black; /* si l’image ne remplit pas tout, on voit un fond noir */
}
/* quand image dans modal zoom, on affiche la facture à 100% de la taille de l'écran peu importe la taille de la photo, ça risque d'être moins net mais au moins sera grand assez */
#zoomed-invoice-image {
	width: 90vw;
  	height: 90vh;
	object-fit: contain; /* garde les proportions, pas d’étirement */
	background-color: black; /* si l’image ne remplit pas tout, on voit un fond noir */
}

#image-modal:target {
	display: flex;
}

.progress {
	border-radius: 0.375rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.project-grid {
	display: grid;
	grid-template-columns: 1fr 120px auto;
	align-items: center;
	gap: 0.5rem;
}

.percentage-wrapper .form-control {
	min-width: 80px;
}

.input-group {
	flex-wrap: nowrap;
}

@media (max-width: 576px) {
	.project-grid {
	grid-template-columns: 1fr;
	}
	.project-grid .btn-danger {
	justify-self: end;
	}
}

.percentage-wrapper {
	width: 100%;
}

/* Animation and styles for cards */

#cost-center-list .card {
	box-shadow: 0 2px 6px rgba(0,0,0,0.1);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	cursor: default;
}

#cost-center-list .card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Badge colors for statuses */
.badge-unprocessed { background-color: #6c757d; } /* grey */
.badge-inprogress { background-color: #0d6efd; }   /* blue */
.badge-processed { background-color: #198754; }    /* green */
.badge-discarded { background-color: #dc3545; }    /* red */

/* Button consistent styles */
.btn-take-charge { background-color: #198754; color: white; }
.btn-take-charge:hover { background-color: #145c32; }
.btn-discard { background-color: #6c757d; color: white; }
.btn-discard:hover { background-color: #494f54; }
.btn-open { background-color: #0d6efd; color: white; }
.btn-open:hover { background-color: #084298; }
.btn-other-action { background-color: #ffc107; color: black; }
.btn-other-action:hover { background-color: #d39e00; }

/* INVOICES_TO_PROCESS */

#current-invoice-card {
	background-color: #eaf3fc;
	border-left: 5px solid #0d6efd;
	padding: 1rem;
	border-radius: 5px;
	transition: background-color 0.3s ease;
  }
  
/* Dark mode : darker background */
html[data-bs-theme="dark"] #current-invoice-card,
html[data-bs-theme="dark"] .bg-white {
	background-color: #1f2937 !important;
	color: #fff !important;
}

#camera-btn {
	display: none;
  }
 
/* bigger buttons on smartphone */
@media (max-width: 576px) {
	button,select.form-select,input.form-control, button.btn-primary, #toggle-form {
	  height: auto !important;
	  line-height: normal !important;
	  font-size: 1.1rem !important;
	  padding: 12px 15px !important; /* vertical 12px, horizontal 15px */
	  border-radius: 0.4rem !important;
	}

	.mb-3 {
	  margin-bottom: 1.25rem !important;
	}

	#camera-btn {
        display: block;
      }
  }
  #fullscreen-overlay {
	display: none;
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background-color: rgba(0,0,0,0.85);
	justify-content: center;
	align-items: center;
	z-index: 9999;
  }
  #fullscreen-overlay img {
	max-width: 90%;
	max-height: 90%;
  }

/* zoom.css */
/* magnifying glass */
.img-magnifier-glass {
  position: absolute;
  border: 3px solid #000;
  border-radius: 50%;
  cursor: none;
  width: 120px;
  height: 120px;
  background-color: transparent;
  pointer-events: none;
  z-index: 10;
}

/* Optional: Adding a transition for smoother magnification */
.img-magnifier-glass {
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

/**** E INVOICES ******/
.analytic-editor {
  background: #f8f9fa;
  border: 1px solid #ddd;
}
/*  modal dark mode*/
body.dark-mode .modal-content {
	background-color: #2b2b2b;
	color: #e6e6e6;
}
body.dark-mode .form-select,
body.dark-mode .form-control {
	background-color: #3a3a3a;
	color: #fff;
	border-color: #555;
}
.percentage-valid {
	color: green;
	font-weight: bold;
}
.percentage-invalid {
	color: red;
	font-weight: bold;
}

.violet-btn {
	color: #6f42c1;
	border-color: #6f42c1;
}

.violet-btn:hover {
	background-color: #6f42c1;
	color: #fff;
}

.project-select option strong {
	font-weight: bold;
}

/* PDF */
.fas.fa-file-pdf {
cursor: pointer;
font-size: 20px;
}

.fas.fa-file-pdf:hover {
	transform: scale(1.15);
}
/* XML */
.fas.fa-file-code {
cursor: pointer;
font-size: 20px;
}

.fas.fa-file-code:hover {
	transform: scale(1.15);
	color: #c78b00;
}
    
/* einvoices icon*/
.blink {
    animation: blink 1.2s infinite;
}

@keyframes blink {
    0%   { opacity: 1; }
    50%  { opacity: 0.4; }
    100% { opacity: 1; }
}

/* =========================
   (e-)Facture ignorée (card)
   ========================= */

.card.invoice-ignored {
    opacity: 0.55;
    filter: grayscale(80%);
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
}

/* Icônes & textes un peu atténués */
.card.invoice-ignored .card-header,
.card.invoice-ignored .card-body,
.card.invoice-ignored .card-footer {
    color: var(--bs-secondary-color);
}

/* Boutons désactivés visuellement mais lisibles */
.card.invoice-ignored .btn {
    pointer-events: none;
    opacity: 0.6;
}

/* Bouton "Désignorer" reste cliquable */
.card.invoice-ignored .unignore-btn {
    pointer-events: auto;
    opacity: 1;
    position: relative;  /* sortir du flow de filtrage */
    z-index: 10;
    background-color: #ffc107;
    border-color: #ffb700;
    color: #000;
    font-weight: 600;
    box-shadow: 0 0 8px #ffb700;
	filter: none;
}

/* Facultatif : hover encore plus visible */
.card.invoice-ignored .unignore-btn:hover {
    background-color: #ffca2c;
    box-shadow: 0 0 8px #ffca2c;
}

/* Dark theme : contraste mieux géré */
[data-bs-theme="dark"] .card.invoice-ignored {
    background-color: rgba(255, 255, 255, 0.03);
    filter: grayscale(60%);
}

/** facture comptabilisée **/
.invoice-finalized {
    background-color: #e6ffe6; /* vert très clair */
    border: 2px solid #28a745; /* vert bootstrap */
    color: #155724; /* texte vert foncé */
    /* Ou une légère ombre, etc. */
}

.invoice-finalized .card-header {
    background-color: #c3e6cb;
    color: #155724;
    font-weight: bold;
}

.invoice-finalized .btn {
    /* Si tu veux rendre les boutons différents */
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

/* gestion 2 fenetres dans la modal, codes analytiques + pdf **/
.analytic-split {
  height: 100%;
}

.analytic-left {
  width: 40%;
  min-width: 420px;
  overflow-y: auto;
  padding: 1rem;

  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

.analytic-right {
  width: 60%;
  background-color: var(--bs-secondary-bg);
}

.analytic-right iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

[data-bs-theme="dark"] .analytic-left table {
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .analytic-left th,
[data-bs-theme="dark"] .analytic-left td {
  border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .analytic-right {
  background-color: #0f172a; /* gris bleu très foncé */
}
#noPdfMessage {
  max-width: 320px;
}

[data-bs-theme="dark"] #noPdfMessage {
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] #noPdfMessage .text-muted {
  color: var(--bs-secondary-color) !important;
}


/* Mobile : empilé */
@media (max-width: 768px) {
  .analytic-split {
    flex-direction: column;
  }

  .analytic-left,
  .analytic-right {
    width: 100%;
    min-width: unset;
    height: 50%;
  }
}

/** bannière facture comptabilisée **/
.accounted-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  background-color: #198754;
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: 999px;

  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;

  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  pointer-events: none;
}

[data-bs-theme="dark"] .accounted-banner {
  background-color: #22c55e;
  color: #052e16;
}

/* badge dark theme (move type) */
[data-bs-theme="dark"] .badge.bg-light {
  background-color: #374151 !important;
  color: #fff !important;
  border-color: #4b5563;
}