/* ========================================
   CONVERTISSEUR RÉPUBLICAIN - CSS DÉDIÉ
======================================== */

/* ========================================
   VARIABLES DE THÈMES (CONVERTISSEUR)
======================================== */

:root {
  /* Thème par défaut (golden) */
  --primary-color: #a76107;
  --primary-light: #d4822a;
  --primary-accent: #f4a261;
  --primary-alpha: rgba(167, 97, 7, 0.3);
  
  /* Variables pour thème par défaut - CORRIGÉ POUR FIREFOX */
  --converter-bg: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  --converter-text: #ffffff;
  --input-bg: rgba(255, 255, 255, 0.08);
  --input-border: rgba(255, 255, 255, 0.15);
  --mode-toggle-bg: rgba(0,0,0,0.2);
  --result-bg: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  --convert-btn-bg: linear-gradient(135deg, #a76107 0%, #d4822a 50%, #f4a261 100%);
  --convert-btn-text: #ffffff;
}

/* Thèmes alternatifs - CORRIGÉS POUR FIREFOX */
.theme-blue {
  --primary-color: #2563eb;
  --primary-light: #3b82f6;
  --primary-accent: #60a5fa;
  --primary-alpha: rgba(37, 99, 235, 0.3);
  
  --converter-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --converter-text: #ffffff;
  --input-bg: rgba(255, 255, 255, 0.1);
  --input-border: rgba(255, 255, 255, 0.2);
  --mode-toggle-bg: rgba(0,0,0,0.2);
  --result-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --convert-btn-bg: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
  --convert-btn-text: #ffffff;
}

.theme-green {
  --primary-color: #059669;
  --primary-light: #10b981;
  --primary-accent: #34d399;
  --primary-alpha: rgba(5, 150, 105, 0.3);
  
  --converter-bg: linear-gradient(135deg, #0f1419 0%, #1c2f26 100%);
  --converter-text: #ffffff;
  --input-bg: rgba(255, 255, 255, 0.1);
  --input-border: rgba(255, 255, 255, 0.2);
  --mode-toggle-bg: rgba(0,0,0,0.2);
  --result-bg: linear-gradient(135deg, #0f1419 0%, #1c2f26 100%);
  --convert-btn-bg: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
  --convert-btn-text: #ffffff;
}

.theme-purple {
  --primary-color: #7c3aed;
  --primary-light: #8b5cf6;
  --primary-accent: #a78bfa;
  --primary-alpha: rgba(124, 58, 237, 0.3);
  
  --converter-bg: linear-gradient(135deg, #2d1b69 0%, #4c1d95 100%);
  --converter-text: #ffffff;
  --input-bg: rgba(255, 255, 255, 0.1);
  --input-border: rgba(255, 255, 255, 0.2);
  --mode-toggle-bg: rgba(0,0,0,0.2);
  --result-bg: linear-gradient(135deg, #2d1b69 0%, #4c1d95 100%);
  --convert-btn-bg: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a78bfa 100%);
  --convert-btn-text: #ffffff;
}

.theme-red {
  --primary-color: #dc2626;
  --primary-light: #ef4444;
  --primary-accent: #f87171;
  --primary-alpha: rgba(220, 38, 38, 0.3);
  
  --converter-bg: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
  --converter-text: #ffffff;
  --input-bg: rgba(255, 255, 255, 0.1);
  --input-border: rgba(255, 255, 255, 0.2);
  --mode-toggle-bg: rgba(0,0,0,0.2);
  --result-bg: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
  --convert-btn-bg: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #f87171 100%);
  --convert-btn-text: #ffffff;
}

.theme-white {
  --primary-color: #4a5568;
  --primary-light: #718096;
  --primary-accent: #a0aec0;
  --primary-alpha: rgba(74, 85, 104, 0.3);
  
  /* Variables spécifiques au thème blanc */
  --converter-bg: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  --converter-text: #2d3748;
  --input-bg: rgba(255, 255, 255, 0.9);
  --input-border: rgba(0, 0, 0, 0.15);
  --mode-toggle-bg: rgba(0,0,0,0.05);
  --result-bg: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  --convert-btn-bg: linear-gradient(135deg, #4a5568 0%, #718096 50%, #a0aec0 100%);
  --convert-btn-text: #ffffff;
}

/* ========================================
   CONVERTISSEUR RÉPUBLICAIN - DESIGN MODERNE
======================================== */

/* Masquer l'historique sur mobile */
.desktop-only {
  display: block;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
}

.converter-container {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
  border-radius: 16px;
  padding: 3px;
  box-shadow: 0 12px 30px rgba(44, 62, 80, 0.4);
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
}

.converter-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(135deg, #a76107 0%, #d4822a 50%, #f4a261 100%);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask-composite: xor;
}

.converter-card {
  background: var(--converter-bg);
  color: var(--converter-text);
  border-radius: 14px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.converter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #a76107, #d4822a, #f4a261);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Toggle des modes */
.mode-toggle {
  display: flex;
  background: var(--mode-toggle-bg);
  border-radius: 10px;
  padding: 4px;
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(167, 97, 7, 0.3);
}

.mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  color: var(--converter-text);
  opacity: 0.7;
  font-size: 0.9rem;
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-alpha);
  transform: translateY(-1px);
  opacity: 1;
}

.mode-btn:hover:not(.active) {
  background: var(--input-bg);
  color: var(--converter-text);
  opacity: 0.9;
}

.mode-icon {
  font-size: 1.2rem;
}

.mode-text {
  font-size: 0.95rem;
  font-weight: 600;
}

/* Section des inputs */
.input-section {
  margin-bottom: 2rem;
  position: relative;
}

.input-mode {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  animation: fadeIn 0.5s ease-out;
}

.input-mode.active {
  display: grid;
}

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

.input-group {
  position: relative;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--converter-text);
  opacity: 0.9;
  font-size: 0.875rem;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 0.875rem 1.125rem;
  border: 2px solid var(--input-border);
  border-radius: 12px;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--input-bg);
  color: var(--converter-text);
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.1),
    0 1px 3px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
  position: relative;
}

.input-group input::before,
.input-group select::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(167, 97, 7, 0.3), rgba(244, 162, 97, 0.2));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask-composite: xor;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: rgba(167, 97, 7, 0.6);
  box-shadow: 
    0 0 0 3px rgba(167, 97, 7, 0.2),
    inset 0 2px 6px rgba(0,0,0,0.15),
    0 4px 12px rgba(167, 97, 7, 0.15);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.input-group input:focus::before,
