﻿:root {
  --primary: #f7968a; /* Corail/Rose de l'affiche */
  --primary-hover: #f57e70;
  --primary-underline: rgba(247, 150, 138, 0.5);
  --primary-focus: rgba(247, 150, 138, 0.5);
  --primary-inverse: #fff;
  
  --pico-font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --pico-border-radius: 0.5rem;
  --pico-primary: #d63031;
    --pico-primary-background: #d63031;
}

:host(:not([data-theme=dark])), :root:not([data-theme=dark]), [data-theme=light] {
      --pico-primary: #d63031;
    --pico-primary-background: #d63031;
}


body {
  background-color: #fce4e1; /* Fond rose trÃ¨s clair inspirÃ© de l'affiche */
  background-image: linear-gradient(135deg, #fce4e1 0%, #ffffff 100%);
  background-attachment: fixed;
  color: #2d3436;
}

header {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 0.5rem 0;
  position: relative;
}

nav.container {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Harmonise l'alignement vertical */
}

#nav-menu {
    display: flex;
    align-items: center; /* Centre les éléments verticalement dans le menu */
    margin-bottom: 0;
}

#nav-menu li {
    display: flex;
    align-items: center;
    padding: 0;
}

#nav-menu li a[role="button"], 
#nav-menu li button {
    margin: 0;
}

input:not([type=checkbox],[type=radio],[type=range]) {
    height: revert !important;
}

.ts-dropdown, .ts-control, .ts-control input {
    margin: 0;
    font-size: 1rem;
    line-height: var(--pico-line-height);
    font-family: inherit;
    letter-spacing: inherit;
    font-weight: 400;
}

.ts-dropdown-content {
    max-height: 50vh;
}

.brand {
  color: var(--primary) !important;
  font-size: 1.5rem;
  letter-spacing: -0.05rem;
  text-decoration: none !important;
}

h1, h2, h3 {
  color: #d63031;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.filters {
  background: #fff;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
}

.filters label {
  font-weight: 600;
  color: #636e72;
  font-size: 0.85rem;
}

.cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

article.card {
  background: #fff;
  border: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  transition: transform 0.2s ease;
  margin-bottom: 0;
  padding: 1.25rem;
}

