/* Reset et styles globaux */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex: 1;
}

/* Navigation */
nav {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-nav {
    font-size: 1.25rem;
    font-weight: 680;
    color: #667eea;
    cursor: pointer;
    user-select: none;
	display: flex;
    /*align-items: center;*/
    gap: 0.35rem;
}

.nav-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.newsletter-btn,
.home-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.95rem;
    -webkit-tap-highlight-color: transparent;
}

.newsletter-btn:hover,
.home-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.newsletter-btn:active,
.home-btn:active {
    transform: translateY(0);
}

#languageSelect {
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
    min-width: 120px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

#languageSelect:hover {
    border-color: #5568d3;
}

#languageSelect:focus {
    border-color: #5568d3;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Hero section (home.html) */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.5rem);
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.redirect-store-btn {
	display: inline-block;
	padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.95rem;
    -webkit-tap-highlight-color: transparent;
	margin-top: 1rem;
}

.redirect-store-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.redirect-store-btn:active {
    transform: translateY(0);
}

/* Sections de contenu */
.content-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin-top: 2rem;
}

.content-section h2 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: clamp(1rem, 4vw, 1.5rem);
}

.content-section p {
    color: #555;
    line-height: 1.8;
    font-size: clamp(0.5rem, 2vw, 1rem);
}

/* Newsletter header (newsletters.html) */
.newsletter-header {
    text-align: center;
    padding: 2rem 0 3rem 0;
}

.newsletter-header h1 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: #333;
    margin-bottom: 1rem;
}

.newsletter-header p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: #666;
}

/* Newsletter list */
.newsletter-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.newsletter-item {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
    -webkit-tap-highlight-color: transparent;
}

.newsletter-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(102, 126, 234, 0.2);
}

.newsletter-item:active {
    transform: translateY(-2px);
}

.newsletter-item.latest {
    border: 2px solid #667eea;
    position: relative;
    padding-top: 2rem;
}

.newsletter-item.latest::before {
    content: attr(data-latest-label);
    position: absolute;
    top: -12px;
    left: 20px;
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.newsletter-date {
    color: #667eea;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.newsletter-title {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: #333;
    margin-bottom: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
}

.newsletter-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: clamp(0.95rem, 2vw, 1rem);
}

.read-more {
    color: #667eea;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.read-more:hover {
    gap: 0.8rem;
}

.read-more::after {
    content: '→';
    font-size: 1.2rem;
}

/* Footer */
footer {
    background: white;
    padding: 1.2rem;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    margin-top: auto;
}

footer p {
    color: #666;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    line-height: 1.5;
}

footer p strong {
    color: #667eea;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* pour s'adapter aux petits écrans */
    gap: 0.6rem;
    color: #666;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    line-height: 1.5;
    margin: 0;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #5568d3;
    text-decoration: underline;
}

.footer-links .separator {
    color: #666;
    opacity: 0.4;
    margin: 0;
    user-select: none;
}

/* Splash screen (index.html) */
.splash-body {
    background: #f5f5f5 /*linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 1rem;
}

.splash-logo {
    width: 400px;
    height: auto;
    transition: transform 0.4s ease;
}

.splash-logo:hover {
    transform: scale(1.05);
}

/* Animation pour chaque polygone */
.splash-logo polygon {
    opacity: 0;
    animation: slideInFade 0.8s ease-out forwards;
}

/* Délais séquentiels pour chaque élément */
.splash-logo polygon:nth-child(1) { animation-delay: 0.1s; }
.splash-logo polygon:nth-child(2) { animation-delay: 0.2s; }
.splash-logo g:nth-child(4) polygon:nth-child(1) { animation-delay: 0.3s; }
.splash-logo g:nth-child(4) polygon:nth-child(2) { animation-delay: 0.4s; }
.splash-logo g:nth-child(4) polygon:nth-child(3) { animation-delay: 0.5s; }
.splash-logo polygon:nth-child(5) { animation-delay: 0.6s; }
.splash-logo polygon:nth-child(6) { animation-delay: 0.7s; }
.splash-logo polygon:nth-child(7) { animation-delay: 0.8s; }
.splash-logo polygon:nth-child(8) { animation-delay: 0.9s; }
.splash-logo polygon:nth-child(9) { animation-delay: 1.0s; }
.splash-logo polygon:nth-child(10) { animation-delay: 1.1s; }
.splash-logo polygon:nth-child(11) { animation-delay: 1.2s; }
.splash-logo polygon:nth-child(12) { animation-delay: 1.3s; }