.input-group select:focus::before {
  opacity: 1;
}

/* Fix pour les options des selects en thème clair */
.input-group select option {
  background: #ffffff;
  color: #333333;
  padding: 0.5rem;
}

/* Amélioration spécifique du thème blanc */
.theme-white .input-group input,
.theme-white .input-group select {
  border-color: rgba(74, 85, 104, 0.3);
  color: #2d3748;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.05),
    0 1px 3px rgba(0,0,0,0.1);
}

.theme-white .input-group input:focus,
.theme-white .input-group select:focus {
  border-color: var(--primary-color);
  box-shadow: 
    0 0 0 3px var(--primary-alpha),
    inset 0 2px 6px rgba(0,0,0,0.1),
    0 4px 12px var(--primary-alpha);
}

.theme-white .input-group label {
  color: #2d3748;
}

.theme-white .mode-btn {
  color: #4a5568;
  border-color: rgba(74, 85, 104, 0.2);
}

.theme-white .mode-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.theme-white .mode-toggle {
  border-color: rgba(74, 85, 104, 0.3);
  background: rgba(248, 249, 250, 0.8);
}

.theme-white .result-card {
  color: #2d3748;
  box-shadow: 
    0 12px 30px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.theme-white .result-content {
  color: var(--primary-color);
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(74, 85, 104, 0.3);
}

.theme-white .result-title,
.theme-white .result-extra {
  color: #2d3748;
}

.theme-white .settings-toggle {
  background: rgba(74, 85, 104, 0.1);
  border-color: rgba(74, 85, 104, 0.3);
  color: #2d3748;
}

.theme-white .settings-toggle:hover {
  background: rgba(74, 85, 104, 0.15);
  border-color: rgba(74, 85, 104, 0.4);
}

/* Correction historique thème blanc */
.theme-white .history-title {
  color: #2d3748;
}

.theme-white .history-item {
  background: rgba(74, 85, 104, 0.05);
  border-color: rgba(74, 85, 104, 0.2);
  color: #2d3748;
}

.theme-white .history-item-content,
.theme-white .history-item-result {
  color: #2d3748;
}

.theme-white .history-item-arrow {
  color: var(--primary-color);
}

.theme-white .history-empty {
  color: #718096;
}

.theme-white .clear-btn {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
  color: #dc2626;
}

.theme-white .history-section {
  border-top-color: rgba(74, 85, 104, 0.3);
}

/* Amélioration des flèches de select */
.input-group select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 3rem;
}

