
@tailwind base;
@tailwind components;
@tailwind utilities;

/* =====================================================
   Chalky Layout Theme Customization
   Ces variables doivent être EN DEHORS de @layer components
   ===================================================== */
:root {
  --chalky-surface: #ffffff;
  --chalky-surface-secondary: #fafafa;
  --chalky-surface-tertiary: #f5f4f4;
  --chalky-surface-hover: #f5f4f4;
  --chalky-surface-active: #e9e7e7;
  --chalky-text-primary: #1c1718;
  --chalky-text-secondary: #605254;
  --chalky-text-tertiary: #7a6c6e;
  --chalky-text-muted: #9e9496;
  --chalky-text-inverted: #ffffff;
  --chalky-border: #e7e4e5;
  --chalky-border-light: #f3f2f2;
  --chalky-border-strong: #d3cfd0;
  --chalky-primary: #ff0099;
  --chalky-primary-hover: #f04c67;
  --chalky-primary-light: #fee6ea;
  --chalky-primary-text: #6c1322;
  --chalky-success: #1fad5a;
  --chalky-success-hover: #1b984f;
  --chalky-success-light: #effbf4;
  --chalky-success-text: #136c38;
  --chalky-success-border: #5cd68f;
  --chalky-danger: #df2020;
  --chalky-danger-hover: #bb1b1b;
  --chalky-danger-light: #fdf1f1;
  --chalky-danger-text: #821717;
  --chalky-danger-border: #e46767;
  --chalky-warning: #d4a411;
  --chalky-warning-hover: #b38a0f;
  --chalky-warning-light: #fdf9ed;
  --chalky-warning-text: #7d6212;
  --chalky-warning-border: #e8ba30;
  --chalky-info: #228ec3;
  --chalky-info-hover: #1d78a5;
  --chalky-info-light: #eef7fc;
  --chalky-info-text: #155879;
  --chalky-info-border: #5cadd6;
  --chalky-accent-blue: #3c71dd;
  --chalky-accent-blue-light: #dde6f8;
  --chalky-accent-blue-text: #173b82;
  --chalky-accent-green: #3cdd7f;
  --chalky-accent-green-light: #ddf8e8;
  --chalky-accent-green-text: #178244;
  --chalky-accent-red: #dd3c3c;
  --chalky-accent-red-light: #f8dddd;
  --chalky-accent-red-text: #821717;
  --chalky-accent-yellow: #ddc23c;
  --chalky-accent-yellow-light: #f8f3dd;
  --chalky-accent-yellow-text: #827017;
  --chalky-accent-orange: #dd7f3c;
  --chalky-accent-orange-light: #f8e8dd;
  --chalky-accent-orange-text: #824417;
  --chalky-accent-purple: #a73cdd;
  --chalky-accent-purple-light: #efddf8;
  --chalky-accent-purple-text: #5e1782;
  --chalky-accent-gray: #786d6f;
  --chalky-accent-gray-light: #f3f2f2;
  --chalky-accent-gray-text: #433d3e;
  --chalky-accent-indigo: #3c3cdd;
  --chalky-accent-indigo-light: #ddddf8;
  --chalky-accent-indigo-text: #171782;
  --chalky-tooltip-bg: #2c2122;
  --chalky-tooltip-text: #ffffff;
  --chalky-focus-ring: #f47c90;
}

/* Fix: Le CDN TomSelect utilise background-image:linear-gradient() que la gem n'override pas */
/* TODO: Signaler ce bug à chalky_layout pour qu'ils ajoutent background-image: none */
.ts-wrapper.multi .ts-control > .item,
.ts-wrapper.multi .ts-control > [data-value] {
  background-image: none !important;
}