@keyframes slideInFade {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Variante pour certains éléments venant du bas */
.splash-logo polygon:nth-child(even) {
    animation-name: slideInFadeUp;
}

@keyframes slideInFadeUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation de rotation douce au survol */
.splash-logo:hover g {
    animation: gentleRotate 3s ease-in-out infinite;
}

@keyframes gentleRotate {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(5deg); }
}

/* Ombre portée qui apparaît après l'animation */
.splash-logo.show-shadow {
    /* filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: shadowFadeIn 0.3s ease-out forwards;  */
}

@keyframes shadowFadeIn {
    from {
        filter: drop-shadow(0 0px 0px rgba(0, 0, 0, 0));
    }
    to {
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    }
}

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

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

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

/* Responsive - Tablettes */
@media (max-width: 768px) {
    nav {
        padding: 1rem;
        /* justify-content: center; */
    }
    
    .logo-nav {
        font-size: 1.3rem;
        /* width: 100%;
        text-align: center;
        margin-bottom: 0.5rem; */
    }
    
    .nav-controls {
        /* width: 100%; */
        justify-content: center;
        gap: 0.75rem;
    }
    
    .newsletter-btn,
    .home-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    #languageSelect {
        font-size: 0.85rem;
        min-width: 100px;
    }
    
    .container {
        margin: 2rem auto;
        padding: 0 1rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .content-section {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .newsletter-item {
        padding: 1.25rem;
    }
    
    .newsletter-item.latest {
        padding-top: 1.75rem;
    }
    
    .newsletter-item.latest::before {
        font-size: 0.8rem;
        padding: 4px 12px;
        left: 15px;
    }
	
	.footer-links .separator-mobile-hidden {
        display: none;
    }
}

/* Responsive - Smartphones */
@media (max-width: 480px) {
    nav {
        padding: 0.75rem;
		justify-content: center;
    }
    
    .logo-nav {
        font-size: 1.2rem;
		width: 100%;
        text-align: center;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    .nav-controls {
        gap: 0.5rem;
		width: 100%;
        justify-content: center;
    }
    
    .newsletter-btn,
    .home-btn {
        padding: 7px 14px;
        font-size: 0.85rem;
    }
    
    #languageSelect {
        font-size: 0.8rem;
        min-width: 90px;
        padding: 6px 10px;
        padding-right: 28px;
    }
    
    .container {
        margin: 1.5rem auto;
        padding: 0 0.75rem;
    }
    
    .hero {
        padding: 1.5rem 0;
    }
    
    .content-section {
        padding: 1.25rem;
        margin-top: 1.25rem;
        border-radius: 12px;
    }
    
    .newsletter-header {
        padding: 1.5rem 0 2rem 0;
    }
    
    .newsletter-list {
        gap: 1.25rem;
    }
    
    .newsletter-item {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .newsletter-item.latest {
        padding-top: 1.5rem;
    }
    
    .newsletter-item.latest::before {
        font-size: 0.75rem;
        padding: 3px 10px;
        left: 10px;
        top: -10px;
    }
    
    .newsletter-date {
        font-size: 0.85rem;
    }
    
    .read-more {
        font-size: 0.9rem;
    }
    
    footer {
        padding: 1.25rem 0.75rem;
    }
    
    .logo {
        margin-bottom: 1.5rem;
    }
    
    .subtitle {
        margin-bottom: 2rem;
    }
}

/* Support pour iOS Safari */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
    
    .splash-body {
        height: -webkit-fill-available;
    }
}

/* Amélioration de la performance sur mobile */
@media (hover: none) and (pointer: coarse) {
    .newsletter-item:hover {
        transform: none;
    }
    
    .newsletter-btn:hover,
    .home-btn:hover,
    .enter-btn:hover {
        transform: none;
    }
}

/* Orientation paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .splash-body {
        padding: 0.5rem;
    }
    
    .logo {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .enter-btn {
        padding: 10px 30px;
    }
}

/* Mode sombre (respect des préférences système) */
@media (prefers-color-scheme: dark) {
    /* Optionnel : vous pouvez ajouter un mode sombre ici si souhaité */
}

/* Page Statistics */
.stats-main {
    display: flex;
    justify-content: center; /* centre horizontalement */
    align-items: center;     /* centre verticalement */
    height: 100vh;       /* occupe toute la hauteur de l'écran */
	box-sizing: border-box;
    padding: 2rem;
    background: #f5f5f5;     /* optionnel : fond léger */
}

.stats-container {
	width: 90%;
    max-width: 550px;
    margin: 2rem auto;
    padding: 2rem 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

.stats-header h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: #667eea;
    margin-bottom: 0.3rem;
}

.stats-header .subtitle {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: #666;
    font-weight: 500;
}

/* Stat cards */
.stat-card {
    background: #f9f9f9;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.stat-badge img {
    height: 30px;
    width: auto;
}

/* Note below stats */
.note {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-container {
        padding: 1.5rem 1rem;
        gap: 1.5rem;
    }

    .stat-card {
        flex-direction: column;
        gap: 0.5rem;
    }

    .stat-badge img {
        height: 35px;
    }
}

@media (max-width: 480px) {
    .stats-header h1 {
        font-size: 1.6rem;
    }

    .stats-header .subtitle {
        font-size: 1rem;
    }

    .stat-badge img {
        height: 30px;
    }
}

/* Support RTL pour arabe et persan */
html[lang="ar"],
html[lang="fa"] {
    direction: rtl;
}

/* Ajustements spécifiques pour la navigation en RTL */
html[lang="ar"] nav,
html[lang="fa"] nav {
    direction: rtl;
}

html[lang="ar"] .nav-controls,
html[lang="fa"] .nav-controls {
    flex-direction: row-reverse;
}

/* Ajustement du sélecteur de langue en RTL */
html[lang="ar"] #languageSelect,
html[lang="fa"] #languageSelect {
    background-position: left 10px center;
    padding-left: 30px;
    padding-right: 12px;
}

