/**
 * Habilec Light theme for reveal.js
 * Design inspiré de Habilec 7 - Formation IRVE
 * Couleurs orange/crème, fond clair, typographie professionnelle
 */

html * {
  color-profile: sRGB;
  rendering-intent: auto;
}

/*********************************************
 * VARIABLES HABILEC
 *********************************************/
:root {
  /* Couleurs principales Habilec */
  --hab-primary: #f59e0b;
  --hab-primary-dark: #d97706;
  --hab-primary-light: #fbbf24;
  --hab-secondary: #1e3a5f;
  --hab-accent: #ea580c;

  /* Fonds */
  --hab-bg-light: #f8f9fa;
  --hab-bg-cream: #fffdf7;
  --hab-bg-white: #ffffff;
  --hab-bg-slide: linear-gradient(135deg, #ffffff 0%, #fef7ed 100%);

  /* Textes */
  --hab-text-dark: #1f2937;
  --hab-text-medium: #4b5563;
  --hab-text-light: #6b7280;

  /* Variables Reveal.js - Tailles ajustées pour mode sans scaling */
  --r-background-color: #f8f9fa;
  --r-main-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --r-main-font-size: 20px;
  --r-main-color: #1f2937;
  --r-block-margin: 12px;
  --r-heading-margin: 0 0 16px 0;
  --r-heading-font: 'Outfit', 'Inter', sans-serif;
  --r-heading-color: #1e3a5f;
  --r-heading-line-height: 1.15;
  --r-heading-letter-spacing: -0.02em;
  --r-heading-text-transform: none;
  --r-heading-text-shadow: none;
  --r-heading-font-weight: 700;
  --r-heading1-text-shadow: none;
  --r-heading1-size: 1.8em;
  --r-heading2-size: 1.5em;
  --r-heading3-size: 1.25em;
  --r-heading4-size: 1.1em;
  --r-code-font: 'Fira Code', 'JetBrains Mono', Consolas, monospace;
  --r-link-color: #f59e0b;
  --r-link-color-dark: #d97706;
  --r-link-color-hover: #ea580c;
  --r-selection-background-color: rgba(245, 158, 11, 0.3);
  --r-selection-color: #1f2937;
  --r-overlay-element-bg-color: 255, 255, 255;
  --r-overlay-element-fg-color: 31, 41, 55;

  /* Couleurs additionnelles */
  --r-bold-color: #ea580c;
  --r-italic-color: #1e3a5f;
  --r-inline-code-color: #d97706;
  --r-list-bullet-color: #f59e0b;
}

/*********************************************
 * GLOBAL STYLES
 *********************************************/
.reveal-viewport {
  background: var(--hab-bg-light);
  background-color: var(--r-background-color);
}

.reveal {
  font-family: var(--r-main-font);
  font-size: var(--r-main-font-size);
  font-weight: 400;
  color: var(--r-main-color);
}

.reveal ::selection {
  color: var(--r-selection-color);
  background: var(--r-selection-background-color);
  text-shadow: none;
}

.reveal ::-moz-selection {
  color: var(--r-selection-color);
  background: var(--r-selection-background-color);
  text-shadow: none;
}

.reveal .slides section,
.reveal .slides section > section {
  line-height: 1.5;
  font-weight: inherit;
}

/* Fond de slide avec dégradé subtil - Mode LARGE responsive */
.reveal .slides section {
  background: var(--hab-bg-slide);
  border-radius: 12px;
  padding: 20px 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  /* Largeur maximale - pas de limite */
  width: 100%;
  max-width: none;
  margin: 0 auto;
  text-align: left;
}

/*********************************************
 * HEADERS
 *********************************************/
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
  margin: var(--r-heading-margin);
  color: var(--r-heading-color);
  font-family: var(--r-heading-font);
  font-weight: var(--r-heading-font-weight);
  line-height: var(--r-heading-line-height);
  letter-spacing: var(--r-heading-letter-spacing);
  text-transform: var(--r-heading-text-transform);
  text-shadow: var(--r-heading-text-shadow);
  word-wrap: break-word;
}

