:root {
    --primary-color: #fce200;
    --text-color: #333;
    --secondary-text-color: #666;
    --background-color: #f7f7f7;
    --card-border-radius: 12px;
    --sidebar-width: 260px;
    --video-width: 70%;
    --chat-width: 30%;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    background-color: #fff;
    color: var(--text-color);
    overflow-x: hidden;
}

/* --- Barre de Navigation (Header) --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
    height: 60px;
    background-color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    gap: 15px;
}

.navbar-left,
.navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-right: 10px;
    white-space: nowrap;
}

.nav-button {
    background: none;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    border-radius: 8px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.nav-button:hover {
    background-color: #f0f0f0;
}

.nav-button.active {
    background-color: var(--primary-color);
    color: var(--text-color);
    font-weight: bold;
}

.nav-button-background {
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    border-radius: 8px;
    transition: background-color 0.2s;
    font-weight: bold;
    white-space: nowrap;
}

.nav-button-background:hover {
    background-color: #e6d200;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--background-color);
    padding: 8px 15px;
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
}

.search-bar i {
    color: var(--secondary-text-color);
    margin-right: 10px;
    flex-shrink: 0;
}

.search-bar input {
    border: none;
    background: none;
    outline: none;
    font-size: 16px;
    width: 100%;
    min-width: 0;
}

.user-profile {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: var(--secondary-text-color);
    border: 1px solid #ccc;
    flex-shrink: 0;
}

/* --- Contenu Principal (Sidebar + Streams) --- */
.content-wrapper {
    display: flex;
    min-height: calc(100vh - 60px);
    margin-top: 60px;
    background-color: var(--background-color);
}

/* --- Barre Latérale (Sidebar) --- */
.sidebar {
    width: var(--sidebar-width);
    padding: 20px;
    background-color: white;
    border-right: 1px solid #eee;
    flex-shrink: 0;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    /* display: none;  */
}

.greeting {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 25px;
}

.section-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.nav-list {
    list-style: none;
    margin-bottom: 40px;
}

