/* -------------------------
   style.css
   ------------------------- */

/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Reset et variables CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --secondary-color: #ecf0f1;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --gray-light: #f8f9fa;
    --gray-medium: #e9ecef;
    --gray-dark: #6c757d;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Base */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo h1 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.8rem;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.language-selector select {
    padding: 0.5rem;
    border: 1px solid var(--gray-medium);
    border-radius: var(--border-radius);
    background: var(--white);
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.language-selector select:hover {
    border-color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #74b9ff 100%);
    color: var(--white);
    padding: 5rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s both;
}

.btn-primary {
    background: var(--white);
    color: var(--primary-color);
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    animation: fadeInUp 1s ease 0.4s both;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Converter Section */
.converter {
    padding: 4rem 0;
    background: var(--gray-light);
}

.converter-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.converter-content h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.converter-form {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

html {
  scroll-behavior: smooth;
}

#converterSection {
  scroll-margin-top: 100px; /* ou ajuste selon ton design */
}


.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--gray-medium);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group select:disabled {
    background-color: var(--gray-light);
    cursor: not-allowed;
}

.btn-convert {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 1rem;
}

.btn-convert:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-convert:disabled {
    background: var(--gray-dark);
    cursor: not-allowed;
    transform: none;
}

/* Main Content (pour about et contact) */
.main-content {
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

.page-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-content h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    text-align: center;
}

.content-section {
    margin-bottom: 2.5rem;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.content-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.content-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* Contact Page */
.contact-intro {
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gray-light);
    padding: 2rem;
    border-radius: var(--border-radius);
}

.contact-form-container {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
}

.required {
    color: #e74c3c;
}

.btn-submit {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.contact-info {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.contact-info h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.contact-details {
    display: grid;
    gap: 1.5rem;
}

.contact-item h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.contact-item p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Stats Section */
.stats {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.stats-content {
    text-align: center;
}

.stats-content h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-color);
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.stat-item {
    background: var(--white);
    padding: 2rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-description {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer */
.footer {
    background: var(--text-color);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-nav a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.footer-nav a:hover {
    color: var(--primary-color);
}

.footer-text {
    color: var(--gray-medium);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .converter-content h2 {
        font-size: 2rem;
    }
    
    .converter-form {
        padding: 1.5rem;
    }
    
    .stats-content h2 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .footer-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .contact-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .converter {
        padding: 2rem 0;
    }
    
    .stats {
        padding: 2rem 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1.5rem 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 2rem 0;
    }
    
    .content-section,
    .contact-form-container,
    .contact-info {
        padding: 1.5rem;
    }
}

/* ===== NOUVEAU SÉLECTEUR DE LANGUE ===== */

/* Container principal */
.language-selector {
    position: relative;
    display: inline-block;
}

/* Bouton de langue */
.language-btn {
    background: var(--white);
    border: 1px solid var(--gray-medium);
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    color: var(--text-color);
}

.language-btn:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.language-btn:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Menu dropdown */
.language-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--white);
    border: 1px solid var(--gray-medium);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    width: max-content;
    min-width: 500px;
    max-width: 600px;
    max-height: none;
    margin-top: 0.5rem;
    padding: 1rem;
}


.language-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Grille des langues */
.language-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: auto;
    gap: 0.5rem;
    width: 100%;
}

/* Item de langue */
.language-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  color: var(--text-color);
  background: transparent;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.language-item:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}
.lang-flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}
.language-item:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .language-menu {
        right: -10px;
        min-width: 300px;
        max-width: 90vw;
    }
    
    .language-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.3rem;
        padding: 1rem;
    }
    
    .language-item {
        padding: 0.8rem 0.3rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .language-btn {
        min-width: 100px;
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .language-menu {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(-10px);
        min-width: 280px;
    }
    
    .language-menu.active {
        transform: translateX(-50%) translateY(0);
    }
    
    .language-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .language-item {
        padding: 1rem 0.2rem;
        font-size: 0.7rem;
    }
}

/* Animation d'ouverture */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-menu.active .language-grid {
    animation: fadeInDown 0.3s ease;
}

/* Scrollbar custom pour le menu */
.language-menu::-webkit-scrollbar {
    width: 6px;
}

.language-menu::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 3px;
}

.language-menu::-webkit-scrollbar-thumb {
    background: var(--gray-medium);
    border-radius: 3px;
}

.language-menu::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
@media (max-width: 600px) {
    .language-menu {
        min-width: 90vw;
        max-width: 90vw;
        padding: 1rem;
    }

    .language-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }

    .language-item {
        font-size: 0.75rem;
        padding: 0.8rem 0.4rem;
    }
}
@media (max-width: 600px) {
    .language-menu {
        min-width: 90vw;
        max-width: 90vw;
    }

    .language-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .language-item {
        font-size: 0.75rem;
        padding: 0.8rem 0.3rem;
    }
}
.current-lang {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.current-lang .lang-flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
}
/* ===== RESPONSIVE MOBILE AMÉLIORÉ ===== */

