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

@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: #007BFF; /* Couleur de votre choix */
    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 shadow-lg rounded-b-xl 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;
  }

  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 transition-colors border-2 rounded-md shadow-md 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;
  }


  #dispatch-table {
    @apply w-full text-gray-600 bg-white shadow-lg rounded-xl;
  }
  #dispatch-table thead {
    @apply bg-secondary text-white font-bold !text-left;
  }
  #dispatch-table thead tr th {
    @apply sticky top-0 px-3 py-3 overflow-hidden 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 w-full bg-white shadow-lg rounded-xl overflow-hidden;
  }
  
  .delivery-archive-table thead {
    @apply bg-gray-50 border-b border-gray-200;
  }
  
  .delivery-archive-table thead th {
    @apply px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider;
  }
  
  .delivery-archive-table tbody {
    @apply bg-white divide-y divide-gray-200;
  }
  
  .delivery-archive-row {
    @apply hover:bg-gray-50 transition-colors duration-150 cursor-pointer;
  }
  
  .status-badge {
    @apply inline-flex items-center px-2 py-1 rounded-full text-xs font-medium 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-gray-300;
  }
  
  .metrics-grid {
    @apply grid grid-cols-1 gap-2 text-sm;
  }
  
  .metric-row {
    @apply flex justify-between items-center;
  }
  
  .action-button {
    @apply p-2 rounded-lg transition-colors text-sm;
  }
  
  .action-button:hover {
    @apply transform scale-105;
  }

  /* Mobile cards styling */
  .mobile-delivery-card {
    @apply bg-white border border-gray-200 rounded-lg p-4 hover:shadow-md transition-shadow;
  }
  
  .mobile-delivery-header {
    @apply flex justify-between items-start mb-3;
  }
  
  .mobile-delivery-route {
    @apply space-y-2 text-xs text-gray-500;
  }
  
  .mobile-delivery-actions {
    @apply flex justify-between items-center mt-3 pt-3 border-t border-gray-100;
  }


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

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

  .ts-wrapper.single .ts-control {
    appearance: none !important;
    background-color: #fff !important;
    background-image: none !important;
    color: rgb(31 41 55 / var(--tw-text-opacity));
    background-repeat: repeat-x !important;
    border-radius: 0.375rem !important;
    border-style: none !important;
    --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
    --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color) !important;
    box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
  }
  .ts-wrapper.single .ts-control .item {
    font-weight: 500 !important;
    font-size: 1rem/* 16px */ !important;
    line-height: 1.5rem/* 24px */ !important;
  }

  .input-bici-select-2 {
    @apply w-full mt-2 text-base text-gray-800 bg-white border border-transparent rounded-md 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;
  }

  .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 bg-transparent border-none text-tertiary;
  }

  .noUi-horizontal {
    @apply h-2;
  }

  .noUi-connect {
    @apply !bg-tertiary;
  }

  #informations {
    @apply text-blue-bici;
    table {
      @apply w-full;
      tbody {
        @apply w-full;
        tr {
          @apply flex items-center justify-between 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
    relative px-1 py-1 overflow-hidden 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;
  }

  .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 leading-loose tracking-wider text-white;
  }

  #terms p {
    @apply leading-5 tracking-wider 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;
  }

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

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

  .autocomplete {
    @apply relative inline-block;
  }

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

  .autocomplete-items {
    @apply absolute left-0 right-0 z-50 overflow-hidden rounded-md border-x top-20;
  }
  .autocomplete-items div {
    @apply px-3 py-2 bg-white border-b cursor-pointer hover:bg-gray-100;
  }
  .autocomplete-active {
    color: rgb(17 24 39);
    background-color: rgb(229 231 235) !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 w-full mb-5;
  }

  .form-input {
    @apply block w-full px-3 py-2 placeholder-transparent border border-gray-300 rounded-md 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 top-2.5 left-0 py-0 px-3 pointer-events-none transform-gpu transition-all duration-200 ease-in-out 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 scale-75 -translate-y-6 bg-white border rounded-full transform-gpu 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;
  }

  /* Custom Switch CSS */
  .switch {
    @apply relative inline-block h-8 align-middle transition-colors duration-200 bg-gray-400 rounded-full cursor-pointer w-14;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }

  .switch:before {
    @apply absolute block h-7 w-7 bg-white border border-gray-200 rounded-full shadow-md transform-gpu transition-transform duration-200 translate-x-[1px];
    content: "";
    top: 0.5px;
    left: 0.5px;
  }

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

  .switch:checked:before {
    @apply transform translate-x-[25px];
  }


  /* Custom hour button CSS */
  .btn-hour {
    @apply relative inline-block align-middle cursor-pointer text-center bg-secondary w-32 h-[42px] transition-colors duration-200;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }

  .btn-hour:after {
    @apply absolute block text-center text-white transition-transform duration-200;
    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 relative inline-block w-12 align-middle border-none cursor-pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }

  .bin-box:after {
    @apply absolute block 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 -translate-x-1/2 border-none cursor-pointer left-1/2;
      -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 -translate-x-1/2 border-none cursor-pointer left-1/2 top-1;
      -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 cursor-pointer border-none absolute left-1/2 -translate-x-1/2 top-0.5;
      -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 cursor-pointer border-none absolute left-1/2 -translate-x-1/2 top-0.5;
      -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 items-center justify-center text-center;
    }

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

    input[type='radio']:checked + .btn-switch {
      @apply text-white border bg-secondary border-tertiary;
    }
}
/* 
 * 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.
 *


 */