/* Mobile dropdown fix - ensure dropdowns don't overflow screen */
@media (max-width: 768px) {
  .input-group select {
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px; /* Prevents zoom on iOS */
    position: static; /* Évite les repositionnements */
    z-index: auto;
    /* Désactive les transitions sur mobile pour éviter les tremblements */
    transition: none !important;
    transform: none !important;
  }
  
  /* Enhanced mobile dropdown behavior */
  .input-group {
    position: static;
    z-index: auto;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    /* Désactive les transitions sur les conteneurs */
    transition: none !important;
    transform: none !important;
  }
  
  .input-group select:focus {
    z-index: auto;
    position: static;
    /* Empêche les changements visuels au focus */
    transition: none !important;
    transform: none !important;
    box-shadow: none !important;
    border-color: rgba(167, 97, 7, 0.6) !important;
  }
  
  /* Force native mobile dropdown avec styles simplifiés */
  .input-group select {
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    appearance: menulist;
    background-image: none;
    padding-right: 1rem;
    /* Supprime tous les effets visuels complexes */
    backdrop-filter: none !important;
    mask: none !important;
    -webkit-mask: none !important;
  }
  
  /* Retire les pseudo-éléments qui peuvent causer des problèmes */
  .input-group input::before,
  .input-group select::before {
    display: none !important;
  }
  
  /* Container overflow management avec styles simplifiés */
  .input-mode {
    overflow: visible;
    position: static;
  }
  
  .converter-card {
    overflow: visible;
    position: static;
  }
  
  .converter-container {
    overflow: visible;
    position: static;
    /* Supprime la bordure dorée problématique sur mobile */
    background: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  
  .converter-container::before {
    display: none !important;
  }
  
  /* Simplifie la carte du convertisseur sur mobile */
  .converter-card {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    margin: 0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
  }
  
  .converter-card::before {
    display: none !important;
  }
}

.input-group input::placeholder {
  color: #9ca3af;
  font-style: italic;
}

/* Bouton de conversion */
.convert-section {
  text-align: center;
  margin-bottom: 2rem;
}

.convert-btn {
  background: var(--convert-btn-bg);
  color: var(--convert-btn-text);
  border: none;
  padding: 1.125rem 3rem;
  border-radius: 60px;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 8px 25px var(--primary-alpha),
    0 0 0 0 var(--primary-alpha),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.convert-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s ease;
}

.convert-btn:hover::before {
  left: 100%;
}

.convert-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 15px 40px var(--primary-alpha),
    0 0 0 8px var(--primary-alpha),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.convert-btn:active {
  transform: translateY(-1px) scale(0.98);
  transition: all 0.1s ease;
}

.convert-icon {
  font-size: 1.3rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ========================================
   BOUTON PARAMÈTRES
======================================== */

.settings-toggle {
  position: absolute;
  top: +0.45rem;
  right: 0.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.settings-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.settings-gear {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.settings-toggle:hover .settings-gear {
  transform: rotate(90deg);
}

/* ========================================
   MODAL DE PERSONNALISATION
======================================== */

.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(5px);
  }
}

.settings-modal-content {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  border-radius: 16px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
  border: 2px solid rgba(167, 97, 7, 0.3);
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.settings-modal-header {
  background: linear-gradient(135deg, #a76107 0%, #d4822a 100%);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}

.settings-modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.close-modal-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
}

.close-modal-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.settings-modal-body {
  padding: 2rem;
  color: white;
  overflow-y: auto;
  max-height: calc(80vh - 90px);
}

/* ========================================
   PANNEAU DE PERSONNALISATION (LEGACY)
======================================== */

.settings-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  cursor: pointer;
}

.settings-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.settings-icon {
  font-size: 1.1rem;
}

.settings-toggle-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.settings-toggle-btn.open .toggle-icon {
  transform: rotate(180deg);
}

.toggle-icon {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.settings-content {
  padding: 1rem 0;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.setting-group {
  margin-bottom: 1.5rem;
}

.setting-label {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

/* Thèmes de couleur */
.theme-options {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.theme-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.theme-btn:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.theme-btn.active {
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.theme-preview {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

/* Taille de police */
.font-size-options {
  display: flex;
  gap: 0.5rem;
}

.font-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.font-btn[data-size="small"] {
  font-size: 0.8rem;
}

.font-btn[data-size="normal"] {
  font-size: 1rem;
}

.font-btn[data-size="large"] {
  font-size: 1.2rem;
}

.font-btn[data-size="extra-large"] {
  font-size: 1.4rem;
}

.font-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.font-btn.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Toggle animations */
.animation-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #4ade80;
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

/* Bouton reset */
.reset-btn {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: #ef4444;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.reset-btn:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.5);
}

.reset-icon {
  font-size: 1rem;
}

/* ========================================
   HISTORIQUE DES CONVERSIONS INTÉGRÉ
======================================== */

.history-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.history-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.history-icon {
  font-size: 1.1rem;
}

.clear-btn {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-btn:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.5);
  transform: scale(1.05);
}

.clear-icon {
  font-size: 1rem;
}

.history-content {
  height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 97, 7, 0.5) transparent;
}

.history-content::-webkit-scrollbar {
  width: 4px;
}

.history-content::-webkit-scrollbar-track {
  background: transparent;
}

.history-content::-webkit-scrollbar-thumb {
  background: rgba(167, 97, 7, 0.5);
  border-radius: 2px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(255, 255, 255, 0.6);
}

.empty-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.history-empty p {
  margin: 0;
  font-size: 0.9rem;
  font-style: italic;
}

.history-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  animation: slideInHistory 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(167, 97, 7, 0.3);
}

@keyframes slideInHistory {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.history-item-type {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.history-item-content {
  color: #ffffff;
  font-weight: 500;
  font-size: 0.85rem;
  flex: 1;
  min-width: 0;
}

.history-item-arrow {
  color: rgba(167, 97, 7, 0.8);
  font-weight: bold;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.history-item-result {
  color: #f4a261;
  font-size: 0.85rem;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  text-align: right;
}

/* ========================================
   SECTION DESCRIPTION CALENDRIER
======================================== */

.calendar-description {
  background: linear-gradient(135deg, rgba(167, 97, 7, 0.05) 0%, rgba(244, 162, 97, 0.05) 100%);
  border-radius: 16px;
  padding: 2rem;
  margin: 3rem auto;
  border: 1px solid rgba(167, 97, 7, 0.1);
  box-shadow: 0 4px 12px rgba(167, 97, 7, 0.1);
}

.calendar-description h3 {
  color: var(--text-main, #333);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.calendar-description p {
  color: var(--text-main, #333);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.calendar-description p:last-child {
  margin-bottom: 0;
}

.calendar-description strong {
  color: var(--text-main, #333);
  font-weight: 700;
}

/* Section résultats - CORRIGÉE POUR FIREFOX */
.result-section {
  animation: slideUp 0.5s ease-out;
}

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

.result-card {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
  color: #ffffff !important;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  position: relative;
  margin-top: 1.5rem;
  backdrop-filter: blur(15px);
  box-shadow: 
    0 12px 30px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Suppression du ::before problématique sur Firefox */
.result-card::before {
  display: none !important;
}

.result-card::after {
  content: '✨';
  position: absolute;
  top: -10px;
  left: 20px;
  background: linear-gradient(135deg, #a76107 0%, #d4822a 100%);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(167, 97, 7, 0.3);
  z-index: 1;
}

.close-result-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  z-index: 2;
}

.close-result-btn:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.5);
  transform: scale(1.1);
}

.copy-result-btn {
  position: absolute;
  top: 0.75rem;
  right: 3.25rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  z-index: 2;
}

.copy-result-btn:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
  transform: scale(1.1);
}

.copy-result-btn.copied {
  background: rgba(34, 197, 94, 0.3);
  border-color: rgba(34, 197, 94, 0.6);
}

.copy-icon {
  font-size: 0.9rem;
}

.close-icon {
  font-size: 0.9rem;
  font-weight: bold;
}

.result-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff !important;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.result-content {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f4a261 !important;
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px;
  border: 1px solid rgba(167, 97, 7, 0.3);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.result-extra {
  font-size: 0.85rem;
  color: #ffffff !important;
  opacity: 0.7;
  font-style: italic;
}

/* Section erreurs */
.error-section {
  animation: shake 0.5s ease-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.error-card {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 2px solid #ef4444;
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.error-icon {
  font-size: 1.5rem;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.error-message {
  color: #dc2626;
  font-weight: 600;
}

/* Convert-section positionnement */
.convert-section{
  position:relative;
  display:flex;
  justify-content:center;   /* centre Convertir seul */
  align-items:center;
}

/* Bouton nettoyage */
.reset-icon-btn{
  /* On garde toutes les règles définies pour .clear-btn
     (fond rouge, bordure, etc.) : NE PAS redéfinir background/border ! */

  position:absolute;
  right:0;                      /* extrême droite */
  top:50%;
  transform:translateY(-50%);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0.5rem 0.5rem;       /* un peu plus petit que Clear historique */
  font-size:1.1rem;             /* icône légèrement plus grande */
}

/* Petit effet hover cohérent */
.reset-icon-btn:hover{
  transform:translateY(-50%) scale(1.08);
}

/* Responsive design */
@media (max-width: 768px) {
  .converter-section {
    padding: 0 1rem;
    margin: 2rem auto;
  }
  
  .converter-card {
    padding: 1rem;
  }
  
  .input-mode {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .mode-btn {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .mode-icon {
    font-size: 1.1rem;
  }
  
  .mode-text {
    font-size: 0.75rem;
    line-height: 1.2;
  }
  
  .convert-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }
  
  .result-content {
    font-size: 1.1rem;
    padding: 0.75rem;
  }
  
  .result-extra {
    font-size: 0.8rem;
  }
  
  /* Description section mobile */
  .calendar-description {
    margin: 2rem auto;
    padding: 1.5rem;
    border-radius: 12px;
  }
  
  .calendar-description h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  .calendar-description p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
  }
}

@media (max-width: 480px) {
  .converter-section {
    max-width: 100%;
    margin: 1rem auto;
    padding: 0 0.75rem;
  }
  
  .converter-container {
    margin: 0;
    border-radius: 8px;
  }
  
  .converter-card {
    padding: 0.75rem;
    border-radius: 6px;
  }
  
  .mode-toggle {
    margin-bottom: 1rem;
  }
  
  .mode-btn {
    padding: 0.625rem 0.25rem;
    font-size: 0.8rem;
  }
  
  .mode-text {
    font-size: 0.7rem;
  }
  
  .input-section {
    margin-bottom: 1rem;
  }
  
  .input-mode {
    gap: 0.75rem;
  }
  
  .input-group label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
  }
  
  .input-group input,
  .input-group select {
    padding: 0.625rem 0.75rem;
    font-size: 0.9rem;
  }
  
  .convert-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    gap: 0.5rem;
  }
  
  .convert-icon {
    font-size: 1.1rem;
  }
  
  .result-card {
    padding: 1rem;
  }
  
  .result-content {
    font-size: 1rem;
    padding: 0.625rem;
  }
  
  .result-title {
    font-size: 0.9rem;
  }
  
  .result-extra {
    font-size: 0.75rem;
  }
  
  .error-card {
    padding: 1rem;
    font-size: 0.85rem;
  }
  
  /* Description section small mobile */
  .calendar-description {
    margin: 1.5rem auto;
    padding: 1rem;
    border-radius: 8px;
  }
  
  .calendar-description h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .calendar-description p {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
  }
}

/* Très petits écrans */
@media (max-width: 320px) {
  .converter-section {
    padding: 0 0.5rem;
  }
  
  .converter-card {
    padding: 0.5rem;
  }
  
  .mode-btn {
    padding: 0.5rem 0.125rem;
    font-size: 0.75rem;
  }
  
  .mode-text {
    font-size: 0.65rem;
  }
  
  .input-group input,
  .input-group select {
    padding: 0.5rem 0.625rem;
    font-size: 0.85rem;
  }
  
  .convert-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  
  /* Description section very small mobile */
  .calendar-description {
    margin: 1rem auto;
    padding: 0.75rem;
  }
  
  .calendar-description h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
  }
  
  .calendar-description p {
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
  }
}