/* ============================================
   🎨 THEME NOIR & BLEU AVEC FLAMME ANIMÉE
   ============================================ */

/* ----- 1. RESET & BASE ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
}

/* ----- 2. ARRIÈRE-PLAN AVEC FLAMME ANIMÉE ----- */
body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Conteneur de la flamme */
.flame-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Les flammes animées */
.flame {
    position: absolute;
    bottom: -10%;
    width: 60px;
    height: 200px;
    border-radius: 50% 50% 0 0;
    background: linear-gradient(to top, #ff4500, #ff6b00, #ffaa00, #ffdd44);
    opacity: 0.6;
    transform-origin: bottom center;
    filter: blur(2px);
    animation: flameFlicker 1.5s infinite alternate ease-in-out;
}

.flame:nth-child(1) {
    left: 5%;
    height: 250px;
    width: 70px;
    animation-duration: 1.8s;
    animation-delay: 0s;
    opacity: 0.5;
}

.flame:nth-child(2) {
    left: 20%;
    height: 180px;
    width: 50px;
    animation-duration: 1.2s;
    animation-delay: 0.3s;
    opacity: 0.4;
}

.flame:nth-child(3) {
    left: 35%;
    height: 300px;
    width: 80px;
    animation-duration: 2s;
    animation-delay: 0.6s;
    opacity: 0.6;
}

.flame:nth-child(4) {
    left: 50%;
    height: 220px;
    width: 60px;
    animation-duration: 1.6s;
    animation-delay: 0.9s;
    opacity: 0.5;
}

.flame:nth-child(5) {
    left: 65%;
    height: 280px;
    width: 75px;
    animation-duration: 1.4s;
    animation-delay: 0.2s;
    opacity: 0.4;
}

.flame:nth-child(6) {
    left: 80%;
    height: 200px;
    width: 55px;
    animation-duration: 1.9s;
    animation-delay: 0.7s;
    opacity: 0.5;
}

.flame:nth-child(7) {
    right: 5%;
    height: 260px;
    width: 65px;
    animation-duration: 1.7s;
    animation-delay: 0.4s;
    opacity: 0.5;
}

/* Animation de la flamme */
@keyframes flameFlicker {
    0% {
        transform: scaleY(1) scaleX(1) rotate(-3deg);
        opacity: 0.5;
    }
    25% {
        transform: scaleY(1.1) scaleX(0.9) rotate(2deg);
        opacity: 0.7;
    }
    50% {
        transform: scaleY(0.9) scaleX(1.1) rotate(-1deg);
        opacity: 0.4;
    }
    75% {
        transform: scaleY(1.05) scaleX(0.95) rotate(3deg);
        opacity: 0.8;
    }
    100% {
        transform: scaleY(1) scaleX(1) rotate(-2deg);
        opacity: 0.5;
    }
}

/* Particules (étincelles) */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #ffaa00, #ff4500);
    border-radius: 50%;
    animation: particleRise 4s infinite linear;
    opacity: 0;
    filter: blur(1px);
}

.particle:nth-child(8) { left: 10%; animation-delay: 0s; animation-duration: 3.5s; }
.particle:nth-child(9) { left: 25%; animation-delay: 1s; animation-duration: 4.2s; }
.particle:nth-child(10) { left: 40%; animation-delay: 2s; animation-duration: 3.8s; }
.particle:nth-child(11) { left: 55%; animation-delay: 0.5s; animation-duration: 4.5s; }
.particle:nth-child(12) { left: 70%; animation-delay: 1.5s; animation-duration: 3.2s; }
.particle:nth-child(13) { left: 85%; animation-delay: 2.5s; animation-duration: 4.0s; }
.particle:nth-child(14) { left: 15%; animation-delay: 3s; animation-duration: 3.6s; }
.particle:nth-child(15) { left: 60%; animation-delay: 1.8s; animation-duration: 4.8s; }

@keyframes particleRise {
    0% {
        bottom: -10%;
        opacity: 0;
        transform: translateX(0) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateX(-20px) scale(1);
    }
    80% {
        opacity: 0.8;
        transform: translateX(20px) scale(0.8);
    }
    100% {
        bottom: 110%;
        opacity: 0;
        transform: translateX(-10px) scale(0.3);
    }
}

/* ----- 3. CONTENEUR PRINCIPAL (CARTE) ----- */
.container {
    position: relative;
    z-index: 1;
    background: rgba(10, 10, 15, 0.92);
    border: 1px solid #1a3a5c;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 20, 50, 0.8), inset 0 1px 0 rgba(100, 180, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ----- 4. EN-TÊTE ----- */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    color: #4a9eff;
    text-shadow: 0 0 20px rgba(74, 158, 255, 0.3), 0 0 60px rgba(74, 158, 255, 0.1);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.header h1 .emoji {
    filter: drop-shadow(0 0 10px rgba(255, 100, 0, 0.3));
}

.header p {
    color: #8ab4d6;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* ----- 5. CARTES D'ACTIONS ----- */
.main-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.card {
    background: rgba(20, 30, 50, 0.6);
    border: 1px solid #1a3a5c;
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: #4a9eff;
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.1);
    transform: translateY(-2px);
}

.card h2 {
    color: #4a9eff;
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.card p {
    color: #8ab4d6;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

/* ----- 6. CHAMPS DE SAISIE ----- */
.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid #1a3a5c;
    border-radius: 10px;
    font-size: 1rem;
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #4a9eff;
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.15);
}

.input-group input::placeholder {
    color: #4a6a8a;
}

/* ----- 7. BOUTONS ----- */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #1a5a9e, #4a9eff);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 25px rgba(74, 158, 255, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #0a3a5c, #1a6a9e);
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px rgba(26, 106, 158, 0.3);
}