@layer components {

  .filters_checkbox[type="checkbox"] {
    width: 20px;
    height: 20px;
    background-color: #fff;
    position: relative;
  }

  .filters_checkbox[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background-color: var(--chalky-primary);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease;
  }

  .filters_checkbox[type="checkbox"]:checked::before {
    transform: translate(-50%, -50%) scale(1);
  }


  #bici-table {
    @apply w-full bg-white rounded-b-xl shadow-lg text-content;
  }

  .h-cell {
    @apply py-3 px-3 first:rounded-tl-xl last:rounded-tr-xl overflow-hidden sticky top-0 bg-secondary text-white font-bold !text-left;
  }

  .b-cell  {
    @apply py-3 first:pl-4 last:pr-4 !border-b !border-disable;
  }

  details > summary:not(#terms summary) {
    list-style: none !important;
  }

  details summary::-webkit-details-marker {
    display:none;
  }

  /* Chevron rotation for details/summary */
  details[open] .chevron-icon {
    transform: rotate(180deg);
  }

  body.wait, body.wait * {
    cursor: wait !important;
  }

  .form_with_checkbox {
    @apply relative inline-block text-transparent text-[0px] before:content-[''] before:mt-1 after:mt-1 before:block absolute before:cursor-pointer before:w-14 before:h-8 before:top-0 before:left-0 before:bg-disable before:rounded-full peer-checked:before:bg-secondary after:content-[''] after:block after:absolute after:cursor-pointer after:w-6 after:h-6 after:top-1 after:left-1 after:bg-white after:rounded-full peer-checked:after:ml-1 peer-checked:after:left-6 after:transition-all;
  }

  .btn {
    @apply px-4 py-2 font-normal text-center rounded-md border-2 shadow-md transition-colors cursor-pointer focus:outline-none focus:ring-2 focus:ring-opacity-75;
  }

  .btn-primary {
    @apply  text-white border-white hover:bg-white hover:text-primary hover:border-primary bg-primary focus:ring-secondary;
  }

  .btn-tertiary {
    @apply  text-white border-white hover:bg-white hover:text-tertiary hover:border-tertiary bg-tertiary focus:ring-secondary;
  }

  .btn-cancel {
    @apply text-white underline decoration-tertiary hover:text-secondary;
  }

  .btn-cancel-inverted {
    @apply underline decoration-tertiary text-primary hover:text-secondary;
  }

  .btn-wait {
    @apply   text-white cursor-not-allowed bg-content border-content;
  }

  /* =====================================================
     Boutons 2025 - Design minimaliste
     ===================================================== */

  /* Bouton principal - fond noir, sobre */
  .sf-btn {
    @apply inline-flex justify-center items-center px-5 py-2.5 text-sm font-medium rounded-md transition-all duration-200 ease-out cursor-pointer;
    @apply focus:outline-none focus:ring-2 focus:ring-offset-2;
  }

  .sf-btn-primary {
    @apply border-0 text-chalky-text-inverted bg-chalky-text-primary;
    @apply hover:opacity-90;
    @apply focus:ring-chalky-focus-ring;
  }

  .sf-btn-primary:disabled {
    @apply cursor-not-allowed bg-chalky-text-muted;
  }

  /* Bouton secondaire - contour sobre */
  .sf-btn-secondary {
    @apply bg-transparent border text-chalky-text-primary border-chalky-border;
    @apply hover:bg-chalky-surface-hover hover:border-chalky-border-strong;
    @apply focus:ring-chalky-border;
  }

  .sf-btn-secondary:disabled {
    @apply cursor-not-allowed text-chalky-text-muted border-chalky-border-light;
  }

  /* Bouton ghost - texte seul */
  .sf-btn-ghost {
    @apply bg-transparent border-0 text-chalky-text-secondary;
    @apply hover:text-chalky-text-primary hover:bg-chalky-surface-tertiary;
    @apply focus:ring-chalky-border;
  }

  /* Bouton danger */
  .sf-btn-danger {
    @apply border-0 text-chalky-text-inverted bg-chalky-danger;
    @apply hover:bg-chalky-danger-hover;
    @apply focus:ring-chalky-danger;
  }

  /* Tailles de boutons */
  .sf-btn-sm {
    @apply px-3 py-1.5 text-xs;
  }

  .sf-btn-lg {
    @apply px-6 py-3 text-base;
  }


  #dispatch-table {
    @apply w-full text-gray-600 bg-white rounded-xl shadow-lg;
  }
  #dispatch-table thead {
    @apply bg-secondary text-white font-bold !text-left;
  }
  #dispatch-table thead tr th {
    @apply overflow-hidden sticky top-0 px-3 py-3 first:rounded-tl-xl last:rounded-tr-xl;
  }

  #dispatch-table tbody {
    @apply font-normal bg-white text-content;
  }
  /* #dispatch-table tbody tr {
  } */

  #dispatch-table tbody tr {
    @apply  border-b border-light;
  }

  /* #dispatch-table tbody tr:nth-child(odd) td  {
    @apply px-3 py-3 text-center first:pl-4 last:pr-4;
  } */

  #dispatch-table tbody tr td  {
    @apply px-3 py-3 text-center first:pl-4 last:pr-4;
  }

  /* Styles pour la nouvelle page des archives */
  .delivery-archive-table {
    @apply overflow-hidden w-full rounded-xl shadow-lg bg-chalky-surface;
  }

  .delivery-archive-table thead {
    @apply border-b bg-chalky-surface-tertiary border-chalky-border;
  }

  .delivery-archive-table thead th {
    @apply px-4 py-3 text-xs font-medium tracking-wider text-left uppercase text-chalky-text-secondary;
  }

  .delivery-archive-table tbody {
    @apply divide-y bg-chalky-surface divide-chalky-border;
  }

  .delivery-archive-row {
    @apply transition-colors duration-150 cursor-pointer hover:bg-chalky-surface-hover;
  }

  .status-badge {
    @apply inline-flex items-center px-2 py-1 text-xs font-medium rounded-full border;
  }

  .route-indicator {
    @apply flex items-center space-x-2 text-sm;
  }

  .route-dot {
    @apply w-2 h-2 rounded-full;
  }

  .route-line {
    @apply w-px h-6 bg-chalky-border;
  }

  .metrics-grid {
    @apply grid grid-cols-1 gap-2 text-sm;
  }

  .metric-row {
    @apply flex justify-between items-center;
  }

  .action-button {
    @apply p-2 text-sm rounded-lg transition-colors;
  }

  .action-button:hover {
    @apply transform scale-105;
  }

  /* Mobile cards styling */
  .mobile-delivery-card {
    @apply p-4 rounded-lg border transition-shadow bg-chalky-surface border-chalky-border hover:shadow-md;
  }

  .mobile-delivery-header {
    @apply flex justify-between items-start mb-3;
  }

  .mobile-delivery-route {
    @apply space-y-2 text-xs text-chalky-text-secondary;
  }

  .mobile-delivery-actions {
    @apply flex justify-between items-center pt-3 mt-3 border-t border-chalky-border-light;
  }


  .input-bici {
    @apply px-2 py-2 w-full text-base text-gray-800 bg-gray-50 rounded-md border border-transparent shadow-md appearance-none placeholder-content focus:outline-none focus:ring-2 focus:ring-blue-bici focus:border-transparent;
  }

  .input-bici-nm {
    @apply w-full text-base text-gray-800 bg-white rounded-md border border-transparent shadow-md appearance-none placeholder-content focus:outline-none focus:ring-2 focus:ring-blue-bici focus:border-transparent;
  }

  .select-bici {
    @apply px-2 py-2.5 w-full text-base font-medium text-gray-800 bg-white rounded-md border-none shadow-md placeholder-content focus:outline-none focus:ring-2 focus:ring-blue-bici focus:border-transparent;
  }

  .input-bici-select-2 {
    @apply mt-2 w-full text-base text-gray-800 bg-white rounded-md border border-transparent shadow-md appearance-none placeholder-content focus:outline-none focus:ring-2 focus:ring-blue-bici focus:border-transparent;
  }
  .label-bici {
    @apply leading-8 text-content;
  }

  .page {
    @apply tracking-wide select-none text-secondary hover:text-tertiary;
  }
  .pagy_nav {
    @apply px-3 py-2 font-semibold rounded-full;
  }

  . {
    @apply cursor-not-allowed text-content hover:text-content;
  }
  aside, main {
    transition: width 300ms ease-in-out;
  }

  aside {
    transition: opacity 300ms ease-in-out;
  }

  /* Cacher le compteur de tickets en mode sidebar repliée */
  .sidebar-collapsed .tickets-counter-section {
    display: none !important;
  }

  .slide-in-left {
    animation: slide-in-left 150ms cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
  }

  @keyframes slide-in-left {
    0% {
      transform: translateX(-300px);
      opacity: 0;
    }
    100% {
      transform: translateX(0);
      opacity: 1;
      display: block !important;
    }
  }

  .slide-out-left {
    animation: slide-out-left 150ms cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
  }

  @keyframes slide-out-left {
    0% {
      transform: translateX(0);
      opacity: 1;
    }
    100% {
      transform: translateX(-800px);
      opacity: 0;
      display: none !important;
    }
  }
  .noUi-handle {
    all: none !important;
    border-radius: 100% !important;
    width: 28px!important;
    height: 28px!important;
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25) !important;
    border: none !important;
    cursor: grab !important;
    font-size: .875rem;
  }

  .noUi-handle-upper::after, .noUi-handle-upper::before {
    display: none !important;
  }
  .noUi-handle-lower::after, .noUi-handle-lower::before {
    display: none !important;
  }

  .noUi-tooltip {
    @apply text-sm font-medium bg-transparent border-none text-chalky-text-primary;
  }

  .noUi-horizontal {
    @apply h-2 rounded-full bg-chalky-border;
  }

  .noUi-connect {
    background-color: var(--chalky-primary) !important;
    @apply rounded-full;
  }

  .noUi-handle {
    background-color: var(--chalky-primary) !important;
    border: 3px solid white !important;
  }

  #informations {
    @apply text-blue-bici;
    table {
      @apply w-full;
      tbody {
        @apply w-full;
        tr {
          @apply flex justify-between items-center w-full;
          th {
            @apply w-1/4 text-left;
          }
          td {
            @apply flex-grow text-right;

          }
        }
      }
    }
  }
  .absolute-center {
    @apply absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2
  }

  .navbar-link {
    @apply
    overflow-hidden relative px-1 py-1 text-sm font-normal tracking-wider rounded-md hover:after:block after:-translate-x-36 hover:after:translate-x-0 hover:after:absolute hover:after:top-20 hover:after:lg:top-6 hover:after:xl:top-8 hover:after:-inset-1 hover:after:h-1 after:ease-in-out after:duration-500 hover:after:bg-tertiary after:transition-all sm:px-2 xl:text-lg hover:text-tertiary;
  }

  .pac-container:after {
    background-image: none !important;
    height: 0px !important;
    content:none !important;
    display:none !important;
  }

  .mapboxgl-ctrl-geocoder--input {
    @apply focus:ring focus:ring-2 focus:ring-blue-bici rounded-lg
  }

  .mapboxgl-ctrl-geocoder--input {
    outline: none !important;
  }

  .mapbox-search > div {
    @apply w-full input-bici
  }

  .suggestions {
    z-index: 2147483647 !important;
    opacity: 100% !important;
  }

  #result {
    z-index: 2147483647 !important;
  }

  #geocoder {
    z-index: 1;
    margin: 20px;
  }

  .mapboxgl-ctrl-geocoder {
    min-width: 100%;
  }

  a.mapboxgl-ctrl-logo {
    display: none !important;
  }

  .mapboxgl-ctrl-attrib.mapboxgl-compact {
    display: none !important;
  }

  /* Dashboard map action popup - remove default padding */
  .delivery-action-popup .mapboxgl-popup-content {
    padding: 0 !important;
    background: white !important;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
    border-radius: 0.5rem;
    overflow: hidden;
  }

  .delivery-action-popup .mapboxgl-popup-tip {
    display: none !important;
  }

  .height-without-navbar {
    height: calc(100vh - theme('spacing.20'));
  }

  .min-height-without-navbar {
    min-height: calc(100vh - theme('spacing.36'));
  }

  .category-selector-tw {
    @apply absolute transform scale-0
  }

  body {
    @apply font-sans;
  }

  p {
    @apply pb-2 tracking-wider leading-loose text-white;
  }

  #terms p {
    @apply tracking-wider leading-5 text-justify text-white;
  }