.reveal h1 {
  font-size: var(--r-heading1-size);
  background: linear-gradient(135deg, var(--hab-secondary) 0%, var(--hab-primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* Éviter les retours à la ligne si possible */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Si le titre est vraiment trop long, permettre le wrap */
.reveal h1.wrap-title {
  white-space: normal;
}

.reveal h2 {
  font-size: var(--r-heading2-size);
  color: var(--hab-secondary);
  border-bottom: 3px solid var(--hab-primary);
  padding-bottom: 12px;
  display: inline-block;
  /* Éviter les retours à la ligne */
  white-space: nowrap;
  max-width: 100%;
}

/* Permettre le wrap sur h2 si nécessaire */
.reveal h2.wrap-title {
  white-space: normal;
}

.reveal h3 {
  font-size: var(--r-heading3-size);
  color: var(--hab-primary-dark);
}

.reveal h4 {
  font-size: var(--r-heading4-size);
  color: var(--hab-text-medium);
  font-weight: 600;
}

.reveal h1:last-child,
.reveal h2:last-child,
.reveal h3:last-child,
.reveal h4:last-child,
.reveal h5:last-child,
.reveal h6:last-child {
  margin-bottom: 0;
}

/*********************************************
 * PARAGRAPHES & TEXTE
 *********************************************/
.reveal p {
  margin: var(--r-block-margin) 0;
  line-height: 1.6;
  color: var(--hab-text-dark);
}

.reveal strong,
.reveal b {
  font-weight: 700;
  color: var(--r-bold-color);
}

.reveal em,
.reveal i {
  font-style: italic;
  color: var(--r-italic-color);
}

.reveal blockquote {
  display: block;
  position: relative;
  width: 85%;
  margin: var(--r-block-margin) auto;
  padding: 20px 30px;
  font-style: italic;
  background: linear-gradient(135deg, #fff9f0 0%, #fffbeb 100%);
  border-left: 5px solid var(--hab-primary);
  border-radius: 0 12px 12px 0;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.15);
  color: var(--hab-text-medium);
}

.reveal blockquote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 15px;
  font-size: 60px;
  color: var(--hab-primary);
  opacity: 0.3;
  font-family: Georgia, serif;
}

.reveal blockquote p:first-child,
.reveal blockquote p:last-child {
  display: inline-block;
}

/*********************************************
 * LISTES
 *********************************************/
.reveal ol,
.reveal dl,
.reveal ul {
  display: inline-block;
  text-align: left;
  margin: 0 0 0 1.5em;
}

.reveal ol {
  list-style-type: decimal;
}

.reveal ul {
  list-style-type: none;
}

.reveal ul li {
  position: relative;
  padding-left: 1.2em;
  margin-bottom: 0.35em;
  line-height: 1.4;
}

.reveal ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--hab-primary) 0%, var(--hab-primary-dark) 100%);
  border-radius: 2px;
  transform: rotate(45deg);
}

.reveal ul ul li::before {
  width: 6px;
  height: 6px;
  background: var(--hab-primary-light);
  border-radius: 50%;
  transform: none;
}

.reveal ul ul ul li::before {
  width: 5px;
  height: 5px;
  background: transparent;
  border: 2px solid var(--hab-primary);
}

.reveal ul ul,
.reveal ul ol,
.reveal ol ol,
.reveal ol ul {
  display: block;
  margin-left: 40px;
}

.reveal ol li::marker {
  color: var(--hab-primary);
  font-weight: 700;
}

.reveal dt {
  font-weight: bold;
  color: var(--hab-secondary);
}

.reveal dd {
  margin-left: 40px;
  color: var(--hab-text-medium);
}

/*********************************************
 * CODE
 *********************************************/
