/* ===========================
   BARRE DE CHAT FLOTTANTE (Style Facebook/Instagram)
   COPIE EXACTE DE LA PAGE COMMUNAUTÉ
   =========================== */

/* RÈGLE GLOBALE - AUCUN BORD ARRONDI */
.floating-chat-bar * {
    border-radius: 0px !important;
}

/* Barre de chat fixe en bas à droite */
.floating-chat-bar {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 320px;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(229, 9, 20, 0.3);
    border-bottom: none;
}

/* Header de la barre (toujours visible) */
.floating-chat-header {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
    user-select: none;
    text-align: center;
}

.floating-chat-header:hover {
    background: rgba(0, 0, 0, 0.9);
}

.floating-chat-header-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.floating-chat-title {
    color: #E50914;
    font-family: 'Barlow Semi Condensed', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(229, 9, 20, 0.4);
}

.floating-chat-subtitle {
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    margin: 0;
    opacity: 0.9;
}



/* Effet de notification - Lueur douce comme les titres rouges */
.floating-chat-header.has-new-messages {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.1), rgba(139, 0, 0, 0.05));
    animation: softGlow 4s infinite ease-in-out;
    box-shadow: 0 0 0 rgba(229, 9, 20, 0);
}

@keyframes softGlow {
    0% { 
        background: linear-gradient(135deg, rgba(229, 9, 20, 0.08), rgba(139, 0, 0, 0.04));
        box-shadow: 0 0 8px rgba(229, 9, 20, 0.1);
    }
    50% { 
        background: linear-gradient(135deg, rgba(229, 9, 20, 0.15), rgba(139, 0, 0, 0.08));
        box-shadow: 0 0 16px rgba(229, 9, 20, 0.2);
    }
    100% { 
        background: linear-gradient(135deg, rgba(229, 9, 20, 0.08), rgba(139, 0, 0, 0.04));
        box-shadow: 0 0 8px rgba(229, 9, 20, 0.1);
    }
}

/* Badge de notification discret */
.floating-notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    pointer-events: none;
    min-width: 16px;
    text-align: center;
}

.floating-notification-badge.visible {
    opacity: 0.2;
    transform: scale(1);
}

/* Corps de la barre de chat (peut être ouvert/fermé) */
.floating-chat-body {
    background: rgba(0, 0, 0, 0.95);
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.floating-chat-body.expanded {
    height: 500px;
}

/* Timer de destruction - Une seule ligne */
.floating-chat-countdown {
    background: rgba(229, 9, 20, 0.1);
    padding: 8px 12px;
    text-align: center;
    margin: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    font-size: 0; /* Supprime les espaces entre spans */
}

.floating-chat-countdown:hover {
    background: rgba(229, 9, 20, 0.15);
    transform: scale(1.02);
}

.floating-countdown-text {
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    display: inline;
}

.floating-countdown-timer {
    color: #E50914;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
    animation: blink 2s infinite;
    display: inline;
    margin-left: 4px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.7; }
}

/* Compteur d'utilisateurs actifs (EXACTEMENT comme page Communauté) */
.floating-active-users-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    transition: all 0.3s ease;
}

.floating-active-users-counter:hover {
    transform: translateY(-1px);
}



.floating-users-icon {
    font-size: 14px;
    filter: drop-shadow(0 0 3px rgba(0, 255, 127, 0.4));
}

.floating-users-text {
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 255, 127, 0.2);
}

.floating-users-count {
    color: #00FF7F;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(0, 255, 127, 0.4);
    min-width: 20px;
    text-align: center;
}

/* Interface du chat (EXACTEMENT comme page Communauté) */
.floating-chat-interface {
    background: transparent;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Chat flou par défaut */
.floating-chat-interface.blurred .floating-chat-messages {
    filter: blur(4px);
    opacity: 0.6;
    pointer-events: none;
}

/* Chat net une fois connecté */
.floating-chat-interface.connected .floating-chat-messages {
    filter: none;
    opacity: 1;
    pointer-events: auto;
}

/* S'assurer que les messages sont visibles même flous */
.floating-chat-messages {
    background: rgba(0, 0, 0, 0.8) !important;
}

/* Zone des messages style Discord */
.floating-chat-messages {
    height: 280px;
    overflow-y: auto;
    padding: 8px 0;
    display: block;
    scroll-behavior: smooth;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 10px;
    line-height: 1.4;
}

.floating-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.floating-chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.floating-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(229, 9, 20, 0.5);
}

