/* ==============================
***   Listes à disclosure   ***
*  ============================== */
.disclosure-closed {
  list-style-type: disclosure-closed;
}
.disclosure-open {
  list-style-type: disclosure-open;
}

/* ==============================
***   Variables composants   ***
*  ============================== */

/* Composants spécifiques : logo, floating icon, social-icons, navigation, onglets, groupes, badges, etc. */

/* Logo */
.logo {
  width: var(--logo-width);
  height: auto;
  margin-top: var(--logo-margin-top);
}

/* Footer */
.footer-content {
  display: flex;
  justify-content: center;
  padding: 10px 0;
  background-color: var(--footer-bg);
  color: var(--footer-text-color);
  font-size: 0.9em;
}

/* Floating Icon */
#floatingIcon {
  position: fixed;
  z-index: 1000;
  background-color: var(--floating-icon-bg);
  border-radius: 50%;
  height: 2em;
  width: 2em;
  box-shadow: var(--floating-icon-shadow);
}
#floatingIcon a {
  color: var(--floating-icon-color);
  text-decoration: none;
  transition: color 0.3s;
}
#floatingIcon a:hover {
  color: var(--floating-icon-color-hover);
}
#floatingIconElement {
  position: absolute;
  right: 1px;
  bottom: 1px;
}

/* Social Icons */
.social-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
#footerHome .social-icons a {
  font-size: 1.5rem;
}
#contact .social-icons a {
  margin: 10px 10px 0;
  font-size: 3rem;
}
.social-icons a {
  text-decoration: none;
}
.social-icons a i {
  color: #333;
  transition:
    transform 0.5s,
    color 0.3s;
}
.social-icons a i:hover {
  color: #007bff;
  transform: scale(2);
}

/* Onglets */
.tab-container {
  display: flex;
  justify-content: center;
}
.tab {
  padding: 10px 20px;
  cursor: pointer;
  border: var(--tab-border);
  box-shadow: var(--tab-shadow);
  border-radius: var(--tab-radius);
  margin-right: 5px;
  background-color: var(--tab-bg);
  transition:
    background 0.3s,
    color 0.3s;
}
.tab.active {
  background-color: var(--tab-active-bg);
  font-weight: var(--tab-active-font-weight);
}
.tab-content {
  display: none;
  padding: 15px;
  /* border: var(--tab-border); */
  background-color: var(--tab-active-bg);
  border-radius: var(--tab-radius);
}
.tab-content.active {
  display: block;
}

