/* simulateur-roi.css - À placer dans static/src/simulateur-roi.css */

/* ========================================
   EXTRACTION DU STYLE INLINE EXISTANT
   ======================================== */

/* Unit picker - Déjà dans votre HTML, on l'extrait ici */
.unit-picker {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  margin-left: .4rem;
}

.unit-selected {
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: .95rem;
  color: #fff;
  background: var(--primary-color);
  padding: .45rem .7rem;
  border-radius: 999px;
}

.unit-selected:focus-visible {
  outline: 2px solid #9aa3ff;
  outline-offset: 2px;
}

.unit-options {
  position: absolute;
  top: 0;
  left: calc(100% - 6px);
  list-style: none;
  padding: 4px;
  margin: 0;
  background: #fff;
  border: 1px solid #e8e8ed;
  border-radius: 999px;
  display: flex;
  gap: 4px;
  box-shadow: 0 8px 20px rgba(18,16,60,.15);
  z-index: 30;
  transform: translateX(-10px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: transform .18s ease, opacity .18s ease, visibility .18s linear;
}

.unit-options li {
  padding: 0 .7rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: #1d184e;
  user-select: none;
}

.unit-options li[aria-selected="true"] {
  background: #634dfa;
  color: #fff;
}

.unit-options li:hover {
  background: #f5f2ff;
}

/* États actifs */
.unit-picker.open .unit-options {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

@media (hover:hover) and (pointer:fine) {
  .unit-picker:hover .unit-options {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }
}

/* Steppers */
.sb-number {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.sb-number input {
  width: 60px;
  margin: 0 .5rem .75rem;
  text-align: center;
  border-radius: 8px;
  padding: .2rem .6rem;
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  background: rgba(255,255,255,.1);
}

.sb-number input::-webkit-outer-spin-button,
.sb-number input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.sb-number input[type=number] {
  -moz-appearance: textfield;
}

/* ========================================
   OPTIMISATIONS RESPONSIVE
   ======================================== */

/* Mobile */
@media (max-width: 768px) {
  /* Header */
  #header-sim-roi {
    margin-top: 0 !important;
    padding: 1rem;
  }
  
  #header-sim-roi h1 {
    font-size: 2rem !important;
    line-height: 1.3 !important;
  }
  
  #header-sim-roi p {
    font-size: 1.1rem !important;
  }
  
  /* Tabs scénarios */
  #scenarioTabs {
    padding: 0 1rem;
    align-items: center;
  }

  #assistantiabloc{
    margin: auto;
  }
  
  #scenarioTabs button {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
  }
  
  /* Assistant IA */
  .ctacont {
    width: 95% !important;
  }
  
  #assistantIA {
    padding: 1.5rem !important;
    margin: 1rem !important;
  }
  
  #assistantIA .flex {
    flex-direction: column;
  }
  
  #assistantIA input {
    margin-bottom: 0.5rem;
  }
  
  #assistantIA button {
    width: 100%;
  }
  
  /* Section automatisation */
  .lightpurpleback-cont {
    width: 95%;
  }
  
  /* Résultats */
  #resultats-sim{
    margin-bottom: 2rem;
  }

  #resultats-sim .colcont {
    flex-direction: column;
    padding: 0 1rem;
  }
  
  #resultats-sim .col6 {
    width: 100% !important;
    margin-bottom: 1rem;
  }
  
  .whiteback-full {
    padding: 1rem !important;
  }
  
  /* KPI */
  #kpi-principaux {
    flex-direction: column !important;
  }
  
  #kpi-principaux .lightpurpleback {
    margin-bottom: 1rem;
  }
  
  /* Formulaire */
  #simulatorForm .backpurple {
    padding: 1rem !important;
    font-size: 0.9rem;
  }
  
  .sb-number input {
    width: 50px !important;
    margin: 0 0.25rem 0.5rem !important;
  }
  
  /* Unit pickers mobile */
  .unit-picker {
    display: block;
    margin: 0.5rem 0;
  }
  
  .unit-options {
    left: 0;
    top: 100%;
    margin-top: 0.25rem;
  }

  #quote-form > div > div{
    grid-template-columns: 1fr !important;
  }
  
  /* Boutons */
  #exportButton,
  #quoteButton {
    font-size: 0.9rem;
  }
  
  .flex.no-print {
    flex-direction: column;
  }
  
  .flex.no-print button {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* Tablette */
@media (min-width: 768px) and (max-width: 1024px) {
  #header-sim-roi {
    padding: 2rem;
  }
  
  .ctacont {
    width: 90% !important;
  }
  
  #resultats-sim .colcont {
    padding: 0 2rem;
  }
  
  #resultats-sim .col6:first-child {
    width: 100% !important;
    margin-bottom: 2rem;
  }
  
  #resultats-sim .col6:last-child {
    width: 100% !important;
  }
  
  #kpi-principaux {
    flex-direction: row !important;
  }
}

