body {
    font-family: "Segoe UI", sans-serif;
    background-color: #36393f;
    color: #dcddde;
    padding: 0;
    margin: 0;
}

.channel-header {
    background-color: rgba(47, 49, 54, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 20px;
    border-bottom: 1px solid rgba(32, 34, 37, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.channel-info {
    display: flex;
    flex-direction: column;
}

.channel-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.channel-topic {
    font-size: 12px;
    color: #b9bbbe;
    margin-top: 4px;
}

/* Burger menu et popup */
.burger-menu {
    position: relative;
    cursor: pointer;
}

.burger-icon {
    width: 24px;
    height: 24px;
    color: #b9bbbe;
    transition: color 0.2s;
}

.burger-icon:hover {
    color: #ffffff;
}

.stats-popup {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: rgba(24, 25, 28, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 8px;
    width: 240px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.24);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease-in-out, visibility 0.15s ease-in-out;
    pointer-events: none;
}

.stats-popup.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.stats-content {
    padding: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.stat-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    color: #b9bbbe;
    font-size: 14px;
}

.stat-value {
    color: #ffffff;
    font-weight: 500;
}

.chat-log {
    padding: 20px;
}

.message-block {
    display: flex;
    margin: 12px 0;
    padding-left: 16px;
    align-items: flex-start;
}

.message {
    transition: background-color 0.2s ease;
    display: flex;
    margin: 0;
    padding: 8px 20px;
    align-items: flex-start;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
}

.message:hover {
    background-color: rgba(39, 41, 46, 0.3);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    cursor: pointer;
}

.message-content {
    flex: 1;
    margin-top: 2px;
}

.username {
    font-weight: 600;
    color: #ffffff;
    margin-right: 8px;
}

.timestamp {
    font-size: 12px;
    color: #72767d;
}

.content {
    white-space: pre-wrap;
    font-size: 14px;
    color: #dcddde;
    margin-top: 2px;
}

/* Style des attachements */
.attachments {
    margin-top: 8px;
    margin-bottom: 8px;  /* Ajout d'une marge en bas */
}

.attachment-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: fit-content;
    max-width: 400px;
    color: #00b0f4;
    text-decoration: none;
    background: rgba(47, 49, 54, 0.6);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 4px 4px 4px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
}

.attachment-link:hover {
    background: rgba(255, 255, 255, 0.025);
}

.attachment-disabled {
    display: inline-flex;
    align-items: center;
    color: #72767d;
    background: rgba(47, 49, 54, 0.3);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 4px 4px 4px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
}

.attachment-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.attachment-icon {
    width: 20px;
    height: 20px;
    fill: white;
}

.attachment-details {
    display: flex;
    flex-direction: column;
}

.attachment-size {
    font-size: 12px;
    color: #989aa2;
}

.download-icon {
    margin-left: 16px;
    width: 20px;
    height: 20px;
    fill: white;
}

/* Style des embeds */
.embed {
    margin-top: 8px;
    padding: 8px 12px;
    background: #2f3136;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 4px;
    max-width: 520px;
}

.embed-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    text-decoration: none;
}

.embed-title[href] {
    color: #00b0f4;
    text-decoration: none;
}

.embed-title[href]:hover {
    text-decoration: underline;
}

.embed-description {
    color: #dcddde;
    font-size: 14px;
    margin-bottom: 8px;
}

.embed-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.embed-field {
    margin: 0;
}

.embed-field.inline {
    grid-column: span 1;
}

.embed-field:not(.inline) {
    grid-column: 1 / -1;
}

.field-name {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 2px;
}

.field-value {
    color: #dcddde;
    font-size: 0.9em;
}

.embed-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    color: #dcddde;
    font-size: 12px;
    padding-top: 8px;
}

.footer-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.footer-text {
    color: #dcddde;
}

.embed-timestamp {
    color: #dcddde;
    font-size: 0.85em;
    opacity: 0.7;
}

.embed-image {
    margin: 16px 0;
    max-width: 100%;
}


.embed-image img {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    margin-top: 16px;
    border-radius: 4px;
}


.embed-author {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.embed-author-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
}

.embed-author-name {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.embed-author-name:hover {
    text-decoration: underline;
}

.embed-thumbnail {
    float: right;
    margin-left: 16px;
    max-width: 150px;
    max-height: 150px;
    border-radius: 4px;
    overflow: hidden;
}

.embed-thumbnail img {
    width: 150px;
    height: 150px;
    object-fit: cover;
}

/* Components */
.message-components {
    margin-top: 8px;
}

.component-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 2px 16px;
    min-height: 32px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: rgba(98, 158, 255, 0.1);
    color: white;
}

.btn-primary:hover {
    background-color: rgba(98, 158, 255, 0.2);
}

.btn-secondary {
    background-color: rgba(77, 80, 85, 0.1);
    color: white;
}

.btn-secondary:hover {
    background-color: rgba(77, 80, 85, 0.2);
}

.btn-success {
    background-color: rgba(99, 255, 125, 0.1);
    color: white;
}

.btn-success:hover {
    background-color: rgba(99, 255, 125, 0.2);
}

.btn-danger {
    background-color: rgba(255, 86, 86, 0.1);
    color: white;
}

.btn-danger:hover {
    background-color: rgba(255, 86, 86, 0.2);
}

.btn-link {
    background-color: #5757572e;
    color: white;
    text-decoration: none;
}

.btn-link:hover {
    background-color: #6666662e;
}

/* Select Menu */
.select-menu {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 12px;
    background: #2f3136;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    cursor: pointer;
    min-height: 28px;
}

.select-menu.disabled {
    opacity: 0.5;
}