/* Footer en RTL */
html[lang="ar"] .footer-links,
html[lang="fa"] .footer-links {
    direction: rtl;
}

/* Alignement du texte en RTL - SAUF pour hero et boutons */
html[lang="ar"] .content-section,
html[lang="ar"] .newsletter-header,
html[lang="fa"] .content-section,
html[lang="fa"] .newsletter-header {
    text-align: right;
}

/* GARDER LE CENTRAGE pour hero (titres, sous-titres, boutons) */
html[lang="ar"] .hero,
html[lang="fa"] .hero {
    text-align: center;
    direction: rtl;
}

html[lang="ar"] .hero h1,
html[lang="ar"] .hero p,
html[lang="ar"] .redirect-store-btn,
html[lang="fa"] .hero h1,
html[lang="fa"] .hero p,
html[lang="fa"] .redirect-store-btn {
    text-align: center;
}

/* Header de newsletter centré aussi */
html[lang="ar"] .newsletter-header,
html[lang="fa"] .newsletter-header {
    text-align: center;
}

/* Badge "Dernière édition" en RTL */
html[lang="ar"] .newsletter-item.latest::before,
html[lang="fa"] .newsletter-item.latest::before {
    left: auto;
    right: 20px;
}

/* Flèche "read more" en RTL */
html[lang="ar"] .read-more::after,
html[lang="fa"] .read-more::after {
    content: '←';
}