/*
  h1 {
    @apply text-5xl text-white;
  } */

  #messenger h2 {
    @apply mb-6
    text-2xl inline-block text-primary relative
    before:z-[-1]
    before:absolute
    before:content-['']
    before:block
    before:w-full
    before:-rotate-2
    before:h-3
    before:-bottom-1
    before:bg-tertiary
    before:my-2
    before:mx-2;
  }

  /* #user h2 {
    @apply mb-6
    text-2xl inline-block text-primary relative
    before:z-[-1]
    before:absolute
    before:content-['']
    before:block
    before:w-full
    before:-rotate-2
    before:h-3
    before:-bottom-1
    before:bg-tertiary
    before:my-2
    before:mx-2;
  } */

  /* #user {
    background-color: #7d3535 !important;
  } */

  /* Delivery form - modern black/white style */
  #new_object h2 {
    @apply m-0 text-xl font-semibold text-chalky-text-primary;
  }

  /* =====================================================
     Map Peek Mode - Carte rétractable sur le côté
     ===================================================== */

  .map-peek-container {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
  }

  .map-peek-container.map-collapsed {
    width: 60px;
  }

  .map-peek-container.map-expanded {
    width: 50vw;
  }

  /* Handle (poignée) */
  .map-peek-handle {
    transition: all 0.3s ease;
  }

  .map-collapsed .map-peek-handle {
    opacity: 1;
  }

  .map-expanded .map-peek-handle {
    opacity: 0;
    pointer-events: none;
  }

  /* Chevron animation */
  .map-peek-chevron {
    transition: transform 0.3s ease;
  }

  .map-expanded .map-peek-chevron {
    transform: rotate(180deg);
  }

  /* Overlay sombre quand la carte est étendue */
  .map-peek-container::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 60px;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background 0.3s ease;
    z-index: -1;
  }

  .map-peek-container.map-expanded::before {
    background: rgba(0, 0, 0, 0.1);
  }

  /* Responsive - sur mobile, pas de peek mode */
  @media (max-width: 1024px) {
    .map-peek-container {
      display: none;
    }
  }

  h3 {
    @apply text-xl text-white;
  }

  h4 {
    @apply text-lg text-white;
  }

  .autocomplete {
    @apply inline-block relative;
  }

  /* // input[type=text] {
    //   @apply w-full bg-white
    // } */

  .autocomplete-items {
    @apply overflow-hidden absolute right-0 left-0 top-20 z-50 rounded-md border-x;
  }
  .autocomplete-items div {
    @apply px-3 py-2 border-b cursor-pointer bg-chalky-surface hover:bg-chalky-surface-hover;
  }
  .autocomplete-active {
    color: var(--chalky-text-primary);
    background-color: var(--chalky-surface-active) !important;
  }

  .flex-wrapper {
    display: flex;
    flex-flow: row nowrap;
  }

  .single-chart {
    width: 33%;
    justify-content: space-around ;
  }

  .circular-chart {
    display: block;
    margin: 10px auto;
    max-width: 80%;
    max-height: 250px;
  }

  .circle-bg {
    fill: none;
    stroke: #eee;
    stroke-width: 3.8;
  }

  .circle {
    fill: none;
    stroke-width: 2.8;
    stroke-linecap: round;
    animation: progress 1s ease-out forwards;
  }

  @keyframes progress {
    0% {
      stroke-dasharray: 0 100;
    }
  }

  .circular-chart.orange .circle {
    /* stroke: #ff9f00; */
    @apply !stroke-tertiary;
  }


  .percentage {
    fill: rgb(248, 239, 239);
    font-family: sans-serif;
    font-size: 0.25em;
    text-anchor: middle;
  }
  .percentage-1 {
    @apply fill-tertiary text-[0.35em];
  }
  .align-svg {
    text-anchor: middle;
  }

  /* Floating Label CSS */
  .form-group {
    @apply relative mb-5 w-full;
  }

  .form-input {
    @apply block px-3 py-2 w-full placeholder-transparent rounded-md border border-gray-300 appearance-none focus:outline-none focus:ring-secondary focus:border-secondary;
    @apply transition-all duration-200;
    @apply z-40; /* Ajoutez cette ligne pour définir le z-index du champ de saisie */
  }

  .floating-label {
    @apply absolute left-0 top-2.5 px-3 py-0 transition-all duration-200 ease-in-out transform-gpu pointer-events-none text-content;
    @apply transform;
    @apply z-0; /* Modifiez cette ligne pour ajouter un z-index au label */
  }

  .form-input:focus ~ .floating-label,
  .form-input:not(:placeholder-shown) ~ .floating-label {
    @apply bg-white rounded-full border transform-gpu scale-75 -translate-y-6 text-secondary border-secondary;
  }

  .has-error .form-input {
    @apply border-red-500 focus:ring-red-500 focus:border-red-500;
  }

  .error {
    @apply mt-1 text-sm text-red-600;
  }

  .hint {
    @apply mt-1 text-sm text-content;
  }

  /* =====================================================
     SimpleForm 2025 - Modern Minimal Design
     Style: Underline inputs, labels above, neutral focus
     ===================================================== */

  /* Field wrapper */
  .sf-field {
    @apply mb-5;
  }

  /* Label - Static above input */
  .sf-label {
    @apply block mb-1.5 text-sm font-medium text-chalky-text-secondary;
  }

  /* Base input styles - Underline only with white background */
  .sf-input {
    @apply block px-3 py-2.5 w-full text-base border-0 border-b-2 transition-colors duration-200 ease-out appearance-none text-chalky-text-primary bg-chalky-surface border-chalky-border;
    @apply rounded-t-md placeholder-chalky-text-muted;
    @apply focus:outline-none focus:border-chalky-text-primary;
  }

  /* Select styling */
  select.sf-input {
    @apply pr-10 bg-no-repeat cursor-pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-size: 1.25em 1.25em;
  }

  select.sf-input:focus {
    @apply border-chalky-text-primary;
  }

  /* Textarea styling */
  textarea.sf-input {
    @apply border border-chalky-border rounded-md px-3 py-2 resize-y min-h-[100px];
    @apply focus:border-chalky-text-primary focus:ring-1 focus:ring-chalky-text-primary;
  }

  /* Error state */
  .sf-field--error .sf-input {
    @apply border-chalky-danger;
  }

  .sf-field--error .sf-input:focus {
    @apply border-chalky-danger;
  }

  .sf-field--error .sf-label {
    @apply text-chalky-danger;
  }

  .sf-error {
    @apply block mt-1.5 text-sm text-chalky-danger;
  }

  /* Hint */
  .sf-hint {
    @apply mt-1.5 text-sm text-chalky-text-secondary;
  }

  /* Error notification (form-level) */
  .sf-error-notification {
    @apply p-4 mb-6 text-sm rounded-md border text-chalky-danger-text bg-chalky-danger-light border-chalky-danger-border;
  }

  /* Disabled state */
  .sf-input:disabled,
  .sf-input[readonly] {
    @apply border-dashed cursor-not-allowed text-chalky-text-secondary bg-chalky-surface-tertiary border-chalky-border-light;
  }

  /* ---- Boolean / Checkbox ---- */
  .sf-field--boolean {
    @apply mb-4;
  }

  .sf-boolean {
    @apply flex gap-3 items-center cursor-pointer select-none;
  }

  .sf-checkbox {
    @apply w-5 h-5 bg-transparent rounded border-2 transition-colors duration-150 cursor-pointer text-chalky-text-primary border-chalky-border-strong;
    @apply focus:ring-2 focus:ring-chalky-border focus:ring-offset-0;
    @apply checked:bg-chalky-text-primary checked:border-chalky-text-primary;
    -webkit-appearance: none;
    appearance: none;
  }

  .sf-checkbox:checked {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
  }

  .sf-boolean-label {
    @apply text-base text-chalky-text-primary;
  }

  /* ---- Switch toggle ---- */
  .sf-field--switch {
    @apply mb-4;
  }

  .sf-switch-wrapper {
    @apply flex gap-3 items-center cursor-pointer select-none;
  }

  .sf-switch {
    @apply relative w-11 h-6 rounded-full transition-colors duration-200 ease-in-out cursor-pointer bg-chalky-border;
    -webkit-appearance: none;
    appearance: none;
  }

  .sf-switch::before {
    @apply absolute top-0.5 left-0.5 w-5 h-5 rounded-full shadow-sm transition-transform duration-200 ease-in-out bg-chalky-surface;
    content: "";
  }

  .sf-switch:checked {
    @apply bg-chalky-text-primary;
  }

  .sf-switch:checked::before {
    transform: translateX(20px);
  }

  .sf-switch:focus {
    @apply ring-2 ring-offset-2 outline-none ring-chalky-border;
  }

  .sf-switch:disabled {
    @apply opacity-50 cursor-not-allowed;
  }

  .sf-switch-label {
    @apply text-base text-chalky-text-primary;
  }

  /* ---- Radio buttons ---- */
  .sf-field--radios {
    @apply mb-5;
  }

  /* Container for all radio options */
  .sf-field--radios > span.radio {
    @apply inline-flex mr-6 mb-2;
  }

  /* Label wrapping the radio input */
  .sf-field--radios span.radio label {
    @apply inline-flex gap-2 items-center text-base cursor-pointer select-none text-chalky-text-primary;
  }

  /* Radio input styling */
  input.sf-radios[type="radio"] {
    @apply flex-shrink-0 w-5 h-5 border-2 transition-colors duration-150 cursor-pointer bg-chalky-surface border-chalky-border-strong;
    @apply focus:ring-2 focus:ring-chalky-border focus:ring-offset-0;
    @apply checked:border-chalky-text-primary;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 50%;
  }

  input.sf-radios[type="radio"]:checked {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='%23111827' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='4'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
  }

  /* ---- Radio Pills (modern pill-style buttons) ---- */
  .sf-field--radio-pills {
    @apply mb-5;
  }

  .sf-field--radio-pills .sf-radio-pills {
    @apply flex flex-row flex-wrap gap-3;
  }

  .sf-field--radio-pills span.radio {
    @apply inline-flex mr-2 mb-2;
  }

  /* Label contains the input, so we style the label based on input state inside */
  .sf-field--radio-pills span.radio label {
    @apply inline-flex justify-center items-center px-4 py-2.5 text-sm font-medium whitespace-nowrap rounded-full transition-all duration-200 ease-out cursor-pointer select-none text-chalky-text-secondary;
    background: var(--chalky-surface-secondary);
    border: 2px solid transparent;
  }

  .sf-field--radio-pills span.radio label:hover {
    background: var(--chalky-surface-hover);
  }

  /* Hide the radio input visually but keep it accessible */
  .sf-field--radio-pills span.radio label input[type="radio"] {
    @apply sr-only;
  }

  /* Style label when its contained radio is checked - using :has() */
  .sf-field--radio-pills span.radio label:has(input[type="radio"]:checked) {
    @apply text-chalky-text-inverted;
    background: var(--chalky-primary);
    border-color: var(--chalky-primary);
  }

  .sf-field--radio-pills span.radio label:has(input[type="radio"]:focus) {
    @apply ring-2 ring-offset-2;
    --tw-ring-color: var(--chalky-primary);
  }

  /* ---- Checkboxes collection ---- */
  .sf-field--checkboxes {
    @apply mb-5;
  }

  /* Container for all checkbox options */
  .sf-field--checkboxes > span.checkbox {
    @apply inline-flex mr-6 mb-2;
  }

  /* Label wrapping the checkbox input */
  .sf-field--checkboxes span.checkbox label {
    @apply inline-flex gap-2 items-center text-base cursor-pointer select-none text-chalky-text-primary;
  }

  /* Checkbox input styling in collections */
  input.sf-checkboxes[type="checkbox"] {
    @apply flex-shrink-0 w-5 h-5 rounded border-2 transition-colors duration-150 cursor-pointer bg-chalky-surface border-chalky-border-strong;
    @apply focus:ring-2 focus:ring-chalky-border focus:ring-offset-0;
    @apply checked:bg-chalky-text-primary checked:border-chalky-text-primary;
    -webkit-appearance: none;
    appearance: none;
  }

  input.sf-checkboxes[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
  }

  /* Custom Switch CSS */
  .switch {
    @apply inline-flex relative justify-start items-center w-14 h-8 rounded-full transition-colors duration-200 ease-in-out cursor-pointer bg-chalky-border;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 2px;
  }

  .switch:before {
    @apply block w-7 h-7 rounded-full shadow-md transition-transform duration-200 ease-in-out bg-chalky-surface;
    content: "";
    transform: translateX(0);
  }

  .switch:checked {
    @apply bg-secondary;
    background-image: none;
  }

  .switch.switch-accent:checked {
    background-color: var(--chalky-primary) !important;
  }

  .switch.switch-chalky-primary:checked {
    background-color: var(--chalky-primary) !important;
  }

  /* Cacher le texte auto-généré par SimpleForm pour les switches */
  .switch + span,
  .switch ~ span:not([class]) {
    @apply sr-only;
  }

  .switch:checked:before {
    transform: translateX(24px);
  }

  .switch:checked:hover,
  .switch:checked:focus {
    background-image: none;
  }

  .switch:focus {
    @apply ring-2 ring-offset-2 outline-none ring-secondary;
  }

  .switch:disabled {
    @apply opacity-50 cursor-not-allowed;
  }


  /* Custom hour button CSS */
  .btn-hour {
    @apply inline-flex relative justify-center items-center px-4 py-2 text-center rounded-md transition-colors duration-200 cursor-pointer bg-secondary;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }

  .btn-hour:after {
    @apply block text-sm font-medium text-center text-white;
    content: "Personnaliser";
  }

  .btn-hour:checked {
    @apply bg-white border-2 border-secondary;
  }

  .btn-hour:checked:after {
    @apply text-secondary;
  }

  /* Bin for checkbox */
  .bin-box {
    @apply inline-block relative w-12 align-middle border-none cursor-pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }

  .bin-box:after {
    @apply block absolute w-12 transition-transform duration-200 text-secondary;
    content: "\f1f8";
    font-family: "Font Awesome 6 Pro";
    display: inline-block;
    vertical-align: middle;
    font-weight:900;
  }

    /* fa warning */
    .warning {
      @apply absolute top-0 left-1/2 border-none -translate-x-1/2 cursor-pointer;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
    }

    .warning:after {
      @apply block text-base text-red-500 transition-transform duration-200;
      content: "\f071";
      font-family: "Font Awesome 6 Pro";
      display: inline-block;
      vertical-align: middle;
      font-weight:900;
    }


    /* fa dropout */
    .dropout {
      @apply absolute top-1 left-1/2 border-none -translate-x-1/2 cursor-pointer;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
    }

    .dropout:after {
      @apply block text-base text-white transition-transform duration-200 rotate-90;
      content: "\f08b";
      font-family: "Font Awesome 6 Pro";
      display: inline-block;
      vertical-align: middle;
      font-weight:700;
    }


    /* fa hourglass */
    .hourglass {
      @apply absolute top-0.5 left-1/2 border-none -translate-x-1/2 cursor-pointer;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
    }

    .hourglass:after {
      @apply block text-base text-white transition-transform duration-200;
      content: "\f251";
      font-family: "Font Awesome 6 Pro";
      display: inline-block;
      vertical-align: middle;
      font-weight:700;
    }

    /* fa check */
    .check {
      @apply absolute top-0.5 left-1/2 border-none -translate-x-1/2 cursor-pointer;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
    }

    .check:after {
      @apply block text-base text-white transition-transform duration-200;
      content: "\f00c";
      font-family: "Font Awesome 6 Pro";
      display: inline-block;
      vertical-align: middle;
      font-weight:700;
    }

    /* registration switch */
    .switch-container {
      @apply flex justify-center items-center text-center;
    }

    .btn-switch {
      @apply flex relative justify-center items-center px-3 py-2 text-base font-medium text-center text-gray-600 bg-gray-100 rounded-full border border-gray-100 transition cursor-pointer hover:bg-blue-100;
    }

    input[type='radio']:checked + .btn-switch {
      @apply text-white border bg-secondary border-tertiary;
    }

  /* =====================================================
     Glassmorphism - Formulaire transparent avec blur
     ===================================================== */

  .glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.1),
      0 2px 8px rgba(0, 0, 0, 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.6);
    @apply rounded-2xl;
  }

  .glass-card-darker {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.12),
      0 2px 8px rgba(0, 0, 0, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.7);
    @apply rounded-2xl;
  }

  .glass-card-light {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  /* Glass Select styling */
  .glass-select {
    @apply px-3 py-2.5 w-full text-sm rounded-lg transition-all duration-200 cursor-pointer text-chalky-text-primary;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
  }

  .glass-select:focus {
    @apply outline-none;
    background-color: rgba(255, 255, 255, 0.9);
    border-color: var(--chalky-primary);
    box-shadow: 0 0 0 3px rgba(255, 1, 153, 0.15);
  }

  /* =====================================================
     TomSelect Glass Style - For glass-card context
     ===================================================== */

  /* Reset SimpleForm styles for glass context */
  .glass-tom-select .ts-wrapper,
  .glass-tom-select .ts-wrapper.sf-input {
    border: none !important;
    border-bottom: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
  }

  .glass-tom-select .ts-wrapper.single .ts-control {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 0.5rem !important;
    padding: 0.625rem 2.5rem 0.625rem 0.75rem !important;
    box-shadow: none !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s ease !important;
    min-height: auto !important;
  }

  .glass-tom-select .ts-wrapper.single .ts-control:hover {
    background: rgba(255, 255, 255, 0.75) !important;
  }

  .glass-tom-select .ts-wrapper.single.focus .ts-control,
  .glass-tom-select .ts-wrapper.single.dropdown-active .ts-control {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: var(--chalky-primary) !important;
    box-shadow: 0 0 0 3px rgba(255, 1, 153, 0.15) !important;
  }

  .glass-tom-select .ts-wrapper.single .ts-control .item {
    @apply text-sm font-normal;
    color: var(--chalky-text-primary) !important;
  }

  .glass-tom-select .ts-wrapper.single .ts-control > input {
    @apply text-sm;
  }

  .glass-tom-select .ts-wrapper.single .ts-control > input::placeholder {
    color: var(--chalky-text-muted) !important;
    opacity: 1 !important;
  }

  /* Dropdown styling */
  .glass-tom-select .ts-wrapper .ts-dropdown,
  .glass-tom-select .ts-dropdown {
    background: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 0.75rem !important;
    margin-top: 0.25rem !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    z-index: 9999 !important;
  }

  .glass-tom-select .ts-wrapper .ts-dropdown .ts-dropdown-content,
  .glass-tom-select .ts-dropdown .ts-dropdown-content {
    max-height: 280px !important;
    padding: 0.25rem !important;
    overflow-y: auto !important;
  }

  .glass-tom-select .ts-wrapper .ts-dropdown .option,
  .glass-tom-select .ts-dropdown .option {
    @apply px-3 py-2 text-sm rounded-lg;
    color: var(--chalky-text-secondary) !important;
    background: transparent !important;
    transition: all 0.15s ease !important;
    cursor: pointer !important;
  }

  .glass-tom-select .ts-wrapper .ts-dropdown .option:hover,
  .glass-tom-select .ts-wrapper .ts-dropdown .option.active,
  .glass-tom-select .ts-dropdown .option:hover,
  .glass-tom-select .ts-dropdown .option.active {
    background: var(--chalky-primary-light) !important;
    color: var(--chalky-text-primary) !important;
  }

  .glass-tom-select .ts-wrapper .ts-dropdown .option.selected,
  .glass-tom-select .ts-dropdown .option.selected {
    background: var(--chalky-primary-light) !important;
    color: var(--chalky-primary) !important;
    font-weight: 500 !important;
  }

  /* Hide empty options */
  .glass-tom-select .ts-dropdown .option:empty {
    display: none !important;
  }

  /* Search input in dropdown */
  .glass-tom-select .ts-dropdown .dropdown-input-wrap {
    padding: 0.5rem !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  }

  .glass-tom-select .ts-dropdown .dropdown-input {
    @apply px-3 py-2 w-full text-sm rounded-lg;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    background: var(--chalky-surface-secondary) !important;
  }

  .glass-tom-select .ts-dropdown .dropdown-input:focus {
    outline: none !important;
    border-color: var(--chalky-primary) !important;
    box-shadow: 0 0 0 2px rgba(255, 1, 153, 0.1) !important;
  }

  /* =====================================================
     Volume Radio Buttons - Pills avec icônes progressives
     ===================================================== */

  .volume-radio-group {
    @apply flex flex-wrap gap-2 w-full;
  }

  .volume-radio {
    @apply sr-only;
  }

  .volume-radio-label {
    @apply flex flex-col flex-1 justify-center items-center px-2 py-2 text-center rounded-lg transition-all duration-200 ease-out cursor-pointer select-none min-w-[60px];
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  }

  .volume-radio-label:hover {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  }

  .volume-radio-label .volume-icon {
    @apply mb-0.5 text-base transition-colors duration-200 text-chalky-text-muted;
  }

  .volume-radio-label .volume-name {
    @apply text-xs font-medium transition-colors duration-200 text-chalky-text-secondary;
  }

  .volume-radio-label .volume-tickets {
    @apply text-[10px] text-chalky-text-muted mt-0.5;
  }

  .volume-radio:checked + .volume-radio-label {
    background: var(--chalky-primary-light);
    border-color: var(--chalky-primary);
    box-shadow: none;
  }

  .volume-radio:checked + .volume-radio-label .volume-icon {
    @apply text-accent;
  }

  .volume-radio:checked + .volume-radio-label .volume-name {
    @apply text-accent;
  }

  .volume-radio:focus + .volume-radio-label {
    @apply ring-2 ring-opacity-30 ring-accent;
  }

  /* =====================================================
     Urgence Radio Buttons - Style élégant
     ===================================================== */

  .urgence-radio-group {
    @apply flex flex-wrap gap-2 w-full;
  }

  .urgence-radio {
    @apply sr-only;
  }

  .urgence-radio-label {
    @apply flex flex-1 gap-2 justify-center items-center px-3 py-2 text-center rounded-lg transition-all duration-200 ease-out cursor-pointer select-none min-w-[80px];
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  }

  .urgence-radio-label:hover {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  }

  .urgence-radio-label .urgence-icon {
    @apply transition-colors duration-200 text-chalky-text-muted;
  }

  .urgence-radio-label .urgence-name {
    @apply text-sm font-medium transition-colors duration-200 text-chalky-text-secondary;
  }

  .urgence-radio:checked + .urgence-radio-label {
    background: var(--chalky-primary-light);
    border-color: var(--chalky-primary);
    box-shadow: none;
  }

  .urgence-radio:checked + .urgence-radio-label .urgence-icon {
    @apply text-accent;
  }

  .urgence-radio:checked + .urgence-radio-label .urgence-name {
    @apply text-accent;
  }

  .urgence-radio:focus + .urgence-radio-label {
    @apply ring-2 ring-opacity-30 ring-accent;
  }

  /* Custom time option */
  .urgence-radio-label.custom-time {
    @apply border-dashed;
  }

  .urgence-radio:checked + .urgence-radio-label.custom-time {
    @apply border-solid border-accent;
  }

  /* =====================================================
     Favoris Star Button & Dropdown
     ===================================================== */

  .favorite-star-btn {
    @apply flex justify-center items-center w-11 h-11 bg-opacity-90 rounded-full border shadow-lg backdrop-blur-sm transition-all duration-200 ease-out cursor-pointer bg-chalky-surface border-chalky-border;
    @apply hover:bg-chalky-warning-light hover:border-chalky-warning-border hover:scale-105;
  }

  .favorite-star-btn i {
    @apply text-lg transition-colors duration-200 text-chalky-warning;
  }

  .favorite-star-btn:hover i {
    @apply text-chalky-warning-hover;
  }

  /* =====================================================
     Map Peek Button (voir la carte)
     ===================================================== */

  .map-peek-btn {
    @apply flex justify-center items-center w-11 h-11 bg-opacity-90 rounded-full border shadow-lg backdrop-blur-sm transition-all duration-200 ease-out cursor-pointer bg-chalky-surface border-chalky-border;
    @apply hover:bg-chalky-info-light hover:border-chalky-info-border hover:scale-105;
  }

  .map-peek-btn i {
    @apply text-lg transition-colors duration-200 text-chalky-info;
  }

  .map-peek-btn:hover i {
    @apply text-chalky-info-hover;
  }

  /* Animation pour masquer/afficher le formulaire */
  .form-peek-hidden {
    @apply opacity-0 pointer-events-none;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .delivery-form-overlay {
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  /* Mode carte plein écran - masque la sidebar */
  .map-fullscreen-hidden {
    @apply opacity-0 pointer-events-none;
    transform: translateX(-100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  /* Mode carte plein écran - contenu prend tout l'écran */
  .map-fullscreen-mode {
    margin-left: 0 !important;
    transition: margin-left 0.3s ease;
  }

  /* Styles gérés par favorites_dropdown_controller.js */
  .favorite-dropdown {
    /* Styles appliqués dynamiquement par Stimulus */
  }

  .favorite-dropdown-item {
    @apply flex items-center px-3 py-2.5 rounded-lg transition-all duration-150 cursor-pointer;
    @apply hover:bg-chalky-warning-light;
  }

  /* =====================================================
     Options Section (in glass form)
     ===================================================== */

  .options-section {
    @apply pt-3 mt-3 border-t border-opacity-50 border-chalky-border;
  }

  .option-row {
    @apply flex justify-between items-center py-1;
  }

  .option-label {
    @apply flex gap-2 items-center;
  }

  .option-label-icon {
    @apply flex justify-center items-center w-6 h-6 rounded;
  }

  .option-label-text {
    @apply text-xs font-medium text-chalky-text-secondary;
  }

  .option-label-hint {
    @apply text-xs text-chalky-text-muted;
  }

  /* =====================================================
     Full-page map delivery form layout
     ===================================================== */

  .delivery-form-fullmap {
    @apply relative w-full min-h-screen;
  }

  .delivery-form-fullmap #map {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 0 !important;
  }

  .delivery-form-overlay {
    @apply relative z-10 p-4 min-h-screen;
    @apply lg:p-8 lg:pt-12;
    /* Padding bottom pour la barre mobile */
    padding-bottom: 100px;
  }

  @media (min-width: 1024px) {
    .delivery-form-overlay {
      padding-bottom: 2rem;
    }
  }

  /* Layout 2 colonnes desktop */
  .delivery-form-layout {
    @apply flex gap-6 mx-auto w-full max-w-6xl;
    @apply flex-col lg:flex-row;
  }

  /* Colonne principale (formulaire) */
  .delivery-form-main {
    @apply w-full pointer-events-auto;
    @apply lg:flex-1 lg:max-w-2xl;
  }

  /* Sidebar sticky (total + boutons) */
  .delivery-form-sidebar {
    @apply w-full pointer-events-auto;
    @apply lg:w-96 lg:flex-shrink-0;
  }

  .delivery-form-sticky {
    @apply lg:sticky lg:top-8;
  }

  /* Barre fixe mobile en bas */
  .delivery-form-mobile-bar {
    @apply fixed right-0 bottom-0 left-0 z-50;
    @apply px-4 py-3;
    @apply pointer-events-auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  }

  /* Legacy - pour compatibilité */
  .delivery-form-container {
    @apply w-full pointer-events-auto;
    max-width: 90%;
    @apply lg:max-w-3xl;
  }

  /* Compact input styling for glass form */
  .glass-input {
    @apply px-3 py-2.5 w-full text-sm rounded-lg transition-all duration-200 placeholder-chalky-text-muted text-chalky-text-primary;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .glass-input:focus {
    @apply outline-none;
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--chalky-primary);
    box-shadow: 0 0 0 3px rgba(255, 1, 153, 0.15);
  }

  .glass-textarea {
    @apply px-3 py-2 w-full text-sm rounded-lg transition-all duration-200 resize-none placeholder-chalky-text-muted text-chalky-text-primary;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .glass-textarea:focus {
    @apply outline-none;
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--chalky-primary);
    box-shadow: 0 0 0 3px rgba(255, 1, 153, 0.15);
  }

  /* Slider expand animation */
  .slider-expand-enter {
    @apply overflow-hidden max-h-0 opacity-0;
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
  }

  .slider-expand-active {
    @apply max-h-40 opacity-100;
  }
}

@layer components {
  /* =====================================================
     Custom Help Tooltip - Works with backdrop-filter
     Uses absolute positioning instead of fixed
     ===================================================== */

  .help-tooltip {
    @apply inline-flex relative;
  }

  .help-tooltip-trigger {
    @apply cursor-help;
  }

  .help-tooltip-content {
    @apply absolute invisible z-50 opacity-0;
    @apply p-4 w-72;
    @apply bg-white rounded-xl shadow-xl;
    @apply border border-gray-100;
    @apply transition-all duration-200 ease-out;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
  }

  .help-tooltip:hover .help-tooltip-content,
  .help-tooltip-trigger:focus + .help-tooltip-content {
    @apply visible opacity-100;
    transform: translateX(-50%) scale(1);
  }

  .help-tooltip-content::before {
    content: '';
    @apply absolute w-3 h-3 bg-white border-t border-l border-gray-100;
    top: -7px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
  }

  @media (max-width: 640px) {
    .help-tooltip-content {
      left: auto;
      right: -8px;
      transform: scale(0.95);
    }

    .help-tooltip:hover .help-tooltip-content {
      transform: scale(1);
    }

    .help-tooltip-content::before {
      left: auto;
      right: 16px;
      transform: rotate(45deg);
    }
  }
}
/* 
 * Optimized Deliveries Archives Table Layout
 * Custom grid system with content-aware column sizing
 */

/* Table Header Grid Layout */
.deliveries-archive-table-header {
  display: grid;
  grid-template-columns: 
    minmax(80px, 10fr)   /* Livraison: Compact for ID + status */
    minmax(140px, 18fr)  /* Client & Date: Medium width */
    minmax(200px, 38fr)  /* Itinéraire: Largest for addresses */
    minmax(120px, 16fr)  /* Métriques: Medium for metrics */
    minmax(60px, 8fr)    /* Carnet: Small for icons */
    minmax(60px, 10fr);  /* Actions: Small for buttons */
  gap: 1rem;
  align-items: center;
}

/* Table Row Grid Layout - Matches header exactly */
.deliveries-archive-table-row {
  display: grid;
  grid-template-columns: 
    minmax(80px, 10fr)   /* Livraison */
    minmax(140px, 18fr)  /* Client & Date */
    minmax(200px, 38fr)  /* Itinéraire */
    minmax(120px, 16fr)  /* Métriques */
    minmax(60px, 8fr)    /* Carnet */
    minmax(60px, 10fr);  /* Actions */
  gap: 1rem;
  align-items: center;
}

/* Responsive behavior for smaller screens */
@media (max-width: 1280px) {
  .deliveries-archive-table-header,
  .deliveries-archive-table-row {
    grid-template-columns: 
      minmax(70px, 9fr)
      minmax(120px, 16fr)
      minmax(180px, 40fr)  /* Give more space to addresses on smaller screens */
      minmax(100px, 18fr)
      minmax(50px, 7fr)
      minmax(50px, 10fr);
    gap: 0.75rem;
  }
}

@media (max-width: 1024px) {
  .deliveries-archive-table-header,
  .deliveries-archive-table-row {
    grid-template-columns: 
      minmax(60px, 8fr)
      minmax(100px, 15fr)
      minmax(160px, 42fr)  /* Maximum space for addresses */
      minmax(80px, 20fr)
      minmax(40px, 6fr)
      minmax(40px, 9fr);
    gap: 0.5rem;
  }
}

/* Enhanced column-specific styling */
.deliveries-archive-table-row > *:nth-child(1) {
  /* Livraison column - center everything */
  justify-self: center;
}

.deliveries-archive-table-row > *:nth-child(2) {
  /* Client & Date column - left align with smart truncation */
  justify-self: start;
  min-width: 0; /* Allow shrinking */
}

.deliveries-archive-table-row > *:nth-child(3) {
  /* Itinéraire column - left align with generous space */
  justify-self: start;
  min-width: 0; /* Allow shrinking */
}

.deliveries-archive-table-row > *:nth-child(4) {
  /* Métriques column - left align for inline labels */
  justify-self: start;
}

.deliveries-archive-table-row > *:nth-child(5) {
  /* Carnet column - center align */
  justify-self: center;
}

.deliveries-archive-table-row > *:nth-child(6) {
  /* Actions column - center align */
  justify-self: center;
}

/* Smart text truncation for address fields */
.deliveries-archive-table-row .truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Improved hover effects */
.deliveries-archive-table-row:hover {
  background-color: rgb(239 246 255); /* bg-blue-50 */
}

/* Better spacing for route visualization */
.deliveries-archive-table-row .space-y-2 > * + * {
  margin-top: 0.5rem;
}

/* Metrics grid improvements */
.deliveries-archive-table-row .grid.grid-cols-1 {
  gap: 0.25rem;
}

/* Action buttons positioning */
.deliveries-archive-table-row .opacity-0.group-hover\:opacity-100 {
  transition: opacity 0.2s ease-in-out;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