.select-placeholder {
    color: #dcddde;
    font-size: 14px;
}

.select-arrow {
    font-size: 12px;
    color: #b9bbbe;
}

.select-options {
    position: absolute;
    left: 0;
    right: 0;
    border-radius: 4px;
    margin-top: 4px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.2s ease-in-out;
    z-index: 100;
}

.select-option {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    background-color: #2f3136;
}

.select-option:hover {
    background: #2b2d31;
}

.select-menu.active .select-options {
    max-height: 300px;
    opacity: 1;
}

.option-label {
    margin-right: 8px;
    color: #dcddde;
}

.option-description {
    font-size: 12px;
    color: #b9bbbe;
}

.component-emoji {
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
}

/* Ajustements pour les composants dans les messages avec embed */
.embed + .message-components {
    margin-top: 16px;
}

/* Style des réactions */
.reactions {
    margin-top: 8px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.reaction {
    background: rgba(47, 49, 54, 0.3);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.reaction:hover {
    background: rgba(255, 255, 255, 0.05);
}

.reaction .emoji {
    vertical-align: middle;
    width: 1.3em;
    height: 1.3em;
    margin-right: 4px;
}

.twemoji {
    height: 1.375em;
    width: 1.375em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
    display: inline-block;
}

/* Super réactions (Nitro) */
.reaction.super-reaction {
    background: linear-gradient(to right, rgba(88, 101, 242, 0.3), rgba(88, 101, 242, 0.1));
    border-color: rgba(88, 101, 242, 0.3);
}

.reaction.super-reaction:hover {
    background: linear-gradient(to right, rgba(88, 101, 242, 0.4), rgba(88, 101, 242, 0.2));
}

/* Ajustement pour les réactions sous les embeds */
.embed + .reactions {
    margin-top: 12px;
}

/* Spoiler */
.spoiler-container {
    display: inline-block;
    background: #202225;
    border-radius: 3px;
    cursor: pointer;
    padding: 0 4px;
}

.spoiler-hidden {
    color: transparent;
}

.spoiler-hidden::before {
    content: 'SPOILER';
    position: absolute;
    color: #dcddde;
    font-size: 10px;
    font-weight: 500;
}

.spoiler-revealed {
    color: #dcddde;
    background: rgba(255,255,255,0.1);
}

/* Code */
.inline-code {
    background: #2f3136;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Consolas', monospace;
    font-size: 14px;
}

.code-block {
    background: #2f3136;
    border-radius: 4px;
    padding: 8px;
    margin: 6px 0;
}

.code-block pre {
    margin: 0;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Consolas', monospace;
    color: #dcddde;
    display: block;
}

.language-py {
    color: #569cd6;
}

.strikethrough {
    text-decoration: line-through;
}

.underline {
    text-decoration: underline;
}

.list-item {
    margin: 2px 0;
}

.quote-multiple {
    border-left: 4px solid #4f545c;
    margin: 8px 0;
    padding: 0 8px;
    color: #b9bbbe;
}

.discord-h1 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 0.5em 0;
}

.discord-h2 {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0.4em 0;
}

.discord-h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0.3em 0;
}

.discord-secondary {
    font-size: 0.85em;
    color: #989aa2;
    margin: 0.2em 0;
}

/* Emoji custom */
.emoji {
    width: 1.375em;
    height: 1.375em;
    vertical-align: bottom;
    object-fit: contain;
}

/* Rôles */
.role-tag {
    font-size: 12px;
    padding: 0 4px;
    border-radius: 3px;
    margin-right: 4px;
    display: inline-block;
}

/* Badge BOT */
.bot-badge {
    background: #5865f2;
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    font-weight: 500;
}

/* Message édité */
.edited-tag {
    font-size: 11px;
    color: #72767d;
    margin-left: 4px;
}

/* Message reply */
.reply-container {
    color: #00b0f4;
    font-size: 12px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Markdown */
blockquote {
    border-left: 4px solid #4f545c;
    margin: 8px 0;
    padding: 0 8px;
    border-radius: 2px;
    color: #b9bbbe;
}

.mention {
    color: #00b0f4;
    background: rgba(88, 101, 242, 0.1);
    padding: 0 2px;
    border-radius: 3px;
    cursor: pointer;
}

.mention:hover {
    background: rgba(88, 101, 242, 0.2);
}

/* Mini-profil */
.user-popup {
    position: fixed;
    background: rgba(24, 25, 28, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 8px;
    width: 300px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.24);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease-in-out, visibility 0.15s ease-in-out;
    pointer-events: none;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
}

.user-popup.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.user-banner {
    height: 120px;
    background-size: cover !important;
    background-position: center !important;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    padding: 16px;
    margin-top: -40px;
    background: rgba(24, 25, 28, 0.3);
    border-radius: 0 0 8px 8px;
}

.popup-avatar {
    z-index: 1000;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #18191c;
    border: 6px solid #18191c;
}

.user-details {
    margin-top: 8px;
}

.user-name {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.user-id {
    color: #b9bbbe;
    font-size: 12px;
    margin-top: 4px;
}

.user-roles {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 150px;
    overflow-y: auto;
    padding: 4px;
}

.user-popup .role-tag {
    cursor: default;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    background: rgba(47, 49, 54, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s;
}

.user-popup .role-tag:hover {
    background: rgba(47, 49, 54, 0.5);
}

.user-roles::-webkit-scrollbar {
    width: 8px;
}

.user-roles::-webkit-scrollbar-track {
    background: #2f3136;
    border-radius: 4px;
}

.user-roles::-webkit-scrollbar-thumb {
    background: #202225;
    border-radius: 4px;
}