/* Mobile Portrait (320px - 480px) */
@media (max-width: 480px) {
    /* Container et padding fixes */
    .container {
        padding: 0 15px;
    }
    
    /* Header mobile optimisé */
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 0.8rem 0;
    }
    
    .logo h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .nav {
        gap: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0;
    }
    
    /* Hero section mobile */
    .hero {
        padding: 2.5rem 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        line-height: 1.4;
    }
    
    .btn-primary {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        max-width: 280px;
    }
    
    /* Converter section mobile */
    .converter {
        padding: 2rem 0;
    }
    
    .converter-content h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
        line-height: 1.3;
    }
    
    .converter-form {
        padding: 1.2rem;
        margin: 0 10px;
    }
    
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .form-group select,
    .form-group input {
        padding: 0.8rem;
        font-size: 1rem;
        border-width: 2px;
    }
    
    .btn-convert {
        padding: 1rem;
        font-size: 1rem;
        margin-top: 1.2rem;
    }
    
    /* Stats section mobile */
    .stats {
        padding: 2rem 0;
    }
    
    .stats-content h2 {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 10px;
    }
    
    .stat-item {
        padding: 1.5rem 1rem;
        margin-bottom: 0.5rem;
    }
    
    .stat-number {
        font-size: 2.2rem;
        margin-bottom: 0.4rem;
    }
    
    .stat-description {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    /* Content pages mobile */
    .main-content {
        padding: 1.5rem 0;
    }
    
    .page-content h1 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
        line-height: 1.2;
    }
    
    .content-section {
        padding: 1.2rem;
        margin-bottom: 1.5rem;
        margin-left: 10px;
        margin-right: 10px;
    }
    
    .content-section h2 {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }
    
    .content-section p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    /* Contact page mobile */
    .contact-intro {
        padding: 1.2rem;
        margin: 0 10px 2rem 10px;
    }
    
    .contact-form-container {
        padding: 1.2rem;
        margin: 0 10px 2rem 10px;
    }
    
    .contact-info {
        padding: 1.2rem;
        margin: 0 10px;
    }
    
    /* Footer mobile */
    .footer {
        padding: 1.5rem 0;
    }
    
    .footer-nav {
        flex-direction: column;
        gap: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .footer-nav a {
        font-size: 0.9rem;
        padding: 0.3rem 0;
    }
    
    .footer-text {
        font-size: 0.8rem;
        line-height: 1.4;
        padding: 0 10px;
    }
    
    /* Language selector mobile fix */
    .language-btn {
        min-width: 110px;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .language-menu {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(-10px);
        min-width: 95vw;
        max-width: 95vw;
        margin-left: 0;
        margin-right: 0;
    }
    
    .language-menu.active {
        transform: translateX(-50%) translateY(0);
    }
    
    .language-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }
    
    .language-item {
        padding: 0.8rem 0.3rem;
        font-size: 0.75rem;
        justify-content: center;
        text-align: center;
    }
    
    .lang-flag {
        width: 18px;
        height: 13px;
    }
}

/* Mobile Landscape et petites tablettes (481px - 600px) */
@media (min-width: 481px) and (max-width: 600px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
    
    .language-menu {
        min-width: 400px;
        max-width: 85vw;
    }
    
    .language-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Très petits écrans (max 360px) */
@media (max-width: 360px) {
    .container {
        padding: 0 12px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .converter-form,
    .content-section,
    .contact-form-container,
    .contact-info {
        margin-left: 5px;
        margin-right: 5px;
        padding: 1rem;
    }
    
    .stats-grid {
        padding: 0 5px;
    }
    
    .language-menu {
        min-width: 98vw;
    }
    
    .language-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.3rem;
    }
    
    .language-item {
        padding: 1rem 0.2rem;
        font-size: 0.7rem;
        flex-direction: column;
        gap: 0.3rem;
    }
}

/* Fix pour l'espacement vertical mobile */
@media (max-width: 480px) {
    body {
        overflow-x: hidden;
    }
    
    /* Éviter les débordements horizontaux */
    * {
        max-width: 100%;
    }
    
    /* Améliorer les transitions sur mobile */
    .stat-item:hover {
        transform: none;
    }
    
    .btn-primary:hover,
    .btn-convert:hover,
    .btn-submit:hover {
        transform: none;
    }
    
    /* Touch-friendly */
    .nav-link,
    .language-item,
    .btn-primary,
    .btn-convert,
    .btn-submit {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
html, body {
  overflow-x: hidden;
}