.reveal pre {
  display: block;
  position: relative;
  width: 90%;
  margin: var(--r-block-margin) auto;
  text-align: left;
  font-size: 0.55em;
  font-family: var(--r-code-font);
  line-height: 1.4em;
  word-wrap: break-word;
  color: #e2e8f0;
  background: #1e293b;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.reveal code {
  font-family: var(--r-code-font);
  text-transform: none;
  tab-size: 2;
  color: var(--r-inline-code-color);
  background: rgba(245, 158, 11, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.reveal pre code {
  display: block;
  padding: 10px;
  overflow: auto;
  max-height: 450px;
  word-wrap: normal;
  color: #e2e8f0;
  background: transparent;
}

.reveal .code-wrapper {
  white-space: normal;
}

.reveal .code-wrapper code {
  white-space: pre;
}

/*********************************************
 * TABLEAUX - Compacts pour mode sans scaling
 *********************************************/
.reveal table {
  margin: auto;
  border-collapse: collapse;
  border-spacing: 0;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  font-size: 0.85em;
  width: 100%;
}

.reveal table th {
  font-weight: 700;
  background: linear-gradient(135deg, var(--hab-primary) 0%, var(--hab-primary-dark) 100%);
  color: white;
  text-transform: uppercase;
  font-size: 0.8em;
  letter-spacing: 0.04em;
}

.reveal table th,
.reveal table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.reveal table tbody tr:nth-child(even) {
  background: #fef7ed;
}

.reveal table tbody tr:hover {
  background: #fff7e6;
}

.reveal table th[align=center],
.reveal table td[align=center] {
  text-align: center;
}

.reveal table th[align=right],
.reveal table td[align=right] {
  text-align: right;
}

.reveal table tbody tr:last-child th,
.reveal table tbody tr:last-child td {
  border-bottom: none;
}

/*********************************************
 * IMAGES & MEDIA
 *********************************************/
.reveal img,
.reveal video,
.reveal iframe {
  max-width: 95%;
  max-height: 95%;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.reveal img {
  margin: var(--r-block-margin) 0;
}

.reveal sup {
  vertical-align: super;
  font-size: smaller;
}

.reveal sub {
  vertical-align: sub;
  font-size: smaller;
}

.reveal small {
  display: inline-block;
  font-size: 0.6em;
  line-height: 1.2em;
  vertical-align: top;
  color: var(--hab-text-light);
}

.reveal small * {
  vertical-align: top;
}

/*********************************************
 * LIENS
 *********************************************/
.reveal a {
  color: var(--r-link-color);
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.reveal a:hover {
  color: var(--r-link-color-hover);
  border-bottom-color: var(--r-link-color-hover);
  text-shadow: none;
}

.reveal .roll span:after {
  color: #fff;
  background: var(--r-link-color-dark);
}

/*********************************************
 * CADRES
 *********************************************/
.reveal .r-frame {
  border: 4px solid var(--hab-primary);
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.reveal a .r-frame {
  transition: all 0.2s ease;
}

.reveal a:hover .r-frame {
  border-color: var(--hab-accent);
  box-shadow: 0 0 25px rgba(234, 88, 12, 0.3);
}

/*********************************************
 * CONTROLES DE NAVIGATION
 *********************************************/
.reveal .controls {
  color: var(--hab-primary);
}

.reveal .controls button {
  transition: all 0.2s ease;
}

.reveal .controls button:hover {
  color: var(--hab-accent);
  transform: scale(1.1);
}

/*********************************************
 * BARRE DE PROGRESSION
 *********************************************/
.reveal .progress {
  background: rgba(245, 158, 11, 0.2);
  color: var(--hab-primary);
  height: 5px;
}

.reveal .progress span {
  background: linear-gradient(90deg, var(--hab-primary) 0%, var(--hab-accent) 100%);
  border-radius: 0 3px 3px 0;
}

/*********************************************
 * NUMERO DE SLIDE
 *********************************************/
.reveal .slide-number {
  background: linear-gradient(135deg, var(--hab-primary) 0%, var(--hab-primary-dark) 100%);
  color: white;
  font-family: var(--r-main-font);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

/*********************************************
 * FRAGMENTS
 *********************************************/
.reveal .slides section .fragment {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  will-change: opacity, transform;
}

.reveal .slides section .fragment.visible {
  opacity: 1;
  visibility: visible;
}

.reveal .slides section .fragment.fade-up {
  transform: translateY(30px);
}

.reveal .slides section .fragment.fade-up.visible {
  transform: translateY(0);
}

.reveal .slides section .fragment.highlight-orange {
  opacity: 1;
  visibility: visible;
}

.reveal .slides section .fragment.highlight-orange.visible {
  color: var(--hab-primary);
  font-weight: 600;
}

/*********************************************
 * CLASSES SPECIALES IRVE
 *********************************************/

/* Encadré important */
.reveal .important-box {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 5px solid var(--hab-primary);
  border-radius: 0 12px 12px 0;
  padding: 20px 25px;
  margin: 20px 0;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
}

.reveal .important-box::before {
  content: '⚠️';
  font-size: 1.2em;
  margin-right: 10px;
}

/* Encadré info */
.reveal .info-box {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border-left: 5px solid #0ea5e9;
  border-radius: 0 12px 12px 0;
  padding: 20px 25px;
  margin: 20px 0;
}

.reveal .info-box::before {
  content: 'ℹ️';
  font-size: 1.2em;
  margin-right: 10px;
}

/* Encadré succès */
.reveal .success-box {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-left: 5px solid #10b981;
  border-radius: 0 12px 12px 0;
  padding: 20px 25px;
  margin: 20px 0;
}

.reveal .success-box::before {
  content: '✅';
  font-size: 1.2em;
  margin-right: 10px;
}

/* Encadré danger */
.reveal .danger-box {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-left: 5px solid #ef4444;
  border-radius: 0 12px 12px 0;
  padding: 20px 25px;
  margin: 20px 0;
}

.reveal .danger-box::before {
  content: '⛔';
  font-size: 1.2em;
  margin-right: 10px;
}

/* Modes de charge IRVE */
.reveal .mode-charge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  margin: 5px;
}

.reveal .mode-1 { background: #fef3c7; color: #92400e; }
.reveal .mode-2 { background: #dbeafe; color: #1e40af; }
.reveal .mode-3 { background: #d1fae5; color: #065f46; }
.reveal .mode-4 { background: #fce7f3; color: #9d174d; }

/* Icônes de connecteurs */
.reveal .connector-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--hab-primary) 0%, var(--hab-primary-dark) 100%);
  color: white;
  border-radius: 12px;
  font-size: 28px;
  margin: 10px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

/* Schéma technique */
.reveal .technical-schema {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Comparaison deux colonnes */
.reveal .comparison {
  display: flex;
  gap: 30px;
  margin: 20px 0;
}

.reveal .comparison > div {
  flex: 1;
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.reveal .comparison .pros {
  border-top: 4px solid #10b981;
}

.reveal .comparison .cons {
  border-top: 4px solid #ef4444;
}

/*********************************************
 * SLIDE DE TITRE
 *********************************************/
.reveal section.title-slide {
  background: linear-gradient(135deg, var(--hab-secondary) 0%, #0f172a 100%);
}

.reveal section.title-slide h1,
.reveal section.title-slide h2 {
  color: white;
  -webkit-text-fill-color: white;
  border: none;
}

.reveal section.title-slide h1 {
  font-size: 3.2em;
  margin-bottom: 30px;
}

.reveal section.title-slide h2 {
  color: var(--hab-primary-light);
  font-size: 1.5em;
  font-weight: 400;
}

.reveal section.title-slide p {
  color: rgba(255, 255, 255, 0.8);
}

/*********************************************
 * SLIDE DE FIN
 *********************************************/
.reveal section.end-slide {
  background: linear-gradient(135deg, var(--hab-primary) 0%, var(--hab-accent) 100%);
}

.reveal section.end-slide h1,
.reveal section.end-slide h2,
.reveal section.end-slide p {
  color: white;
  -webkit-text-fill-color: white;
}

/*********************************************
 * ANIMATIONS
 *********************************************/
@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.reveal .slides section.present {
  animation: fadeInScale 0.5s ease-out;
}

/*********************************************
 * PRINT
 *********************************************/
@media print {
  .backgrounds {
    background-color: white;
  }

  .reveal .slides section {
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }
}

/*********************************************
 * RESPONSIVE
 *********************************************/
@media screen and (max-width: 900px) {
  :root {
    --r-main-font-size: 32px;
    --r-heading1-size: 2.2em;
    --r-heading2-size: 1.6em;
  }

  .reveal .slides section {
    padding: 30px 35px;
  }
}

@media screen and (max-width: 600px) {
  :root {
    --r-main-font-size: 26px;
    --r-heading1-size: 1.8em;
    --r-heading2-size: 1.4em;
  }

  .reveal .slides section {
    padding: 20px 25px;
  }

  .reveal .comparison {
    flex-direction: column;
  }
}