.btn-secondary:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 25px rgba(26, 106, 158, 0.4);
}

/* ----- 8. MESSAGES D'ERREUR ----- */
.error-message {
    background: rgba(180, 30, 30, 0.2);
    border: 1px solid #8a2a2a;
    color: #ff6a6a;
    padding: 12px;
    border-radius: 10px;
    margin: 15px 0;
    text-align: center;
}

/* ----- 9. PIED DE PAGE ----- */
.footer {
    text-align: center;
    color: #4a6a8a;
    margin-top: 25px;
    font-size: 0.9rem;
}

/* ============================================
   🎨 PAGE DU CHAT
   ============================================ */

/* ----- 10. CONTENEUR DU CHAT ----- */
.chat-container {
    position: relative;
    z-index: 1;
    background: rgba(10, 10, 15, 0.92);
    border: 1px solid #1a3a5c;
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 20, 50, 0.8), inset 0 1px 0 rgba(100, 180, 255, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ----- 11. EN-TÊTE DU CHAT ----- */
.chat-header {
    background: linear-gradient(135deg, #0a1a2a, #0a2a4a);
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #e0e0e0;
    flex-shrink: 0;
    border-bottom: 1px solid #1a3a5c;
}

.btn-quitter {
    background: rgba(180, 30, 30, 0.3);
    border: 1px solid #5a2a2a;
    color: #ff6a6a;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-quitter:hover {
    background: rgba(180, 30, 30, 0.5);
}

.salon-info h2 {
    font-size: 1.2rem;
    color: #4a9eff;
    margin-bottom: 2px;
}

.salon-info span {
    font-size: 0.85rem;
    color: #4a6a8a;
}

.badge {
    background: rgba(74, 158, 255, 0.15);
    border: 1px solid #1a3a5c;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #4a9eff;
}

/* ----- 12. ZONE DES MESSAGES ----- */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(5, 5, 10, 0.5);
}

.messages-area::-webkit-scrollbar {
    width: 6px;
}

.messages-area::-webkit-scrollbar-track {
    background: rgba(10, 15, 25, 0.5);
    border-radius: 3px;
}

.messages-area::-webkit-scrollbar-thumb {
    background: #1a3a5c;
    border-radius: 3px;
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background: #2a5a8c;
}

/* ----- 13. MESSAGES ----- */
.message {
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
}

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

.message.system {
    text-align: center;
    color: #4a6a8a;
    font-size: 0.9rem;
    padding: 10px;
}

.message .pseudo {
    font-weight: 600;
    color: #4a9eff;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.message .texte {
    background: rgba(20, 30, 50, 0.8);
    border: 1px solid #1a2a4a;
    padding: 10px 15px;
    border-radius: 12px;
    display: inline-block;
    max-width: 80%;
    color: #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.message.moi .texte {
    background: linear-gradient(135deg, #0a2a5a, #1a4a8a);
    border-color: #2a5a9e;
    color: white;
    margin-left: auto;
}

.message.moi {
    text-align: right;
}

.message .heure {
    font-size: 0.7rem;
    color: #4a6a8a;
    margin-top: 2px;
    display: block;
}

/* ----- 14. ZONE DE SAISIE ----- */
.chat-input {
    padding: 15px 20px;
    background: rgba(5, 5, 10, 0.8);
    border-top: 1px solid #1a3a5c;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid #1a3a5c;
    border-radius: 10px;
    font-size: 1rem;
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.chat-input input:focus {
    outline: none;
    border-color: #4a9eff;
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.1);
}

.chat-input input::placeholder {
    color: #4a6a8a;
}

.btn-envoyer {
    background: linear-gradient(135deg, #1a5a9e, #4a9eff);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.2);
}

.btn-envoyer:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 25px rgba(74, 158, 255, 0.3);
}

/* ----- 15. RESPONSIVE ----- */
@media (max-width: 640px) {
    .container {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .chat-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .message .texte {
        max-width: 90%;
    }
}

/* ----- 16. EFFET DE LUEUR ----- */
.glow {
    text-shadow: 0 0 20px rgba(74, 158, 255, 0.3);
}

/* Petite animation de pulsation sur le titre */
@keyframes pulseGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(74, 158, 255, 0.3);
    }
    50% {
        text-shadow: 0 0 40px rgba(74, 158, 255, 0.6), 0 0 80px rgba(74, 158, 255, 0.2);
    }
}

.header h1 {
    animation: pulseGlow 3s infinite ease-in-out;
} 