@import url('../fonts/fonts.css');

/* Background général */
body {
    overflow: hidden;
    background-color: #323339;
    height: 100vh;
    /* Force la hauteur à être égale à la hauteur de la fenêtre */
    margin: 0;
    font-family: OpenSans, Arial, sans-serif;
    color: white;
    flex-direction: column;
}

/* Button 1 */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* Espacement entre l'icône et le texte */
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    color: white;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Select */
select {
    padding: 10px;
    border: 1px solid #666;
    /* Bordure grise foncée */
    border-radius: 5px;
    font-size: 16px;
    color: #fff;
    /* Texte blanc */
    background-color: #2b2c32;
    /* Fond gris foncé */
    width: 200px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

/* Style au survol en mode sombre */
select:hover {
    border-color: #999;
}

/* Style au focus en mode sombre */
select:focus {
    border-color: #00aaff;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 170, 255, 0.5);
}

/* Style pour la flèche en mode sombre */
.select-wrapper::after {
    color: #fff;
    /* Flèche blanche */
}

/* Style au focus */
select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* Style pour la flèche (nécessite un peu de triche) */
.select-wrapper {
    position: relative;
    display: inline-block;
}

.select-wrapper::after {
    content: '\25BC';
    /* Flèche vers le bas */
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    pointer-events: none;
    color: #333;
}

/* Style pour désactiver la flèche sur IE */
select::-ms-expand {
    display: none;
}

/* Menu de navigation */
.navbar {
    background-color: #2c2d32;
    /* Couleur plus foncée pour le menu */
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.navbar .logo {
    display: flex;
    align-items: center;
    font-weight: bold;
}

.navbar .logo img {
    height: 40px;
    margin-right: 10px;
}

.navbar .links {
    display: flex;
    gap: 20px;
}

/* Icônes SVG */
.navbar .links a img {
    width: 20px;
    height: 20px;
    padding-top: 5px;
    filter: invert(1);
    /* Rend l'icône blanche pour s'adapter au fond sombre */
}

.navbar .links a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

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

/* Bouton téléchargement du fichier des suppressions */
.navbar .links a.dl {
    color: white;
    background-color: #41bd33;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.navbar .links a.dl:hover {
    transform: scale(1.05);
    /* Légère mise en avant */
}

/* Bouton settings : Open popup*/
.navbar .links a.settings {
    color: white;
    background-color: #bd3c33;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.navbar .links a.settings:hover {
    transform: scale(1.05);
    /* Légère mise en avant */
}

.navbar .info {
    color: white;
    font-size: 14px;
}

/* Div centrée en bas */
.floating-div {
    position: fixed;
    bottom: 20px;
    /* Distance du bas de la fenêtre */
    right: 20px;
    /* Distance du côté droit de la fenêtre */
    transform: none;
    /* Supprime la transformation horizontale */
    display: flex;
    gap: 10px;
    /* Espacement entre les boutons */
    background-color: #2c2d32;
    /* Couleur de fond */
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Boutons stylés avec icônes */
.floating-div a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* Espacement entre l'icône et le texte */
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    color: white;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Icônes SVG */
.floating-div a img {
    width: 20px;
    height: 20px;
    filter: invert(1);
    /* Rend l'icône blanche pour s'adapter au fond sombre */
}

/* Bouton rouge : Delete */
.floating-div a.delete {
    background-color: #e74c3c;
}

.floating-div a.delete:hover {
    transform: scale(1.05);
}

/* Bouton gris : Undo */
.floating-div a.undo {
    background-color: #7f8c8d;
}

.floating-div a.undo:hover {
    transform: scale(1.05);
}

/* Bouton gris : Random */
.floating-div a.random {
    background-color: #e7aa00;
}

.floating-div a.random:hover {
    transform: scale(1.05);
}

/* Bouton bleu : Keep */
.floating-div a.keep {
    background-color: #3498db;
}

.floating-div a.keep:hover {
    transform: scale(1.05);
}

/* Settings view */
.popupSettings {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 31, 35, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Contenu de la popup */
.settings-content {
    background: #323339;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 300px;
    text-align: center;
}

/* Cacher la popup par défaut */
.hiddenSettings {
    display: none;
}

/* Button : Exporter (Svg) */
.popupSettings-content a.exportButton {
    background-color: #1f84c7;
    margin-bottom: 5px;
}

.popupSettings-content a.exportButton:hover {
    transform: scale(1.05);
}

/* Button : Importer (Svg) */
.popupSettings-content a.importButton {
    background-color: #ce7d13;
    margin-bottom: 20px;
}

/* Button : Delete DB */
.popupSettings-content a.deleteDbButton {
    background-color: #e74c3c;
    margin-bottom: 20px;
}

/* Button : Close */
.popupSettings-content a.closeSettings {
    background-color: #bd3c33;
    border-color: white;
}

.popupSettings-content a.closeSettings img {
    width: 30px;
    height: 30px;
    filter: invert(1);
    /* Rend l'icône blanche pour s'adapter au fond sombre */
}

a.ghButton {
    background-color: #24292e;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 5%;
    width: 30%;
    align-self: center;
}

a.ghButton img {
    width: 20px;
    height: 20px;
    filter: invert(1);
    /* Rend l'icône blanche pour s'adapter au fond sombre */
}

.btn:hover {
    transform: scale(1.05);
}

.popupSettings-content a.closeSettings:hover {
    transform: scale(1.05);
}

/* First join : Popup to import the file */
/* Style pour le fond opaque */
.popupImport {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Contenu de la popup */
.popupImport-content {
    background: #323339;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 400px;
    text-align: center;
}

/* Cacher la popup par défaut */
.hiddenImport {
    display: none;
}

/* Output profile and convs show */

/* Conteneur principal pour le profil et la conversation */
#main-container {
    display: flex;
    flex-direction: row;
    gap: 10px;
    /* Espacement entre les colonnes */
    height: 90vh;
    /* Prend toute la hauteur de la fenêtre */
    padding: 10px;
    box-sizing: border-box;
}

/* Section de la conversation */
#conversation {
    flex: 3;
    /* Prend 3/4 de l'espace */
    background-color: #2c2d32;
    /* Fond sombre pour la conversation */
    padding: 5px;
    border-radius: 10px;
    overflow-y: auto;
    /* Ajoute un défilement si le contenu dépasse */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    color: white;
}

/* Section des informations */
#infos {
    flex: 1;
    /* Prend 1/4 de l'espace */
    background-color: #1e1f23;
    /* Fond sombre pour la section des informations */
    padding: 20px;
    border-radius: 10px;
    overflow-y: auto;
    /* Ajoute un défilement si le contenu dépasse */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Style pour l'avatar */
#infos .avatar img {
    border-radius: 50%;
    /* Avatar arrondi */
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin-bottom: 10px;
}

/* Style pour les textes dans #output */
#infos h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

#infos p {
    font-size: 1rem;
    color: #b0b0b0;
    margin: 5px 0;
}

/* Style pour chaque message */
#conversation div {
    display: flex;
    align-items: center;
    /* Centre verticalement l'avatar et le texte */
    gap: 10px;
    /* Espacement entre l'avatar et le texte */
    padding: 10px;
    margin: 10px 0;
    /* Espacement vertical entre les messages */
    background-color: #3a3b41;
    /* Fond des messages */
    border-radius: 8px;
    /* Coins arrondis pour les messages */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    /* Ombre légère pour les messages */
}