.floating-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(229, 9, 20, 0.7);
}

/* Messages style Discord - Simple et propre */
.floating-message {
    padding: 4px 8px;
    margin-bottom: 2px;
    animation: messageSlideIn 0.2s ease;
    background: transparent;
    border: none;
    display: block;
}

.floating-message:hover {
    background: rgba(255, 255, 255, 0.02);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.floating-message-header {
    display: inline;
    margin-right: 8px;
}

.floating-message-username {
    color: #E50914;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin-right: 6px;
}

.floating-message-time {
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 400;
    margin-right: 8px;
}

.floating-message-content {
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    word-wrap: break-word;
    display: inline;
}

/* Messages système - Style discret et centré */
.floating-message.system-message {
    opacity: 0.8;
    font-style: italic;
    text-align: center;
    padding: 2px 8px;
}

.floating-message.system-message .floating-message-content {
    color: #aaa;
    font-size: 12px;
    display: block;
}

/* Zone de saisie (EXACTEMENT comme page Communauté) */
.floating-chat-input-section {
    padding: 0;
    background: transparent;
    border: none;
}

.floating-current-user {
    padding: 15px 20px 10px 20px;
    text-align: center;
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-user-indicator {
    color: #00FF7F;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(0, 255, 127, 0.4);
}

.floating-message-input-container {
    display: flex;
    gap: 8px;
    padding: 10px 20px 20px 20px;
    background: transparent;
}

.floating-message-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.floating-message-input:focus {
    outline: none;
    border-color: #E50914;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

.floating-message-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.floating-send-message-btn {
    background: linear-gradient(135deg, #E50914, #8b0000);
    border: none;
    color: white;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.floating-send-message-btn:hover {
    background: linear-gradient(135deg, #8b0000, #E50914);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.4);
}

.floating-send-message-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Interface de connexion (EXACTEMENT comme page Communauté) */
.floating-chat-login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10;
    text-align: center;
}

.floating-login-form {
    max-width: 280px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.65);
    padding: 30px;
    border: 2px solid rgba(229, 9, 20, 0.3);
    backdrop-filter: blur(10px);
}

.floating-login-title {
    color: #fff;
    font-family: 'Barlow Semi Condensed', 'Helvetica Neue', Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 25px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.floating-username-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.floating-username-input:focus {
    outline: none;
    border-color: #E50914;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

.floating-username-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.floating-join-chat-btn {
    background: linear-gradient(135deg, #E50914, #8b0000);
    border: none;
    color: white;
    padding: 12px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    width: 100%;
}

.floating-join-chat-btn:hover {
    background: linear-gradient(135deg, #8b0000, #E50914);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.4);
}

.floating-join-chat-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
/* Style Discord - Messages en ligne */
.floating-message {
    padding: 2px 12px !important;
    margin-bottom: 1px !important;
    border: none !important;
    background: transparent !important;
}

.floating-message:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

.floating-message-username {
    color: #E50914 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin-right: 6px !important;
}

.floating-message-time {
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 11px !important;
    margin-right: 8px !important;
}

.floating-message-content {
    color: #fff !important;
    font-weight: 400 !important;
    font-size: 14px !important;
    display: inline !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* ===========================
   BARRE DE CHAT — v2 mobile polish
   =========================== */

@media (max-width: 768px) {
  .floating-chat-bar {
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
  }

  .floating-chat-body.expanded {
    height: min(70dvh, 520px);
  }

  .floating-chat-messages {
    height: 220px;
  }

  .floating-login-form {
    padding: 1.5rem 1.25rem;
    max-width: 100%;
    margin: 0 1rem;
  }

  .floating-login-title {
    font-size: 0.85rem;
    letter-spacing: 0.16em;
  }

  .floating-username-input,
  .floating-message-input {
    font-size: 16px;
    padding: 0.85rem 1rem;
  }

  .floating-join-chat-btn,
  .floating-send-message-btn {
    padding: 0.85rem 1rem;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
  }

  .floating-message-input-container {
    padding: 0.75rem;
  }

  .floating-current-user {
    padding: 0.75rem 1rem 0.5rem;
  }

  .floating-user-indicator {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
  }
}

/* Chat page full-screen overrides handled in blackverse-v2.css */ 