article.card:hover {
  transform: translateY(-4px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.25rem;
}

.card-top strong {
  font-size: 1.2rem;
  line-height: 1.1;
  color: #2d3436;
}

.company-name {
  color: #00b894; /* Sorte de turquoise/vert de l'affiche */
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.heart {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: #d63031;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  margin: 0;
  box-shadow: none;
  width: auto;
}

.heart:hover {
  transform: scale(1.1);
}

.rep-table {
  margin-bottom: 0;
  font-size: 0.85rem;
}

.rep-table th {
  padding: 0.5rem 0.25rem;
  background: transparent;
  border-bottom: 2px solid #fce4e1;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: #b2bec3;
}

.rep-table td {
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid #f1f2f6;
}

.nowrap {
  white-space: nowrap;
}

.conflict {
  background-color: #ffeef0 !important;
  border-left: 5px solid #d63031 !important;
}

.conflict td {
  background: transparent !important;
}

.program-day {
  margin-bottom: 3rem;
}

.program-day h2 {
  border-bottom: 3px solid var(--primary);
  display: inline-block;
  padding-right: 2rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Auth forms */
.auth-container {
  max-width: 400px;
  margin: 2rem auto;
}

/* Date chips */
.date-chip {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    margin: 0;
    box-shadow: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    line-height: normal;
}

.date-chip:hover {
    background: #fff5f4;
}

.date-chip.active {
    background: var(--primary);
    color: white;
}

/* Tom Select Overrides for Pico CSS */
.ts-wrapper.single .ts-control {
    background-color: #fff !important;
    border: 1px solid #ced4da;
    border-radius: var(--pico-border-radius);
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    height: calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2); /* Hauteur exacte de Pico CSS */
    display: flex;
    align-items: center;
    opacity: 1 !important;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .ts-wrapper.single .ts-control, 
    .ts-wrapper.single .ts-control input {
        font-size: 1.1rem !important; /* Un peu plus grand sur mobile pour Ã©viter le zoom iOS et amÃ©liorer la lisibilitÃ© */
    }
}

.ts-wrapper.single.focus .ts-control {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.125rem var(--primary-focus);
    height: calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2); /* Maintenir la même hauteur au focus */
}

.ts-dropdown {
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: var(--pico-border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-top: 5px;
    z-index: 1000;
}

.ts-dropdown .active {
    background-color: var(--primary);
    color: #fff;
}

.ts-control input {
    font-family: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ts-wrapper .option {
    padding: 0.5rem 0.75rem;
}

/* Style pour le bouton de suppression (croix) */
.ts-wrapper.single .item .remove,
.ts-wrapper.single .ts-control > .remove {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border-left: none;
    margin-left: 0;
    padding-left: 0;
    color: #b2bec3 !important; /* Gris clair */
    font-weight: bold;
    font-size: 1.2rem;
    display: block !important;
    text-decoration: none !important;
}

.ts-wrapper.single .item .remove {
    display: none !important; /* Masquer la croix par défaut de TomSelect sur l'item pour éviter les doublons si sélectionné */
}

.ts-wrapper.single .ts-control {
    padding-right: 2.5rem !important; /* Faire de la place pour la croix */
    position: relative;
}

/* Hamburger Menu Styles */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
    margin: 0;
    box-shadow: none;
    align-self: center;
}

.user-info-top {
    font-size: 0.8rem;
    line-height: 1;
    margin-top: -0.2rem;
}

.brand {
    display: inline-block;
    margin-bottom: 0;
}

.hamburger span {
    width: 2rem;
    height: 0.25rem;
    background: var(--primary);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

.hamburger[aria-expanded="true"] span:first-child {
    transform: rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg);
}

@media (min-width: 993px) {
    #nav-menu {
        width: 50%;
        justify-content: flex-end;
        align-items: center;
    }
    .logout-btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.85rem !important;
        width: auto !important;
    }
}

@media (max-width: 992px) {
    #nav-menu li form button.logout-btn {
        width: 100% !important;
        padding: var(--pico-spacing) !important;
        font-size: 1rem !important;
    }
}

/* Styles pour le menu dropdown "Plus d'actions" */
details.dropdown {
    position: relative;
    display: inline-block;
}

details.dropdown[open]>summary {
    margin-bottom: 0 !important;
}

details.dropdown summary + ul {
    position: absolute;
    left: auto;
    right: 0;
    z-index: 100;
    width: max-content;
    min-width: 200px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #eee;
    padding: 1rem !important;
    margin-top: 0.5rem;
    border-radius: var(--pico-border-radius);
    list-style: none !important;
}

details.dropdown summary + ul li {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

details.dropdown summary + ul li::before {
    display: none !important;
}

details.dropdown summary::after {
    display: none !important;
}

@media (max-width: 992px) {
    .hamburger {
        display: flex;
    }

    #nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        padding: 1rem;
        box-shadow: 0 10px 10px rgba(0,0,0,0.05);
        z-index: 9;
        margin: 0;
        border-top: 1px solid #f1f2f6;
    }

    #nav-menu.open {
        display: flex;
    }

    #nav-menu li {
        width: 100%;
        padding: 0.5rem 0;
        margin: 0;
    }

    #nav-menu li a {
        display: block;
        width: 100%;
    }
    
    #nav-menu li form {
        width: 100%;
    }
    
    #nav-menu li form button {
        width: 100%;
        text-align: center;
    }
}

/* Distinct info for selection cards */
.card-info-compact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.rep-item-distinct {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.info-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.info-group .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #636e72;
    font-weight: 700;
}

.info-group .value-lieu a {
    color: var(--primary) !important;
    font-weight: 700;
    text-decoration: underline;
}

.info-group .value-page {
    font-weight: 700;
    color: #2d3436;
}