/* Style pour l'avatar dans les messages */
.avatarMsg {
    border-radius: 50%;
    /* Avatar arrondi */
    width: 40px;
    /* Taille de l'avatar */
    height: 40px;
    /* Taille de l'avatar */
    object-fit: cover;
    /* Ajuste l'image pour qu'elle remplisse le cadre */
}

/* Style pour le texte dans les messages */
#conversation div strong {
    font-weight: bold;
    color: #ffffff;
    /* Couleur du nom d'utilisateur */
    margin-right: 5px;
    /* Espacement après le nom */
}

#conversation div span {
    color: #fff;
    /* Couleur grise pour le texte des messages */
}

#conversation div span a {
    margin: 0;
    /* Supprime les marges */
    font-size: 1rem;
    /* Taille du texte */
    color: #7BB0F5;
    /* Couleur grise pour le texte des messages */
}

/* Style pour la date d'envoi */
#conversation div time {
    margin-left: auto;
    /* Place la date à droite */
    font-size: 0.8rem;
    /* Taille plus petite */
    color: #8c8c8c;
    /* Couleur grise pour la date */
    font-style: italic;
    /* Style italique pour différencier */
}

#conversation,
#infos {
    box-sizing: border-box;
    /* Inclut le padding et la bordure dans la largeur */
}

/* Style for the recipients list */
.recipient-item {
    display: flex;
    margin-top: 10px;
    padding: 10px;
    background-color: #2c2d32;
    /* Fond sombre pour la liste des participants */
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    /* Ombre légère pour les éléments de la liste */
    text-align: left;
    object-fit: cover;
    /* Ajuste l'image pour qu'elle remplisse le cadre */
    cursor: pointer;
    /* Curseur pointeur pour indiquer que c'est cliquable */
    gap: 10px;
    /* Espacement entre l'avatar et le texte */
    align-items: center;
    /* Centre verticalement l'avatar et le texte */
}

.recipient-info a {
    color: #b0b0b0;
    /* Couleur grise pour le texte */
}

.recipient-avatar img {
    width: 50px;
    border-radius: 50%;
    /* Avatar arrondi */
}

.you-tag {
    color: #b0b0b0;
    /* Couleur bleue pour le tag "You" */
    font-weight: 400;
    /* Met en gras le tag "You" */
    opacity: 0.9;
    font-size: 0.85em;
}

/* Shortcut Overlay */
#shortcutOverlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.85);
    padding: 40px 70px;
    font-size: 48px;
    font-weight: 700;
    font-family: system-ui, sans-serif;
    background: #3b82f6;
    color: #fff;
    border-radius: 28px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .45);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: opacity .12s ease, transform .12s ease;
}

#shortcutOverlay.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Shortcut Settings */
.shortcut-settings {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2d2f34;
    padding: 6px 10px;
    border-radius: 6px;
}

.shortcut-row label {
    flex: 0 0 70px;
    font-size: 14px;
    font-weight: 600;
    color: #ddd;
}

.shortcut-row input.shortcut-input {
    flex: 1;
    background: #1f2124;
    border: 1px solid #3a3d44;
    padding: 6px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
}

.shortcut-row input.shortcut-input:focus {
    outline: 2px solid #3b82f6;
    border-color: #3b82f6;
}

.shortcut-row input.shortcut-input.invalid {
    outline: 2px solid #dc2626;
    border-color: #dc2626;
}

#resetShortcuts {
    background: #444;
}

#resetShortcuts:hover {
    background: #555;
}

/* Mobile-only warning banner (hidden on desktop) */
.mobile-warning {
    display: none;
    /* hidden by default (desktop) */
}

@media (max-width: 500px) {
    .mobile-warning {
        display: block;
        background: #fff3cd;
        /* light amber */
        border-bottom: 1px solid #f7d070;
        color: #000000;
        text-align: center;
        padding: 10px 12px;
        font-size: 16px;
        line-height: 1.35;
        position: sticky;
        /* stays at top when scrolling */
        top: 0;
        z-index: 10000;
    }
}