:root {
    --orangeSkip: #FF6B00;
	--orangeTide: #FB4C06;
	--orangeTang: #EA7024;
    --white: #FFFFFF;
    --black: #000000;
    --blue: #1E90FF;
	--orange_clair: #FFFFFF33; /*rgba(255, 255, 255, 0.2);#FFD699;/**/
	--red: red;
	--gray: #F8F9FA;
	--gray-1: #F0F0F0;
    --gray-light: #777777;
	--gray-2: #CCCCCC;
	--gray-3: #E9ECEF;
	--red700: #D32F2F;
	--gray80: #DDD;
}

/* === Réinitialisation de base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === Structure globale === */
body {
    font-family: Arial, sans-serif;
    background-color: var(--blue);
    color: var(--black);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 1px; /* Pour voir apparaitre le bleu sur les côtés*/
    padding: 1px;
}

/* === Conteneur principal majeur (3 colonnes) === */
.page-wrapper {
	background-color: var(--orangeSkip);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 1px;
    padding: 1px;
    /*align-items: center;*/
    justify-content: center;
}

/* Nouveau header */
/* === En-tête === */
header {
    display: flex;
	background-color: var(--orangeTide);
	color: var(--white);
	align-items: center;
	justify-content: space-between;
    height: 150px;
	padding: 0 20px;    
    padding-left: 30px; /* Logo aligné à gauche */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header img {
    max-height: 100px;
    max-width: 300px;
    object-fit: contain;
}

.header-title {
    font-size: 3em;
    color: var(--white);
    margin: 0;
    flex: 1;
    text-align: center;
    font-weight: bold;
}

.language-switcher {
    display: flex;
    gap: 8px;
    margin-left: 10px;
}

.language-switcher button {
    padding: 6px 10px;
    font-size: 0.9em;
    border: 1px solid var(--blue);
    background: white;
    color: var(--black);
    cursor: pointer;
    border-radius: 4px;
}

.language-switcher button:hover {
    background-color: var(--blue);
    color: white;
}

/* === Conteneur 3 colonnes : menu + contenu + pub droite === */
.container {
    display: flex;	
	background-color: var(--white);
    flex: 1; /* Prend tout l'espace entre header et footer */
}

/* === Menu de gauche === */
.side-menu {
    width: 250px;	
	background-color: var(--orangeSkip);
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
	/*flex-shrink: 0;  Empêche le rétrécissement */
}

.side-menu button,
.tool-buttons button {
    text-align: left;
	width: 100%;
}

/* === Boutons mobiles === */
.tool-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

/* === Contenu principal(centre) === */
/* Conteneur pub haute + zone conversion + pub basse */
.main-content {
    flex-grow: 1;
    padding: 5px;
    background-color: var(--gray-3);
    position: relative;
	border: 2px solid /*dashed*/ var(--blue);
	/*max-height: 400px;*/
	/*overflow: hidden;  ✅ Pour contenir les enfants, pas pour scroller ici */
}

/* === Layout interne pour gérer les pubs === */
.tool-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;              /* Un peu plus d'espace entre les éléments */
    padding: 10px;          /* Espace intérieur généreux */
    background-color: var(--gray);
	border: 1px dashed blue;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.tool-container {
    background-color: var(--white);    
	min-height: 300px;
    padding: 20px;
    margin-top: 20px;
	overflow-x: hidden; /* Coupe tout débordement horizontal */
}

/* === Bannières publicitaires haut et bas === */
.pub-banner-top,
.pub-banner-bottom {
    text-align: center;
    margin: 10px 0;
    padding: 10px;
    background-color: var(--gray);
    border: 1px dashed var(--gray-2);
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--gray-light);
    font-style: italic;	
}

/* === Barre latérale droite (publicité) === */
.sidebar-right {
    width: 300px;
    background-color: var(--orangeSkip);
    padding: 20px;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
	flex: 0 0 300px; /* flex-grow: 0 (ne grossit pas) flex-shrink: 0 (ne rétrécit pas) flex-basis: 300px (largeur de base) */
}