.nav-list li {
    padding: 8px 10px;
    margin-bottom: 5px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.nav-list li:hover {
    background-color: var(--background-color);
}

.nav-list li.active-item {
    background-color: var(--background-color);
    font-weight: bold;
}

.footer-links {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.footer-links a,
.footer-links p,
.footer-links select {
    display: block;
    font-size: 12px;
    color: var(--secondary-text-color);
    text-decoration: none;
    margin-bottom: 8px;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-links select {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 0;
    width: 100%;
}

/* --- Grille des Streams (Live Streams) --- */
.live-streams {
    flex-grow: 1;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    background-color: var(--background-color);
}

.stream-card {
    background-color: white;
    border-radius: var(--card-border-radius);
    overflow: hidden;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.stream-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stream-info {
    padding: 15px;
    background-color: white;
    border-top: 1px solid #eee;
    border-radius: 0 0 var(--card-border-radius) var(--card-border-radius);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.stream-info .title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    height: 2.8em;
}

.stream-info .category {
    font-size: 12px;
    color: var(--secondary-text-color);
    margin-bottom: 8px;
}

.stream-info .description {
    font-size: 12px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    height: 2.8em;
}

/* --- Conteneur Principal Live (viewer.html) --- */
.live-container {
    flex: 1;
    display: flex;
    padding: 20px;
    gap: 20px;
    height: 90vh;
}

/* --- Section Vidéo (Gauche) --- */
.video-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

/* --- Section Chat (Droite) --- */
.chat-section {
    flex: 0 0 var(--chat-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

/* --- Player Card --- */
.player-card {
    background: white;
    border-radius: var(--card-border-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* --- Top Bar --- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 10px;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-live {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ff4444;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.badge-live.off {
    background: #666;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.badge-live.off .live-dot {
    animation: none;
    background: #ccc;
}

.pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0f0f0;
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    flex-shrink: 0;
}

.dot {
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot.ok {
    background: #4CAF50;
}

/* --- Video Container --- */
.video-container {
    position: relative;
    background: #000;
    border-radius: var(--card-border-radius);
    overflow: hidden;
    flex: 1;
    min-height: 400px;
    width: 100%;
    height: calc(100vh - 60px - 40px);
    max-height: calc(100vh - 100px);
}

#remoteVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.unmute-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 5;
}

.unmute-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[src] {
    opacity: 1;
}

/* --- Overlay de fin de live --- */
.live-ended-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 10;
    border-radius: inherit;
    backdrop-filter: blur(4px);
}

.live-ended-overlay.show {
    display: flex;
    animation: fadeIn 0.5s ease;
}

.live-ended-overlay .overlay-content {
    text-align: center;
    padding: 30px;
    max-width: 400px;
    width: 90%;
}

.live-ended-overlay .overlay-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #fff;
}

.live-ended-overlay .overlay-message {
    font-size: 16px;
    color: #ccc;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* --- Chat Panel --- */
.chat-panel {
    background: white;
    border-radius: var(--card-border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.chat-head {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    background: white;
    border-radius: var(--card-border-radius) var(--card-border-radius) 0 0;
    flex-shrink: 0;
}

.chat-head span:first-child {
    font-size: 16px;
    color: var(--text-color);
}

#viewerLabel {
    background: var(--primary-color);
    color: var(--text-color);
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

#chat {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 300px;
    max-height: none;
}

.bubble {
    background: white;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 85%;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    align-self: flex-start;
}

.bubble.me {
    background: var(--primary-color);
    align-self: flex-end;
    border-color: #e6d200;
}

.bubble .from {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #666;
}

.bubble.me .from {
    color: #333;
}

.bubble .message {
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.4;
}

.chat-input {
    padding: 15px;
    border-top: 1px solid #eee;
    background: white;
    border-radius: 0 0 var(--card-border-radius) var(--card-border-radius);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

#msgInput {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
    min-width: 0;
}

#msgInput:focus {
    border-color: var(--primary-color);
}

#msgInput:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

#sendBtn {
    background: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}

#sendBtn:hover:not(:disabled) {
    background: #e6d200;
}

#sendBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Back Button --- */
.back-button-container {
    position: fixed;
    top: 75px;
    left: 20px;
    z-index: 999;
}

.back-button-outside {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.back-button-outside:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* --- Téléchargement app --- */
.download-app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: var(--secondary-text-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 11px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.download-app-btn:hover {
    background-color: var(--primary-color);
    color: var(--text-color);
}

/* --- Animations --- */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* =========================================== */
/* RESPONSIVE DESIGN - BREAKPOINTS             */
/* =========================================== */

/* --- Desktop Large (> 1400px) --- */
@media (min-width: 1400px) {
    .live-streams {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* --- Desktop Medium (1200px - 1399px) --- */
@media (max-width: 1399px) and (min-width: 1200px) {
    .live-streams {
        grid-template-columns: repeat(4, 1fr);
    }

    :root {
        --video-width: 65%;
        --chat-width: 35%;
    }
}

/* --- Desktop Small (992px - 1199px) --- */
@media (max-width: 1199px) and (min-width: 992px) {
    .live-streams {
        grid-template-columns: repeat(3, 1fr);
    }

    :root {
        --video-width: 65%;
        --chat-width: 35%;
    }

    .sidebar {
        width: 240px;
        padding: 15px;
    }
}

/* --- Tablet Landscape (768px - 991px) --- */
@media (max-width: 991px) and (min-width: 768px) {
    .live-streams {
        grid-template-columns: repeat(2, 1fr);
        padding: 15px;
        gap: 15px;
    }

    .live-container {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }

    .video-section,
    .chat-section {
        width: 100%;
    }

    .chat-section {
        flex: 0 0 auto;
        height: 400px;
    }

    .sidebar {
        width: 220px;
        padding: 15px;
    }

    .navbar {
        padding: 10px 15px;
    }

    .search-bar {
        max-width: 300px;
    }

    .nav-button,
    .nav-button-background {
        padding: 6px 12px;
        font-size: 14px;
    }

    .download-app-btn {
        font-size: 10px;
        padding: 6px 10px;
    }
}

/* --- Tablet Portrait (576px - 767px) --- */
@media (max-width: 767px) and (min-width: 576px) {
    .sidebar {
        display: none;
        /* Cache la sidebar sur tablette */
    }

    .content-wrapper {
        margin-left: 0;
    }

    .live-streams {
        grid-template-columns: repeat(2, 1fr);
        padding: 15px;
        gap: 15px;
        width: 100%;
        margin-top: 30px;
    }

    .live-container {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }

    .video-section,
    .chat-section {
        width: 100%;
    }

    .chat-section {
        flex: 0 0 auto;
        height: 350px;
    }

    .navbar {
        flex-wrap: wrap;
        height: auto;
        min-height: 60px;
        padding: 8px 12px;
    }

    .navbar-left {
        order: 1;
        flex: 1;
    }

    .navbar-center {
        order: 3;
        flex: 100%;
        margin-top: 8px;
        display: flex;
    }

    .navbar-right {
        order: 2;
        flex: 1;
        justify-content: flex-end;
    }

    .search-bar {
        max-width: 100%;
    }

    .download-app-btn {
        display: none;
        /* Cache le bouton téléchargement */
    }

    .nav-button {
        padding: 6px 10px;
        font-size: 13px;
    }

    .logo {
        font-size: 20px;
    }

    .video-container {
        min-height: 350px;
    }

    .top-bar {
        padding: 10px 15px;
    }
}

/* --- Mobile (≤ 575px) --- */
@media (max-width: 575px) {
    .sidebar {
        display: none;
        /* Cache la sidebar sur mobile */
    }

    .content-wrapper {
        margin-left: 0;
        margin-top: 50px;
    }

    .live-streams {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 10px;
        margin-top: 50px;
    }

    .live-container {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
        margin-top: 50px;
    }

    .video-section,
    .chat-section {
        width: 100%;
    }

    .chat-section {
        flex: 0 0 auto;
        height: 300px;
    }

    .navbar {
        flex-wrap: wrap;
        height: auto;
        min-height: 50px;
        padding: 6px 10px;
        gap: 8px;
    }

    .navbar-left {
        order: 1;
        flex: 1;
        flex-wrap: wrap;
        gap: 5px;
    }

    .navbar-center {
        order: 3;
        flex: 100%;
        margin-top: 6px;
        display: flex;
    }

    .navbar-right {
        order: 2;
        flex: 0 0 auto;
    }

    .search-bar {
        max-width: 100%;
        padding: 6px 12px;
    }

    .download-app-btn {
        display: none;
        /* Cache le bouton téléchargement */
    }

    .nav-button {
        padding: 5px 8px;
        font-size: 12px;
    }

    .nav-button-background {
        padding: 5px 8px;
        font-size: 12px;
    }

    .logo {
        font-size: 18px;
        margin-right: 5px;
    }

    .user-profile {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .video-container {
        min-height: 250px;
    }

    .top-bar {
        padding: 8px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .top-left {
        width: 100%;
        justify-content: space-between;
    }

    .badge-live,
    .pill {
        font-size: 12px;
        padding: 5px 10px;
    }

    .chat-panel {
        min-height: 300px;
    }

    .chat-head {
        padding: 10px 15px;
        font-size: 14px;
    }

    #chat {
        padding: 10px;
        min-height: 200px;
    }

    .bubble {
        padding: 8px 12px;
        font-size: 13px;
    }

    .chat-input {
        padding: 10px;
    }

    #msgInput {
        padding: 8px 12px;
        font-size: 13px;
    }

    #sendBtn {
        padding: 8px 15px;
        font-size: 13px;
    }

    .back-button-container {
        top: 60px;
        left: 10px;
    }

    .back-button-outside {
        padding: 6px 12px;
        font-size: 12px;
    }

    .stream-card {
        min-height: 250px;
    }

    .stream-info {
        padding: 12px;
    }

    .stream-info .title {
        font-size: 13px;
    }

    .stream-info .category,
    .stream-info .description {
        font-size: 11px;
    }
}

/* --- Très petits mobiles (≤ 360px) --- */
@media (max-width: 360px) {
    .navbar-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }

    .nav-button {
        padding: 4px 6px;
        font-size: 11px;
    }

    .logo {
        font-size: 16px;
    }

    .video-container {
        min-height: 200px;
    }

    .chat-section {
        height: 250px;
    }

    .chat-panel {
        min-height: 250px;
    }
}

/* --- Ajustements pour la hauteur --- */
@media (max-height: 700px) {
    .video-container {
        min-height: 300px;
    }

    .chat-section {
        height: 300px;
    }
}

@media (max-height: 600px) {
    .video-container {
        min-height: 250px;
    }

    .chat-section {
        height: 250px;
    }
}

.floating-download-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 50px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    border: 2px solid #e6d200;
    animation: float 3s ease-in-out infinite;
}

.floating-download-btn:hover {
    background-color: #e6d200;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.floating-download-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.floating-download-btn i {
    font-size: 18px;
    flex-shrink: 0;
}

.floating-download-btn span {
    white-space: nowrap;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@media (min-width: 769px) {
    .floating-download-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    .floating-download-btn {
        bottom: 15px;
        right: 15px;
        padding: 12px 18px;
        font-size: 13px;
        display: flex;
    }
}

@media (max-width: 480px) {
    .floating-download-btn {
        bottom: 10px;
        right: 10px;
        padding: 10px 15px;
        font-size: 12px;
        display: flex;
    }

    .floating-download-btn span {
        display: inline;
    }
}

@media (max-width: 360px) {
    .floating-download-btn {
        padding: 10px;
        font-size: 11px;
    }

    .floating-download-btn i {
        font-size: 16px;
    }
}

@media (max-width: 992px) {
    .live-container+.floating-download-btn {
        bottom: 80px;
    }
}

.floating-download-btn {
    z-index: 1001;
}

/* --- Chat Bubbles --- */
.chat-bubble {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    margin-bottom: 8px;
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
    animation: fadeIn 0.3s ease;
}

/* Bubbles des autres utilisateurs (à gauche) */
.chat-bubble:not(.mine) {
    align-self: flex-start;
    background: white;
    border: 1px solid #e5e5ea;
    color: #333;
    border-top-left-radius: 4px;
}

/* Bubbles de l'utilisateur courant (à droite) */
.chat-bubble.mine {
    align-self: flex-end;
    background: var(--primary-color);
    color: #333;
    border: 1px solid #e6d200;
    border-top-right-radius: 4px;
}

/* Nom de l'expéditeur */
.chat-bubble-sender {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-bubble:not(.mine) .chat-bubble-sender {
    color: #666;
}

.chat-bubble.mine .chat-bubble-sender {
    color: #333;
}

/* Badge pour le streamer */
.chat-bubble-sender-streamer {
    background: linear-gradient(45deg, #ff4444, #ff7a55);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* Contenu du message */
.chat-bubble-content {
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

/* Timestamp */
.chat-bubble-time {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

.chat-bubble:not(.mine) .chat-bubble-time {
    color: #888;
}

/* Indicateur de message système (annonces, etc) */
.chat-bubble-system {
    align-self: center;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #666;
    font-style: italic;
    max-width: 95%;
    text-align: center;
    font-size: 13px;
}

.chat-bubble-system .chat-bubble-content {
    font-size: 13px;
}

/* Effets pour nouveaux messages */
.chat-bubble-new {
    animation: highlightPulse 1s ease;
}

@keyframes highlightPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(252, 226, 0, 0.7);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(252, 226, 0, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(252, 226, 0, 0);
    }
}

/* Style pour les messages avec liens */
.chat-bubble a {
    color: #0066cc;
    text-decoration: underline;
}

.chat-bubble.mine a {
    color: #004080;
}

/* Style pour les messages avec emojis */
.chat-bubble-emoji {
    font-size: 24px;
    line-height: 1;
}

/* Style pour les messages d'erreur */
.chat-bubble-error {
    background: #ffebee;
    border-color: #ffcdd2;
    color: #c62828;
    align-self: center;
    max-width: 90%;
}

/* Animation d'entrée des messages */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style pour les messages groupés (plusieurs messages du même expéditeur) */
.chat-bubble-group {
    margin-top: 2px;
}

.chat-bubble-group:not(:first-child) {
    margin-top: -8px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.chat-bubble-group.chat-bubble.mine:not(:first-child) {
    border-top-right-radius: 8px;
}

.chat-bubble-group:not(.mine):not(:first-child) {
    border-top-left-radius: 8px;
}

/* Style pour l'info viewers */
.viewer-count-bubble {
    align-self: center;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #666;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 15px;
    margin: 5px 0;
}

.viewer-count-bubble i {
    margin-right: 5px;
    color: #ff4444;
}

/* Style pour les messages de bienvenue */
.chat-bubble-welcome {
    background: linear-gradient(45deg, #fce200, #ffd700);
    border: 1px solid #e6d200;
    color: #333;
    align-self: center;
    font-weight: 600;
}

/* Responsive design pour le chat */
@media (max-width: 768px) {
    .chat-bubble {
        max-width: 90%;
        padding: 8px 12px;
    }

    .chat-bubble-content {
        font-size: 13px;
    }

    .chat-bubble-sender {
        font-size: 11px;
    }

    .chat-bubble-time {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .chat-bubble {
        max-width: 95%;
        padding: 7px 10px;
    }
}

/* Styles pour les cartes de stream - compatibles avec ton CSS existant */
.stream-card {
    cursor: pointer;
    position: relative;
    height: 180px;
    width: 100%;
    background: linear-gradient(135deg, #0f0c29, #302b63);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stream-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.live-video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.live-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.live-badge.live {
    background-color: red;
}

.live-badge.ready {
    background-color: #666;
}

.live-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.live-indicator.pulsing {
    animation: pulse 2s infinite;
}

.viewers-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.username-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    z-index: 10;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(15, 12, 41, 0.9), rgba(48, 43, 99, 0.9));
    color: white;
    gap: 10px;
    z-index: 5;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fce200;
    animation: spin 1s linear infinite;
}

.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    transition: background 0.3s;
    z-index: 2;
}

.stream-card:hover .hover-overlay {
    background: rgba(252, 226, 0, 0.1);
}

/* Styles pour la grille responsive - utilisant les classes de ton HTML */
.live-streams {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Responsive grid - identique à ton code original */
@media (min-width: 1200px) {
    .live-streams {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1199px) and (min-width: 992px) {
    .live-streams {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 991px) and (min-width: 768px) {
    .live-streams {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) and (min-width: 576px) {
    .live-streams {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .live-streams {
        grid-template-columns: 1fr;
    }
}