/* ========================================
   ANIMATIONS (respect prefers-reduced-motion)
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  .unit-options,
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ========================================
   CLASSES PRINT
   ======================================== */

.print-header {
  display: none;
}

.print-footer {
  display: none;
}

@media print {
  .no-print {
    display: none !important;
  }
  
  .print-header {
    display: block !important;
  }
  
  .print-footer {
    display: block !important;
  }
}

/* ========================================
   INTÉGRATION GLOW BUTTON (depuis glow-button.css)
   ======================================== */

/* Le CSS glow-button.css est déjà chargé séparément via le frontmatter */

/* ========================================
   AJUSTEMENTS SPÉCIFIQUES INFINICY
   ======================================== */

/* Utilise les classes existantes de votre site */
#header-sim-roi.whiteback-full {
  /* Utilise déjà vos classes */
}

#assistantIA.backpurple {
  /* Utilise déjà vos classes */
}

.lightpurpleback-full {
  /* Utilise déjà vos classes */
}

/* Helper text spécifique */
#sbHelper {
  margin-top: .6rem;
  color: hsla(0,0%,100%,.75);
  font-size: .9rem;
}

/* Selects cachés pour compatibilité JS */
#simulatorForm > div[style*="height:0"] select {
  position: absolute;
  left: -9999px;
}

@media (width >= 64rem) {
    .w-45{
        width:45%;
    }

    .w-55{
        width:55%;
    }
}

/* ========================================
   CORRECTIONS POUR CHART.JS
   ======================================== */

#roiChart {
  max-width: 100%;
  height: auto !important;
}

/* === Animations === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    transform: translateY(20px); 
    opacity: 0; 
  }
  to { 
    transform: translateY(0); 
    opacity: 1; 
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Checkbox RGPD personnalisée === */
input[type="checkbox"]#rgpd-consent {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #6c62ff;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}

input[type="checkbox"]#rgpd-consent:checked {
  background: #6c62ff;
  border-color: #5b51ee;
}

input[type="checkbox"]#rgpd-consent:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

input[type="checkbox"]#rgpd-consent:focus {
  outline: 3px solid rgba(108, 98, 255, 0.3);
  outline-offset: 2px;
}

input[type="checkbox"]#rgpd-consent:hover {
  border-color: #5b51ee;
}

/* === Details/Summary styling === */
details#rgpd-details summary {
  cursor: pointer;
  user-select: none;
  padding: 0.5rem 0;
  transition: color 0.2s;
}

details#rgpd-details summary:hover {
  color: #6c62ff;
}

details#rgpd-details[open] summary {
  color: #6c62ff;
  margin-bottom: 0.5rem;
}

/* === Notification Toast === */
.notification-toast {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* === Loading states === */
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid #f3f4f6;
  border-top-color: #6c62ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

/* === Accessibility === */
[role="alert"] {
  font-weight: 500;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* === Print styles === */
@media print {
  #quote-modal,
  #result-modal,
  #loading-modal,
  .notification-toast {
    display: none !important;
  }
}