/* Groupes et badges */
.form-group {
  display: flex;
  justify-content: space-evenly;
  flex-direction: row;
  align-items: center;
  margin-block: 0.5em;
}
.icon-container {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.icon-container a {
  display: flex;
  align-items: center;
}
i span.badge {
  position: absolute;
  top: -0.5em;
  right: -2.5em;
  padding: 5px 10px;
  border-radius: 50%;
  background-color: var(--badge-bg-color);
  color: var(--badge-text-color);
  font-size: xx-small;
}
.badge-period {
  padding: 8px 10px !important;
  cursor: pointer;
}
.badge-state {
  display: inline-block;
  padding: 10px 12px !important;
  width: 10em;
  /* font-size: 12px; */
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  vertical-align: middle;
  white-space: break-spaces;
  border-radius: 10px;
}
a.badge-count {
  margin-right: -10px;
}
a.badge-count > i {
  transform: translate(5px);
}
a.badge-count > span {
  transform: translate(-5px, 10px);
  opacity: 0.85;
}

/* Badges utilitaires */
.badge-success {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 0.375rem;
  background-color: var(--valid-color, #28a745);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1;
}

.badge-warning {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 0.375rem;
  background-color: var(--warning-color, #ffc107);
  color: #212529;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1;
}

.badge-danger {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 0.375rem;
  background-color: var(--danger-color, #dc3545);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1;
}

/* Username */
.username {
  color: #888;
  font-size: 0.6em;
}

/* =============================
***   Utilitaires d’espacement   ***
*  ============================== */
.span-spacing {
  display: block;
  height: 10px;
}

/* ========================================
***   Styles pour les infos du profil   ***
*  ===================================== */
.profile-container {
  margin: 2em auto;
}

.profile-fieldset {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 2rem;
}

.profile-group {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.profile-files {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
}

.profile-label {
  font-weight: bold;
}

.profile-value {
  margin-left: 1em;
}

.title-label {
  font-size: large;
  margin-bottom: 1em;
}

/* ========================================
***   Styles pour les descriptions   *** 
*  ===================================== */
.ticket-description {
  /* padding: 20px; */
  min-width: min(20em, 75%);
  max-width: max(45em, 95%);
  display: flex;
  flex-direction: column;
}

/* Fermeture de ticket */
.close-ticket {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
  font-size: smaller;
}

/* Styles pour les éléments de prévisualisation */
/* Mise à jour des styles pour utiliser uniquement file-name */
.file-item {
  cursor: pointer;
  padding: 5px 5px 0px 10px;
  position: relative;
}
.file-item::before {
  content: "•"; /* Point par défaut */
  position: absolute;
  left: -15px;
  margin-right: 10px;
  color: var(--inactive-bullet-color);
}
.file-item.active::before {
  content: "➤"; /* Flèche pour les éléments actifs */
  color: var(--active-bullet-color);
}
.file-item.active {
  font-weight: bold;
}
.file-item.inactive {
  font-weight: normal;
}
.group-file-list {
  text-align: left;
  list-style-type: disclosure-open;
}
li.file-label {
  margin-bottom: 5px;
  padding-left: 10px;
}

.btn-delete-file {
  background: none;
  border: none;
  color: var(--danger-color, #dc3545);
  cursor: pointer;
  margin-left: 8px;
  padding: 0 4px;
  vertical-align: middle;
  opacity: 0.6;
}
.btn-delete-file:hover {
  opacity: 1;
}

/* File preview card */
.media-wrapper {
  position: relative;
  display: inline-block;
  align-items: center;
  /* width: 100%; */
}

.btn-file-download {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  opacity: 0;
  z-index: 2;
  line-height: 1;
  text-decoration: none;
  transition:
    opacity 0.2s,
    background 0.2s;
  pointer-events: all;
}
.media-wrapper:hover .btn-file-download {
  opacity: 1;
}
.btn-file-download:hover {
  background: rgba(0, 0, 0, 0.65);
}

/* Rotation overlay inside .media-wrapper (show-files modal) */
.media-wrapper .image-rotation-controls {
  opacity: 0;
  transition: opacity 0.2s;
}
.media-wrapper:hover .image-rotation-controls {
  opacity: 1;
}

/* Ajout d'une classe utilitaire pour masquer/afficher les figures supprimées */
.file-figure.removed {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.3s;
}

/* pdf-embed-wrapper / pdf-preview-overlay removed — generateFileHtml uses pdf.js canvas
   (page 1 only) on all devices for card previews. See pdf-viewer-container in _file-viewer.css. */

.file-caption {
  cursor: pointer;
}

.file-button-wrapper {
  display: flex;
  gap: 10px;
}

/* Placeholder affiché quand un fichier HEIC stocké ne peut pas être converti côté client */
.heic-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 90px;
  background: #f0f4f8;
  border-radius: 6px;
  color: #8a9bb0;
  font-size: 0.75rem;
  gap: 6px;
}
.heic-fallback::before {
  content: "📷";
  font-size: 2rem;
}

/* Caption styles for preview (title, label, date) */
.preview-item figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  font-size: 0.95rem;
  color: var(--text-color, #333);
}
.preview-item figure {
  margin: 1em 20px;
}
.preview-caption-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--title-color, #222);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-caption-label {
  font-size: 0.95rem;
  color: var(--muted-color, #666);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-caption-date {
  font-size: 0.8rem;
  color: var(--muted-color, #888);
}

/* File input size info and progress */
.file-size-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.file-size-hint {
  color: #666;
  font-size: 0.7em;
}
.file-size-info {
  font-size: 0.7em;
  color: #444;
}
.file-size-info--ok {
  color: #2d8659; /* green */
}
.file-size-info--warning {
  color: #c0392b; /* red */
}

/* Simple indeterminate progress bar for uploads */
.file-upload-progress {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
  display: none;
  margin-top: 6px;
}
.file-upload-progress.visible {
  display: block;
}
.file-upload-bar {
  width: 30%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.15),
    #007bff 50%,
    rgba(255, 255, 255, 0.15)
  );
  transform: translateX(-100%);
  animation: file-upload-stripe 1s linear infinite;
}
@keyframes file-upload-stripe {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(400%);
  }
}

/* ==============================
***   Boutons de rôle   ***
*  ============================== */
.role-btn {
  margin: 1em;
  min-width: 220px;
  width: 220px;
  height: 110px;
  border-radius: 2em;
  border: none;
  color: #fff;
  font-size: 1.2em;
  font-weight: bold;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.role-btn span {
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 18px;
  border-radius: 1em;
  font-size: 1.1em;
  width: 90%;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
.role-btn:hover,
.role-btn:focus {
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}
.role-btn:hover span,
.role-btn:focus span {
  background: rgb(255 255 255 / 75%);
  color: var(--text-color);
}
.role-btn-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
@media (min-width: 600px) {
  .role-btn-group {
    flex-direction: row;
  }
}
.img-manager {
  background-image: var(--image-manager);
}

.img-owner {
  background-image: var(--image-owner);
}

.img-tenant {
  background-image: var(--image-tenant);
}

.img-artisan {
  background-image: var(--image-artisan);
}

/* ==============================
***   Styles Previous/Next   ***
*/
.preview-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  /* margin: 0 10px; */
}
.preview-counter .current-page,
.preview-counter .total-pages {
  font-weight: bold;
}
.current-page {
  color: var(--current-page-color);
}
.total-pages {
  color: var(--total-pages-color);
}

/* ==============================================
***   Styles Subcontractor Ticket Description   ***
================================================ */
.request-description.box,
.assignment-description.box {
  margin: auto;
  margin-block: 10px;
  display: flex;
  flex-direction: column;
}
.files-list-fieldset {
  border-radius: 8px;
  padding: 10px;
}
section.header-section {
  margin-bottom: 15px;
}
section.desc-section {
  margin: 12px 0;
}
section.comment {
  font-style: italic;
  font-size: small;
  color: var(--comment-text-color);
  min-width: 80%;
  padding: 15px 0;
  border-top: 5px double black;
  border-bottom: 5px double black;
}
section.files {
  font-size: small;
}
section.assigned-subcontractors-section {
  margin-top: 15px;
}
.assigned-subcontractors-list {
  padding-left: 20px;
  font-size: small;
}
.section-title {
  /* font-size: medium; */
  margin: 5px 5px;
  /* text-decoration: underline; */
  font-weight: bold;
}
.section-body {
  font-size: small;
}

/* ==============================
***   Button in display file   ***
*  ============================== */
#reportButtonContainer {
  display: flex;
  align-items: center;
  /* gap: 10px; */
}
#reportButtonContainer .file-chat-link {
  padding: 6px 12px;
  margin: 2px 2px 20px 2px;
}
#actionsContainer {
  display: flex;
  gap: 25px;
  align-items: center;
  justify-content: center;
}
#navigationContainer {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin: 2em 0 0 0;
}

