* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 3em;
    color: #3498db;
    margin-bottom: 10px;
    font-weight: 700;
}

.tagline {
    font-size: 1.2em;
    color: #7f8c8d;
    font-weight: 400;
}

/* Welcome Section */
.welcome-section {
    flex: 1;
}

.welcome-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.welcome-card h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.intro {
    color: #5a6c7d;
    margin-bottom: 30px;
    font-size: 1.1em;
}

/* Steps */
.steps {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    gap: 20px;
}

.step {
    flex: 1;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.step:hover {
    transform: translateY(-5px);
}

.step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    line-height: 40px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Form Styles */
.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

.states-grid, .themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.state-btn, .theme-btn {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    text-align: left;
}

.state-btn:hover, .theme-btn:hover {
    border-color: #3498db;
    transform: translateY(-2px);
}

.state-btn.selected, .theme-btn.selected {
    border-color: #3498db;
    background: #ebf5fb;
    color: #3498db;
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 18px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px 0;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 12px 24px;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Guidelines */
.guidelines {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.guidelines h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.guidelines ul {
    list-style: none;
    padding-left: 0;
}

.guidelines li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    color: #5a6c7d;
}

.guidelines li:before {
    content: "✓ ";
    color: #2ecc71;
    font-weight: bold;
    margin-right: 10px;
}

/* Waiting Page */
.waiting-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.waiting-card {
    background: white;
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
}

.waiting-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 40px;
}

.pulse-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #3498db;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.delay-1 {
    animation-delay: 0.5s;
}

.delay-2 {
    animation-delay: 1s;
}

.heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.3;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.7;
    }
}

.waiting-message {
    color: #5a6c7d;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.waiting-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
}

.info-item {
    text-align: center;
}

.info-label {
    display: block;
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1.5em;
    font-weight: 700;
    color: #3498db;
}

.waiting-tips {
    text-align: left;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.waiting-tips h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.waiting-tips ul {
    list-style: none;
    padding-left: 20px;
}

.waiting-tips li {
    padding: 5px 0;
    color: #5a6c7d;
}

.waiting-tips li:before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.waiting-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

/* Chat Page */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    /* Hauteur réduite pour voir header/footer */
    height: 70vh; /* RÉDUIT de calc(100vh - 40px) à 70vh */
    max-height: 900px; /* AJOUTEZ une hauteur max */
    min-height: 400px;
    margin-bottom: 30px; /* ESPACE en bas pour le footer */
}

/* Pour desktop seulement - au-dessus de 768px */
@media (min-width: 769px) {
    .chat-container {
        height: 70vh;
        max-height: 650px;
        margin-top: 20px; /* Espace après le header */
        margin-bottom: 40px; /* Plus d'espace avant le footer */
    }
    
    .chat-messages {
        height: calc(100% - 170px);
        min-height: 200px;
    }
    
    /* Réduire légèrement la taille du header dans le chat */
    .chat-header {
        padding: 12px 20px;
    }
    
    .chat-guidelines {
        font-size: 0.8em;
        padding: 8px;
    }
}
/* Header fixe */
.chat-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0; /* Empêche le header de rétrécir */
}

.partner-info h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.partner-details {
    color: #5a6c7d;
    font-size: 0.95em;
}

.chat-guidelines {
    margin-top: 10px;
    padding: 10px;
    background: #ebf5fb;
    border-radius: 8px;
    color: #3498db;
    font-size: 0.85em;
}

/* Zone des messages - maintenant avec hauteur fixe et défilement */
.chat-messages {
    flex: 1;
    padding: 20px;
    padding-bottom: 80px; /* RÉDUIT de 100px à 80px */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fafafa;
    scroll-behavior: smooth;
    /* Hauteur dynamique */
    height: calc(100% - 180px); /* RÉDUIT de 200px à 180px */
    min-height: 250px; /* RÉDUIT de 300px à 250px */
}

