
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #111;
    color: #fff;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-sizing: border-box;
    position: relative;
    min-height: 100vh;
    padding-bottom: 180px; /* À ajuster selon la hauteur de tes blocs */
    box-sizing: border-box;
}

/*
body {
    position: relative;
    min-height: 100vh;
    padding-bottom: 180px; 
    box-sizing: border-box;
}
*/

#settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer; /* Transforme la souris en petite main */
    user-select: none; /* Empêche de surligner le texte en cliquant trop vite */
    margin-bottom: 15px;
    transition: opacity 0.2s;
}

#settings-header:hover {
    opacity: 0.7; /* Petit effet au survol pour montrer que c'est cliquable */
}

/* On retire la marge du bas quand le panneau est replié pour qu'il soit tout fin */
#settings-panel.collapsed #settings-header {
    margin-bottom: 0;
}

/* La classe magique qui fait disparaître le contenu */
.hidden {
    display: none !important;
}

/* Le conteneur du panneau (identique) */
#settings-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    background-color: #1a1a1a;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #333;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    color: #ffffff;
    font-family: Arial, sans-serif;
}

/* On aligne le texte à gauche et l'interrupteur à droite */
.toggle-setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 20px; /* Espace entre le texte et le bouton */
}

.setting-label {
    font-size: 14px;
}

/* --- LA MAGIE DE L'INTERRUPTEUR (TOGGLE) --- */

/* Le conteneur du bouton */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

/* On masque la vraie checkbox à l'écran */
.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

/* Le fond de l'interrupteur */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #555;
    transition: 0.3s;
    border-radius: 24px; /* Rend les bords ronds */
}

/* Le petit rond blanc à l'intérieur */
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

/* Quand la case (cachée) est cochée : le fond devient violet Twitch */
input:checked + .slider {
    background-color: #9146FF;
}

/* Quand la case est cochée : on décale le rond blanc vers la droite */
input:checked + .slider:before {
    transform: translateX(20px);
}

#selector {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}
input, button, select {
    padding: 10px;
    border-radius: 5px;
    border: none;
    font-size: 16px;
}
input { flex-grow: 1; background: #222; color: white; border: 1px solid #444; }
button { background-color: #9146FF; color: white; cursor: pointer; font-weight: bold; }
button:hover { background-color: #772ce8; }

#app-container {
    display: flex;
    flex-grow: 1;
    gap: 20px;
    height: calc(100% - 80px);
}
#video-container {
    flex: 3;
    background-color: #000;
    position: relative;
}
/* Pour s'assurer que le player Twitch prend tout l'espace disponible */
#twitch-player {
    width: 100%;
    height: 100%;
}
#chat-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #18181b;
    border-radius: 8px;
    border: 1px solid #2f2f35;
    padding: 10px;
}
#chat-header {
    font-weight: bold;
    padding-bottom: 10px;
    border-bottom: 1px solid #2f2f35;
    margin-bottom: 10px;
    color: #adadb8;
}
#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}
.message { line-height: 1.4; }
.username { font-weight: bold; color: #9146FF; }

#controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* #bluetooth-panel {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: #18181b;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #2f2f35;
    margin-top: 20px;
} */

/*
 #bluetooth-panel { 
    position: absolute;
    bottom: 20px;
    left: 2%;
    width: 62%; 
    box-sizing: border-box;
}
*/

#interaction {
  position: fixed;
  bottom: 0;
  width: 100%; /* Optionnel : pour qu'il prenne toute la largeur */
}

#btn-bluetooth {
    background-color: #0082FC;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

#btn-bluetooth:hover { 
    background-color: #006bce; 
}

#ble-info {
    font-size: 15px;
    color: #adadb8;
}

#ble-name {
    font-weight: bold;
    color: #ff4a4a; /* Rouge quand déconnecté */
    margin-left: 5px;
    padding: 4px 8px;
    background-color: rgba(255, 74, 74, 0.1);
    border-radius: 4px;
}

/* Classe ajoutée dynamiquement via JavaScript quand un appareil est connecté */
#ble-name.connected {
    color: #00ff00;
    background-color: rgba(0, 255, 0, 0.1);
}

#bike-dashboard {
    display: none; /* Masqué par défaut */
    background-color: #18181b;
    border: 1px solid #2f2f35;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

#bike-dashboard.active {
    display: block; /* Affiché quand connecté */
}

.metric-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.metric-box {
    flex: 1;
    background-color: #222;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.metric-value {
    font-size: 24px;
    font-weight: bold;
    color: #00ff00;
}

/*
.metric-label {
    font-size: 12px;
    color: #adadb8;
    text-transform: uppercase;
}
*/

#bike-features {
    font-size: 13px;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.feature-badge {
    background-color: #333;
    padding: 3px 8px;
    border-radius: 12px;
}

/*
#twitch-reactions-panel {
    background-color: #18181b;
    border: 1px solid #2f2f35;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}*/

.reactions-grid {
    display: flex;
    gap: 10px;
}

.btn-reaction {
    flex: 1; /* Les boutons prennent tous la même largeur */
    background-color: #2f2f35;
    color: white;
    border: none;
    padding: 15px;
    font-size: 24px; /* On grossit les emojis */
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-reaction:hover {
    background-color: #4a4a52; /* S'éclaircit au survol */
}

.btn-reaction:active {
    transform: scale(0.92); /* Effet d'enfoncement au clic */
    background-color: #0082FC; /* Devient bleu Twitch au clic */
}

/*
#twitch-reactions-panel {
    position: fixed;
    bottom: 20px;
    right: 2%;
    width: 32%; 
    box-sizing: border-box;
}
*/


/* Optionnel : Si tu veux que tes smileys soient alignés en carré dans leur tiers droit */
/*
#twitch-reactions-panel div[style*="display: flex"], 
.reactions-grid { 
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
*/