/* ==============================
***   Constatation list styles   ***
*  ============================== */
.constatation-list {
  max-height: 360px;
  overflow: auto;
  text-align: left;
  font-size: small;
}

.constatation-item {
  margin-bottom: 6px;
}

.native-capture-info {
  font-size: 0.6em;
  color: var(--text-color);
  margin: 0.5rem 0 0 0;
}

/* ==============================
***   Styles pour les boutons d’attachement de fichiers   ***
*  ============================== */

.attach-file-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.file-icon-clip {
  font-size: 2em;
  vertical-align: middle;
}

.file-icon-image,
.file-icon-video,
.file-icon-pdf {
  font-size: 1em;
  vertical-align: middle;
}

/** ==============================
***   Styles pour le bouton de réinitialisation de date de rendez-vous   ***
*  ============================== */
.btn-reset-schedule {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--reset-schedule-btn-color);
  font-size: large;
}

/* ==============================
***   Styles pour les addresses dans les tickets   ***
*  ============================== */
.address-link:hover {
  text-decoration: underline;
}

.map-picker-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  padding: 0;
}

.map-picker-address {
  font-size: 0.82rem;
  color: var(--muted-color, #888);
  margin: 0 0 0.75rem;
  padding: 0 0.25rem;
  word-break: break-word;
}

.map-app-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  background: #f2f2f7;
  color: var(--text-color, #1c1c1e);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    background 0.12s ease,
    opacity 0.12s ease;
  margin: 0 !important;
  -webkit-tap-highlight-color: transparent;
}

.map-app-link + .map-app-link {
  margin-top: 0.5rem !important;
}

.map-app-link:hover,
.map-app-link:focus {
  text-decoration: none;
  background: #e8e8ed;
}

.map-app-link:active {
  background: #dddde3;
  opacity: 0.85;
}

.map-app-icon {
  font-size: 1.4rem;
  width: 1.75rem;
  text-align: center;
  flex-shrink: 0;
}

.map-app-name {
  flex: 1;
}

.map-app-chevron {
  font-size: 1.25rem;
  color: var(--muted-color, #aaa);
  font-weight: 300;
  line-height: 1;
}

.address-span {
  margin: 0;
  padding: 0;
}

.address-span span {
  display: block;
}