.system-message {
    text-align: center;
    margin: 20px 0;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Ajustements pour les messages */
.message {
    margin: 10px 0;
    max-width: 80%;
    clear: both;
    animation: fadeIn 0.3s ease-out;
}

.message-self {
    float: right;
    margin-left: auto;
}

.message-partner {
    float: left;
    margin-right: auto;
}

.message-time {
    display: block;
    font-size: 0.8em;
    color: #95a5a6;
    margin-bottom: 5px;
}

.message-self .message-time {
    text-align: right;
}

.message-text {
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95em;
    line-height: 1.4;
}

.message-self .message-text {
    background: #3498db;
    color: white;
    border-bottom-right-radius: 5px;
}

.message-partner .message-text {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 5px;
}

/* Zone d'input fixe en bas */
.chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.input-wrapper textarea {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1em;
    resize: none;
    outline: none;
    transition: border-color 0.3s ease;
}

.input-wrapper textarea:focus {
    border-color: #3498db;
}

.btn-send {
    padding: 0 25px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-send:hover {
    background: #27ae60;
}

.btn-leave {
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-leave:hover {
    background: #c0392b;
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.character-count {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 40px;
}

.footer p {
    margin: 10px 0;
}

.disclaimer {
    font-size: 0.85em;
    color: #95a5a6;
    margin-top: 20px;
}

/* Animations */
/* Animation pour les nouveaux messages */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-card, 
.guidelines, 
.waiting-card {
    animation: fadeIn 0.6s ease-out;
}


/* Styles pour l'info d'activité */
.soft-info {
    margin: 15px 0;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #3498db;
    color: #5a6c7d;
    font-size: 0.95em;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.activity-indicator {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-message {
    padding: 8px 0;
    border-bottom: 1px solid #eaeaea;
}

.activity-message:last-child {
    border-bottom: none;
}

/* Animation de pulsation pour l'activité */
@keyframes gentle-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}


/* Amélioration visuelle des boutons de thème avec indicateur */
.theme-btn.active-theme {
    position: relative;
    border-color: #3498db;
    background: #ebf5fb;
}

.theme-btn.active-theme::after {
    content: "✨";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9em;
}

/* Scrollbar */
/* Amélioration du défilement */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}


::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Animation pour l'indicateur de frappe */
@keyframes dot-pulse {
    0%, 60%, 100% { 
        transform: translateY(0); 
        opacity: 0.4; 
    }
    30% { 
        transform: translateY(-5px); 
        opacity: 1; 
    }
}

.typing-indicator {
    margin: 15px 0;
    animation: fadeIn 0.3s ease-out;
}

.typing-indicator .message-text.typing {
    background: white;
    padding: 10px 18px;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 5px;
    border-radius: 18px;
    display: inline-block;
}

.typing .dot:nth-child(1) { animation-delay: 0s; }
.typing .dot:nth-child(2) { animation-delay: 0.2s; }
.typing .dot:nth-child(3) { animation-delay: 0.4s; }

/* Optionnel : message doux sous l'indicateur */
.typing-indicator::after {
    content: "Votre interlocuteur est en train d'écrire...";
    display: block;
    font-size: 0.8em;
    color: #7f8c8d;
    margin-top: 5px;
    font-style: italic;
    animation: fadeIn 0.5s ease-out;
}

/* Pour rendre la disparition plus douce */
.typing-indicator.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ADMIN DASHBOARD */
.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.admin-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.admin-card.wide {
    grid-column: span 2;
}

.admin-card h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.admin-card .value {
    font-size: 26px;
    font-weight: 700;
}

.muted {
    color: #666;
    font-size: 14px;
}

.typing .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    margin: 0 2px;
    animation: typingAnimation 1.4s infinite both;
}

.typing .dot:nth-child(1) { animation-delay: 0s; }
.typing .dot:nth-child(2) { animation-delay: 0.2s; }
.typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* CSS à ajouter pour le support mobile */
@media (max-width: 768px) {
    .keyboard-open .chat-container {
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .keyboard-open .chat-messages {
        max-height: 60vh !important;
        padding-bottom: 200px !important; /* AUGMENTÉ de 150px à 200px */
        -webkit-overflow-scrolling: touch;
        height: calc(100vh - 300px) !important; /* AJOUTEZ ceci */
    }

    .keyboard-open #message-input {
        font-size: 16px !important;
        max-height: 120px !important;
        line-height: 1.4 !important;
    }
    
    /* Masquer le bouton de scroll quand le clavier est ouvert */
    .keyboard-open #scroll-to-bottom-btn {
        display: none !important;
    }
}

/* Styles pour le bouton de scroll */
#scroll-to-bottom-btn {
    position: absolute;
    bottom: 100px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: auto;
}

#scroll-to-bottom-btn.show {
    opacity: 1;
    transform: translateY(0);
}

/* Correction pour le mode clavier sur mobile */
@media (max-width: 768px) {
    body.keyboard-open {
        overflow: hidden;
    }
    
    .keyboard-open #scroll-to-bottom-btn {
        bottom: 180px !important;
        display: none !important;
    }
}

/* Ajustements iOS */
@supports (-webkit-touch-callout: none) {
    #message-input {
        font-size: 16px !important;
    }
    
    .chat-messages {
        -webkit-overflow-scrolling: touch;
    }
}
/* Optimisation du chargement des polices */
@font-face {
    font-display: swap;
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300;
    src: url('/static/fonts/inter-v12-latin-300.woff2') format('woff2');
}

/* Optimisation des images */
img {
    max-width: 100%;
    height: auto;
}
/* Styles pour pages SEO */
.about-page, .faq-page {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-page h1, .faq-page h1 {
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

.faq-category {
    margin: 40px 0;
}

.faq-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    border-left: 4px solid #3498db;
}

.faq-item h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.seo-content h3, .seo-content h4 {
    color: #2c3e50;
    margin: 20px 0 10px;
}

.seo-content ul {
    list-style: none;
    padding-left: 0;
}

.seo-content li {
    padding: 8px 0;
    color: #5a6c7d;
}

.seo-content li:before {
    content: "✓ ";
    color: #2ecc71;
    font-weight: bold;
}
/* Navigation du footer */
.footer-nav {
    margin: 15px 0;
    font-size: 0.9em;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-nav:hover {
    opacity: 1;
}

.footer-nav a {
    color: #5a6c7d;
    text-decoration: none;
    padding: 0 5px;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: #3498db;
    text-decoration: underline;
}

.footer-nav .separator {
    color: #bdc3c7;
    margin: 0 8px;
    font-size: 0.8em;
}