/* === Boutons === */
button {
    background-color: var(--white);
    border: 2px solid var(--blue);
    color: var(--black);
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
	border-radius: 4px;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* === Résultat de conversion === */
.copyable-result {
    cursor: pointer;
    user-select: none;
    padding: 10px;
    background-color: var(--gray);
    border-left: 4px solid var(--blue);
    border-radius: 4px;
    font-family: monospace;
    display: inline-block;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.copyable-result:hover {
    background-color: var(--gray-3);
}

.result-placeholder {
    min-height: 56px;
    display: flex;
    align-items: center;
    padding: 12px;
}

/* === Messages d'erreur === */
.error {
    color: var(--red700);
    font-weight: bold;
}

/* Style pour le compteur de conversion*/
.conversion-counter {
    font-size: 0.9em;
    color: #555;
    background-color: var(--gray-1);
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
    margin: 10px 0;
    border: 1px solid var(--gray80);
}

.conversion-counter strong {
    color: var(--blue);
    font-size: 1.1em;
}

/* === Mode avancé (toggle) === */
.advanced-toggle {
    font-size: 0.9em;
    color: #555;
}

.advanced-toggle input {
    margin-right: 6px;
}

/* === Info-bulle personnalisée === */
.info-icon {
    cursor: help;
    margin-left: 8px;
    font-size: 1.2em;
    color: var(--blue);
}

.custom-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    background: #000;
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9em;
    max-width: 300px;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.tool-interface {
    position: relative;
}

.tool-interface .info-icon:hover + .custom-tooltip {
    display: block;
}

/* === Section "En savoir plus" === */
.unit-info-section {
    margin-top: 20px;
    font-size: 0.9em;
    color: #555;
    /* Ajoute ceci */
    width: 100%;
    box-sizing: border-box;	
}

.unit-info-section summary {
    cursor: pointer;
    color: var(--blue);
    font-weight: bold;
}

.unit-info-section details[open] {
    border: 1px solid var(--gray80);
    border-radius: 8px;
    padding: 15px;
    background-color: #f9f9f9;
    margin-top: 15px;
    /* Pas de max-height ni overflow → s'étend librement */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
	/* Pas de largeur fixe */
    overflow-x: hidden; /* Empêche le scroll horizontal */
}

/* === Grille des cartes unités === */
.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	/*grid-template-columns: 1fr;*/
    gap: 15px;
    margin-top: 15px;
    /* Ajoute ceci pour éviter le débordement */
    width: 100%;
    /*max-width: 100%;*/
    padding: 0 16px; /* Léger padding intérieur, pas extérieur */
	margin: 0 auto;
    box-sizing: border-box;	
}

.unit-card {
    background: white;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    /* Empêche le débordement */
    width: 100%;
    box-sizing: border-box;
    min-width: 0; /* Très utile en grid/flex */	
    word-wrap: break-word; /* Casse les mots longs */
    overflow: hidden; /* Mais pas overflow-x: hidden ! */	
}

.unit-card h4 {
    margin: 0 0 8px 0;
    color: var(--black);
}

.unit-card p {
    margin: 5px 0;
    line-height: 1.4;
}

.input-with-history {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* ===== HISTORIQUE DES CONVERSIONS - Version stable ===== */
/* Conteneur principal des contrôles */
.history-controls {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 8px;
    font-size: 1.2em;
}

.history-controls span,
.history-controls button {
    cursor: pointer;
    color: var(--blue);
    transition: color 0.2s ease;
}

.history-controls span:hover,
.history-controls button:hover {
    color: #0055aa;
}

/* Liste déroulante de l'historique */
.history-dropdown {
    margin-top: 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    list-style: none;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 10; /* Pour être au-dessus des autres éléments */
	display: none;
}

.history-dropdown.show {
    display: block;
}

.history-dropdown li {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-family: monospace;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-dropdown li:hover {
    background-color: #f8f9fa;
}

.history-dropdown li:last-child {
    border-bottom: none;
}

/* Bouton d'effacement */
.clear-history {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1em;
}

.clear-history-btn {
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
    color: var(--blue);
    padding: 0;
    margin: 0;
}

.clear-history-btn:hover {
    color: #0055aa;
}

/* === Footer === 
footer {
    display: flex;
    background-color: var(--orangeSkip);
    color: var(--white);
    padding: 0;
	text-align: center;
}

.footer-section {
    flex: 1;
    padding: 20px;
    text-align: center;
}

.social-links {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
}

.social-links a {
    color: var(--white);
    font-size: 24px;
    transition: color 0.3s ease;
    text-decoration: none;
}

.social-links a:hover {
    color: var(--white);
}

/* ==================== 
   PROJET CITMG - En bas du footer
   ==================== */
/* ==================== 
   FOOTER - LIGNE "UN PROJET DE CITMG"
   ==================== */
   /*
.footer-bottom {
  text-align: center;
  margin-top: 1rem;
  padding: 1rem 0;
  background-color: #000; /* Fond noir pour contraster avec le footer orange *//*
  color: #ccc;
  font-size: 0.9em;
  font-style: italic;
}
.footer-bottom a {
  color: #F26522 !important; /* Orange CITMG *//*
  text-decoration: none;
  font-weight: bold;
}
.footer-bottom a:hover {
  text-decoration: underline;
  color: #d0501e !important;
}
*/

/* ==================== 
   FOOTER - STRUCTURE DE BASE
   ==================== */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  background-color: #000;
  color: #fff;
  padding: 1.5rem 2rem;
  gap: 1rem;
  text-align: center;
}

.footer-section {
  flex: 1;
  min-width: 150px;
}

.footer-section[data-i18n="footer-2"] {
  font-size: 0.9em;
  color: #ccc;
}

/* ==================== 
   RÉSEAUX SOCIAUX
   ==================== */
.social-links {
  display: flex;
  gap: 1.5rem;
  font-size: 1.3rem;
}

.social-links a {
  color: #fff;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: #F26522;
}

/* ==================== 
   "UN PROJET DE CITMG" - EN BAS, CENTRÉ
   ==================== */
.footer-bottom {
  width: 100%;
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #444;
  font-size: 0.9em;
  color: #ccc;
  font-style: italic;
}

.footer-bottom a {
  color: #F26522 !important;
  text-decoration: none;
  font-weight: bold;
}

.footer-bottom a:hover {
  text-decoration: underline;
  color: #d0501e !important;
}

/* === Responsive Design === */
/* === Responsive : réglage fin pour mobile === */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar-right {
        width: 100%;
        height: auto;
        position: static;
        margin-top: 20px;
    }

    header {
        padding-left: 20px;
    }

    header img {
        max-height: 80px;
    }

    .side-menu {
        width: 100%;
        padding: 15px;
    }

    .pub-banner-top,
    .pub-banner-bottom {
        font-size: 0.9em;
    }

    /* === CORRECTIONS CLÉS POUR LES CARDS === */

    /* 1. Conteneur principal : pas de débordement caché */
    .tool-container {
        padding: 10px;
        overflow-x: visible; /* Autorise la visibilité horizontale */
        width: 100%;
        box-sizing: border-box; /* ✅ Essentiel */
    }

    /* 2. Layout interne : évite les marges implicites */
    .tool-layout {
        padding: 10px;
        box-sizing: border-box;
    }

    /* 3. Grille : pas de padding extérieur, mais intérieur contrôlé */
    .units-grid {
        display: grid;
        grid-template-columns: 1fr; /* 1 colonne */
        gap: 12px;
        margin: 0;
        padding: 0; /* ❌ Supprime le 16px qui cause le débordement */
        width: 100%;
        box-sizing: border-box;
    }

    /* 4. Carte : s'adapte parfaitement */
    .unit-card {
        background: white;
        padding: 12px;
        border: 1px solid #eee;
        border-radius: 6px;
        box-shadow: 0 1px 5px rgba(0,0,0,0.1);
        width: 100%;
        box-sizing: border-box;
        min-width: 0;
        word-wrap: break-word;
        overflow: hidden;
        font-size: 0.95em;
    }

    /* 5. Section info : contient bien le contenu */
    .unit-info-section {
        width: 100%;
        box-sizing: border-box;
    }

    .unit-info-section details[open] {
        overflow-x: visible; /* ✅ Pas de rognage */
    }

    /* 6. Compteur */
    .conversion-counter {
        font-size: 0.9em;
        width: 100%;
        box-sizing: border-box;
    }

    /* 7. Inputs et boutons pour mobile */
    input[type="number"],
    select,
    button {
        font-size: 1em;
        padding: 12px;
    }
}

.pub-placeholder {
    font-size: 14px;
    color: #777;
    font-style: italic;
    line-height: 2;
}

/* Cette section n'a pas été modifiée*/
.tool-buttons, .side-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.seo-content {
    display: none; /* Pour éviter de saturer l'interface */
}

