:root {
    --background: #0D1514;
    --text-color: #d6f7ed;
    --primary-color: #29A383;
    --card-color: #0D2D2A;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: var(--background);
    color: var(--text-color);
    font-family: "all-round-gothic", sans-serif;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: left;
    width: 50%;
    height: 100px;
    z-index: 10000;
}

.header {
    position: absolute;
    left: 20px;
    top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 600px;
    max-width: 100%;
    height: 70px;
    background: var(--card-color);
    border: 1px solid var(--primary-color);
    border-radius: 70px;
    padding: 0 16px;
    z-index: 10000;
}

/* Zone user + logout */
.userbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 30px;
    background: transparent;
    z-index: 10001;
}

.userbox .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #000;
}

.userbox .displayname {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    margin-left: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
}

.logout-btn:hover {
    background: #1a3a34;
}

.header .logo {
    height: 70px;
    position: absolute;
    left: 0;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 60px;
}

.header .spar {
    height: calc(100% - 20px);
    position: relative;
    top: 0px;
    background-color: var(--primary-color);
    width: 2px;
}


.addGuildBtn {
    position: relative;
    left: 50%;
    transform: translate(-50%, 0);
    margin-top: 30px;
    bottom: 5px;
    border: 1px solid var(--border);
    background: var(--primary);
    outline: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}

h1 {
    font-size: 20px;
    margin: 0;
}

.btn {
    padding: 20px 10px;
    border-radius: 50px;
    text-decoration: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-color);
    transition: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn img {
    display: inline-block;
    height: 20px;
    vertical-align: middle;
    margin-right: 0.5em;
}


.btn.primary {
    width: 200px;
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0);
    margin-top: 30px;
    border: 1px solid var(--card-color);
    background: var(--primary-color);
    box-shadow: 0 0 10px #29A383;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn:disabled {
    border: 1px solid var(--card-color);
    background: #28423B;
    box-shadow: 0 0 0px #29A383;
}


.btn.primary:hover {
    filter: brightness(1.1);
}

.btn.backTo {
    width: 100px;
    position: absolute;
    left: -15px;
    bottom: -15px;
    margin-top: 30px;
    border: none;
    background-color: transparent;
    padding: 10px;
    border-radius: 0;
    text-decoration: underline;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Discord-styled button */
.btn.discord {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #5865F2;
    /* Blurple */
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 24px;
    font-weight: 600;
}

.btn.discord:hover {
    background: #4752C4;
}

.btn.discord:active {
    background: #3C45A5;
}

.btn.discord img {
    height: 20px;
    filter: invert(1);
}

.btn.discord .discord-logo {
    width: 24px;
    height: 24px;
    display: inline-block;
    fill: currentColor;
}

.auth {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 200px);
}

.auth h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.auth p {
    font-size: 16px;
    margin-bottom: 30px;
    max-width: 400px;
    text-align: center;
}

main {
    padding: 16px;
}

.step-part {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 370px;
    height: calc(100% - 120px);
}

.stpesep {
    position: absolute;
    left: 390px;
    bottom: 20px;
    height: calc(100% - 50px);
    width: 2px;
    background-color: var(--primary-color);
}

.stepper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 8px;
    width: 350px;
    max-height: 500px;
    height: calc(100% - 240px);
}

.step-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px;
    color: var(--muted);
    width: 100%;
    height: 100%;
    font-size: 16px;
    border-radius: 100px;
}

.step-item.active {
    background-color: #29a3821b;
}

.step-index {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 600;
}

.step-sep {
    flex: 1;
    height: 1px;
    background: var(--primary-color);
}

.step {
    display: none;
    position: absolute;
    left: 410px;
    bottom: 20px;
    height: calc(100vh - 150px);
    max-height: calc(100vh - 150px);
    overflow: autom;
    width: calc(100% - 410px);
}

.step.visible {
    display: block;
}

.step h3 {
    margin-bottom: 40px;
}


.actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 12px;
}

.hidden {
    display: none;
}

.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

select,
textarea {
    min-height: 200px;
    color: var(--text-color);
    font-family: "all-round-gothic", sans-serif;
    font-size: 16px;
    background-color: var(--card-color);
    border: 1px solid var(--primary-color);
    border-radius: 40px;
    padding: 20px;
}

textarea::placeholder {
    color: var(--primary-color);
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.panel {
    padding: 12px;
    border: 1px solid #26304c;
    border-radius: 12px;
    min-height: 200px;
    min-width: 700px;
    max-height: calc(100% - 100px);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    flex-direction: column;
}

.apercuapn {
    width: calc(100% - 500px);
    min-width: 0;
    max-height: calc(100% - 200px);
    padding: 0 !important;
    padding-top: -10px !important;
    border: none;
    justify-content: start;
    overflow: auto;
    scrollbar-width: thin;
    border-radius: 20px !important;
    scrollbar-color: var(--primary-color) var(--card-color);
}

/* Scrollbar stylée pour Chrome, Edge, Safari */
.apercuapn::-webkit-scrollbar {
    width: 8px;
    background: var(--card-color);
    border-radius: 8px;
}

.apercuapn::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 8px;
}

.apercuapn::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color-hover, #5eba9d);
}

.panel h3 {
    margin-top: 0;
}


#preview {
    width: calc(100% - 30px);
}


.h4preview {
    position: relative;
}

.roles,
.channels {
    background: #101628;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #1f2744;
}

.role {
    margin: 4px 0;
    font-size: 14px;
}

.category {
    margin-bottom: 10px;
}

.name {
    font-weight: bold;
    color: var(--muted);
    margin-bottom: 10px;
}

.name::after {
    content: ' ';
    display: block;
    position: relative;
    top: 2px;
    width: 100%;
    height: 1px;
    background: var(--text);
}

.channel {
    margin-left: 8px;
    opacity: 0.95;
}

.channel .text::before {
    content: '# ';
    color: var(--muted);
}

.channel .voice::before {
    content: '🔊 ';
}

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

    #preview {
        grid-template-columns: 1fr;
    }
}

.chat {
    height: 360px;
    overflow: auto;
    color: var(--text-color);
    font-family: "all-round-gothic", sans-serif;
    font-size: 16px;
    background-color: var(--card-color);
    border: 1px solid var(--primary-color);
    border-radius: 40px;
    padding: 20px;
    margin-inline: 10px;
    width: calc(100% - 20px);
}

.chat .msg {
    margin: 6px 0;
}

.chat .me {
    color: #c1d1ff;
}

.chat .ai {
    color: #a0ffcf;
}

.chat-input {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-inline: 10px;
    gap: 8px;
    margin-top: 25px;
}

.chat-input input {
    flex: 1;
    width: 100%;
    background: var(--card-color);
    color: var(--text-color);
    border: 1px solid var(--primary-color);
    border-radius: 40px;
    padding: 8px;
    min-height: 60px;
}

.chat-input .btn.primary {
    position: relative !important;
    background-color: var(--card-color);
    border: var(--primary-color) solid;
    margin-top: 10px;
}

.guild-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 500px));
    gap: 12px;
    justify-content: center;
    width: calc(100% - 300px);
    position: relative;
    left: 50%;
    transform: translate(-50%, 0);
}

.guild-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    border: 1px solid var(--primary-color);
    height: 80px;
    background: var(--card-color);
    border-radius: 40px;
    cursor: pointer;
    transition: .3s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.guild-card:hover {
    border-color: var(--text-color);
}

.guild-card.selected {
    border-color: var(--text-color);
    background-color: var(--primary-color);
}

.guild-icon {
    width: 67px;
    height: 67px;
    border-radius: 50%;
    background: #0e1426;
    object-fit: cover;
}

.guild-name {
    font-weight: 600;
}

.active-features {
    margin: 15px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-ticket {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.badge-counter {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
}

.blueprint-preview {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #404040;
}

.blueprint-preview h3 {
    color: #fff;
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
}

.blueprint-preview h4 {
    color: #fff;
    margin: 20px 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #404040;
    padding-bottom: 8px;
}

.section {
    margin-bottom: 25px;
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.role-item {
    background: #333;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid;
}

.role-name {
    color: #fff;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

.role-perms {
    color: #aaa;
    font-size: 12px;
    font-family: monospace;
}

.category {
    background: #333;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.category-name {
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
}

.channels-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #404040;
    border-radius: 6px;
}

.channel-icon {
    font-size: 16px;
}

.channel-name {
    color: #fff;
    font-weight: 500;
}

.channel-topic {
    color: #aaa;
    font-size: 7px;
    max-width: 100px;
    font-style: italic;
    margin-left: auto;
}

.voice-channel {
    border-left: 3px solid #4ecdc4;
}

.text-channel {
    border-left: 3px solid #ff6b6b;
}

.channel-feature {
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
}

.feature-item {
    background: #333;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid;
}

.feature-ticket {
    border-left-color: #ff6b6b;
}

.feature-counter {
    border-left-color: #4ecdc4;
}

.feature-header {
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
}

.feature-details {
    color: #ccc;
    font-size: 14px;
}

.feature-details>div {
    margin-bottom: 5px;
}

.feature-details strong {
    color: #fff;
}

.progress-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.progress-content {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #404040;
}

.progress-content h3 {
    color: #fff;
    margin: 0 0 20px 0;
    text-align: center;
    font-size: 24px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #404040;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #44a08d);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: #fff;
    text-align: center;
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: 600;
}

.progress-steps {
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid #404040;
    padding-top: 20px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #333;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #4ecdc4;
}

.step-icon {
    font-size: 18px;
    min-width: 24px;
}

.step-message {
    color: #fff;
    font-size: 14px;
}

/* Popup de génération en cours */
.generation-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(12, 14, 14, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    transition: opacity 0.3s ease;
}

.generation-popup.hidden {
    opacity: 0;
    pointer-events: none;
}

.generation-content {
    text-align: center;
    color: var(--text-color);
    max-width: 500px;
    padding: 40px;
}

.generation-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid var(--card-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

.generation-content h2 {
    font-size: 32px;
    margin: 0 0 20px 0;
    color: var(--primary);
}

.generation-content p {
    font-size: 18px;
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

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

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

/* Message d'erreur d'accès refusé */
.access-denied-error {
    text-align: center;
    padding: 40px 20px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 12px;
    margin-top: 20px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.access-denied-error h3 {
    color: #dc3545;
    margin: 0 0 15px 0;
    font-size: 24px;
}

.access-denied-error p {
    margin: 10px 0;
    color: var(--muted);
    line-height: 1.5;
}

.access-denied-error strong {
    color: var(--text);
}

.chat-info {
    margin-top: 20px;
    font-size: 10px;
    color: var(--text-color);
}

.chat-info strong {
    color: var(--text-color);
    font-size: 13px;
}

/* Menu contextuel */
.context-menu {
    position: fixed;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    font-size: 14px;
}

.context-menu-title {
    padding: 8px 16px;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.context-menu-separator {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.context-menu-option {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-menu-option:hover {
    background: var(--primary);
    color: var(--bg);
}

/* Améliorer l'interactivité des éléments dans l'aperçu */
.role,
.category .name,
.channel span {
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 4px;
    padding: 2px 6px;
    margin: 2px 0;
}

.role:hover,
.category .name:hover,
.channel span:hover {
    background: rgba(94, 190, 168, 0.1);
    border: 1px solid rgba(94, 190, 168, 0.3);
}

/* Indicateur visuel pour les éléments cliquables */
.role::after,
.category .name::after,
.channel span::after {
    content: '⏷';
    opacity: 0;
    margin-left: 8px;
    font-size: 12px;
    transition: opacity 0.2s ease;
}

.role:hover::after,
.category .name:hover::after,
.channel span:hover::after {
    opacity: 0.5;
}

/* Modale d'options du serveur */
.server-options-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(12, 14, 14, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15000;
    animation: fadeIn 0.3s ease;
}

.server-options-content {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease;
}

.server-options-header {
    text-align: center;
    margin-bottom: 25px;
}

.server-options-header h3 {
    color: var(--primary);
    margin: 0 0 10px 0;
    font-size: 24px;
}

.server-options-header p {
    color: var(--muted);
    margin: 0;
    font-size: 16px;
}

.server-config-info {
    background: rgba(94, 190, 168, 0.1);
    border: 1px solid rgba(94, 190, 168, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.server-config-info h4 {
    color: var(--primary);
    margin: 0 0 15px 0;
    font-size: 18px;
}

.config-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.config-label {
    display: block;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 5px;
}

.config-value {
    display: block;
    color: var(--text);
    font-size: 20px;
    font-weight: 600;
}

.server-options-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.server-options-buttons .btn {
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
}

.server-options-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 5px rgba(94, 190, 168, 0.3);
}

.server-options-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.server-options-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Étape 1.5 - Sélection du mode d'opération */
.operation-mode-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
    width: 100%;
    height: calc(100% - 40px - 50px);
    padding: 20px;
}

.mode-card {
    background: var(--card-color);
    border: 2px solid var(--primary-color);
    border-radius: 30px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
    height: calc(100% - 20px);
    min-width: 300px;
}

.mode-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px #5ebea833;
}

.mode-card:active {
    transform: translateY(-2px);
}

.mode-card.selected {
    border-color: var(--primary);
    background: rgba(94, 190, 168, 0.1);
}

.mode-card .btn.primary {
    bottom: 20px;
}

.mode-card h4 {
    margin-top: 13px;
    margin-bottom: 20px;
    font-size: 26px;
}

.mode-card p {
    color: var(--muted);
    margin-top: 40px;
    margin-bottom: 40px;
    line-height: 1.6;
    font-size: 18px;
    max-width: calc(100% - 70px);
    margin-left: 20px;
}

.mode-card hr {
    width: 100%;
    outline: none;
    border: 1px var(--primary-color) solid;
}

.current-config-info {
    background: var(--primary-color);
    border: 1px solid var(--background);
    border-radius: 40px;
    height: 80px;
    width: calc(100% - 20px);
    max-width: 400px;
    position: relative;
    left: calc(50%);
    transform: translate(-50%, 0);
    padding: 0;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-direction: row;
}

.config-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.config-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    height: 80px;
    width: 100%;
}

.config-item .spar {
    height: calc(100%);
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--card-color);
    width: 2px;
}

.config-label {
    display: block;
    color: var(--muted);
    font-size: 16px;
    margin-bottom: 5px;
}

.config-value {
    display: block;
    color: var(--text);
    font-size: 22px;
    font-weight: 800;
}

.warning-apply {
    background: #A32929;
    border: 1px solid rgb(0, 0, 0);
    border-radius: 40px;
    padding: 15px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 20px);
    max-width: 500px;
    text-align: center;
    position: relative;
    left: 50%;
    transform: translate(-50%, 0);
}

.warning-info {
    background: #A32929;
    border: 1px solid rgb(0, 0, 0);
    border-radius: 40px;
    padding: 15px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 20px);
    max-width: 500px;
    text-align: center;
    position: relative;
    left: 50%;
    transform: translate(-50%, 0);
}

.warning-info strong {
    font-size: 23px;
}

.warning-info p {
    margin: 0;
    padding: 0;
    width: 90%;
    position: relative;
    left: 50%;
    transform: translate(-50%, 0);
    color: var(--text-color);
    font-size: 17px;
}

.applywarn {
    margin-top: 120px;
}

.prompt-init {
    height: 200px;
    width: calc(100% - 20px);
    position: relative;
    left: 50%;
    transform: translate(-50%, 0);
    max-width: 700px;
    resize: vertical !important;

}

/* Responsive pour l'étape 1.5 */
@media (max-width: 768px) {
    .operation-mode-selection {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mode-card {
        padding: 20px;
    }
}

.current-config-badge {
    background: var(--primary);
    color: var(--bg);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 10px;
}


.chat-pannel {
    width: 450px;
    position: absolute;
    right: 30px;
    top: 0;
    background-color: var(--background);
    border-radius: 0px;
    height: 400px;
}

/* Interface Discord-like pour l'aperçu */
.discord-interface {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    background: #36393f;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #202225;
}

/* Barre latérale gauche - Rôles */
.discord-sidebar {
    background: #2f3136;
    padding: 16px 0;
    border-right: 1px solid #202225;
}

.sidebar-header {
    padding: 0 16px 16px 16px;
    color: #96989d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid #40444b;
    margin-bottom: 16px;
}

.header-icon {
    margin-right: 8px;
}

.discord-role {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: #dcddde;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.discord-role:hover {
    background: #40444b;
}

.role-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.role-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Zone principale - Catégories et salons */
.discord-main {
    background: #36393f;
    padding: 16px;
    width: 100%;
    overflow-y: auto;
}

.main-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #40444b;
    margin-bottom: 16px;
}

.server-name {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.member-count {
    font-size: 14px;
    color: #96989d;
}

.discord-category {
    margin-bottom: 24px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: #96989d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: color 0.1s ease;
}

.category-header:hover {
    color: #dcddde;
}

.category-icon {
    font-size: 14px;
}

.category-count {
    margin-left: auto;
    font-size: 11px;
    opacity: 0.7;
}

.discord-channel {
    display: flex;
    align-items: center;
    gap: 0px;
    padding: 6px 5px;
    margin: 2px 0;
    color: #96989d;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.1s ease;
}

.discord-channel:hover {
    background: #40444b;
    color: #dcddde;
}

.channel-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.channel-name {
    flex: 1;
}

.channel-topic {
    font-size: 12px;
    opacity: 0.7;
    font-style: italic;
}

/* Panneau d'informations à droite */
.discord-info-panel {
    background: #2f3136;
    padding: 16px;
    border-left: 1px solid #202225;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid #40444b;
    margin-bottom: 16px;
    color: #96989d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.info-icon {
    font-size: 14px;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.info-label {
    color: #96989d;
    font-size: 14px;
}

.info-value {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
}

/* Panneau des permissions */
.permissions-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2f3136;
    border: 1px solid #40444b;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    min-width: 500px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.permissions-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #40444b;
    background: #36393f;
    border-radius: 8px 8px 0 0;
}

.permissions-icon {
    font-size: 18px;
}

.permissions-title {
    flex: 1;
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
}

.close-permissions {
    background: none;
    border: none;
    color: #96989d;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.1s ease;
}

.close-permissions:hover {
    background: #40444b;
    color: #ffffff;
}

.permissions-content {
    padding: 16px;
}

.permission-overwrite {
    background: #36393f;
    border: 1px solid #40444b;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

.cartapl {
    width: 300px;
}

.centered {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.overwrite-role {
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #40444b;
}

.permission-list {
    margin-bottom: 12px;
}

.permission-list:last-child {
    margin-bottom: 0;
}

.permission-type {
    display: block;
    color: #96989d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.permission-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.permission-item {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.permission-item.allow {
    background: #43b581;
    color: #ffffff;
}

.permission-item.deny {
    background: #f04747;
    color: #ffffff;
}

.no-permissions {
    color: #96989d;
    font-style: italic;
    font-size: 12px;
}

.no-overwrites {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 16px;
    text-align: center;
    color: #96989d;
}

.no-overwrites-icon {
    font-size: 32px;
    opacity: 0.7;
}

.no-overwrites-text {
    font-size: 14px;
    line-height: 1.4;
}


.auth-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-origin: padding-box;
    gap: 10px;
    border: 1px solid var(--primary-color);
    background-color: var(--card-color);
    border-radius: 20px;
}

.auth-content hr {
    width: 100%;
    border-color: var(--primary-color);
}


/* Responsive */
@media (max-width: 1200px) {
    .discord-interface {
        grid-template-columns: 200px 250px 1fr;
    }
}

@media (max-width: 900px) {
    .discord-interface {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .discord-sidebar,
    .discord-info-panel {
        border: none;
        border-bottom: 1px solid #40444b;
    }
}

#toStep5 {
    left: calc((100% - 380px)/2);
}

/* ========================================
   RESPONSIVE TÉLÉPHONE (MOBILE FIRST)
   ======================================== */

@media (max-width: 768px) {

    /* Variables pour mobile */
    :root {
        --mobile-padding: 16px;
        --mobile-border-radius: 20px;
        --mobile-font-size: 14px;
    }

    /* Reset général pour mobile */
    * {
        box-sizing: border-box;
    }

    html,
    body {
        margin: 0;
        padding: 0;
        height: 100%;
        overflow-x: hidden;
    }

    body {
        font-size: var(--mobile-font-size);
        line-height: 1.4;
    }
    header{
        width: 70%;
    }
    /* Zone utilisateur mobile */
    .userbox {
        gap: 8px;
        padding: 4px 8px;
        border-radius: 20px;
    }

    .userbox .avatar {
        width: 28px;
        height: 28px;
    }

    .userbox .displayname {
        max-width: 120px;
        font-size: 12px;
    }

    .logout-btn {
        position: fixed;
        top: 15px;
        right: 15px;
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 15px;
        z-index: 10001;
    }

    .stpesep {
        display: none;
    }

    .stepper {
       display: none;
    }

    .step-sep {
        display: none;
    }

    /* Contenu des étapes mobile */
    .step {
        position: relative;
        left: 0;
        bottom: auto;
        height: auto;
        max-height: none;
        width: 100%;
        margin-top: 120px;
        padding: 0 var(--mobile-padding);
    }

    .step.visible {
        display: block;
    }

    .step h3 {
        margin-bottom: 20px;
        font-size: 20px;
        text-align: center;
    }

    /* Grilles et layouts mobile */
    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .guild-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        width: 100%;
        left: 0;
        transform: none;
        padding: 0;
    }

    .guild-card {
        height: 70px;
        border-radius: 20px;
        padding: 8px;
    }

    .guild-icon {
        width: 55px;
        height: 55px;
    }

    .guild-name {
        font-size: 14px;
    }

    /* Sélection du mode d'opération mobile */
    .operation-mode-selection {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px 0;
        width: 100%;
        height: auto;
        padding: 0;
    }

    .mode-card {
        min-width: auto;
        height: auto;
        padding: 20px;
        border-radius: 20px;
    }

    .mode-card h4 {
        font-size: 20px;
        margin: 10px 0 15px 0;
    }

    .mode-card p {
        font-size: 14px;
        margin: 20px 0;
        max-width: 100%;
        margin-left: 0;
    }

    .mode-card .btn.primary {
        position: relative !important;
        bottom: auto;
        margin-top: 20px;
    }

    /* Configuration actuelle mobile */
    .current-config-info {
        height: 60px;
        width: 100%;
        max-width: none;
        left: 0;
        transform: none;
        border-radius: 20px;
        margin-top: 15px;
    }

    .config-item {
        height: 60px;
    }

    .config-label {
        font-size: 12px;
    }

    .config-value {
        font-size: 16px;
    }

    /* Avertissements mobile */
    .warning-apply,
    .warning-info {
        width: 100%;
        max-width: none;
        left: 0;
        transform: none;
        border-radius: 20px;
        padding: 12px;
        margin-top: 15px;
    }

    .warning-info strong {
        font-size: 18px;
    }

    .warning-info p {
        font-size: 14px;
        width: 100%;
        left: 0;
        transform: none;
    }

    .applywarn {
        margin-top: 80px;
    }

    /* Formulaires et inputs mobile */
    select,
    textarea {
        min-height: 150px;
        font-size: 14px;
        border-radius: 20px;
        padding: 15px;
    }

    .prompt-init {
        height: 150px;
        width: 100%;
        left: 0;
        transform: none;
        max-width: none;
        border-radius: 20px;
    }

    /* Panneau d'aperçu mobile */
    .panel {
        min-width: auto;
        width: 100%;
        border-radius: 20px;
        padding: 15px;
        min-height: 150px;
    }

    .apercuapn {
        width: 100%;
        min-width: auto;
        max-height:max-content;
        margin-top: 130px;
        border-radius: 15px !important;
    }

    /* Chat mobile */
    .chat {
        height: 200px;
        border-radius: 20px;
        padding: 15px;
        margin: 0;
        width: 100%;
    }

    .chat-input {
        padding: 0;
        gap: 10px;
        margin-top: 15px;
    }

    .chat-input input {
        min-height: 50px;
        border-radius: 25px;
        padding: 12px 15px;
    }

    .chat-input .btn.primary {
        margin-top: 10px;
        border-radius: 25px;
    }

    /* Chat panel mobile */
    .chat-pannel {
        width: 100%;
        position: relative;
        right: auto;
        top: auto;
        height: 300px;
        margin-top: 20px;
    }

    /* Interface Discord mobile */
    .discord-interface {
        border-radius: 15px;
    }

    .discord-sidebar {
        padding: 12px 0;
    }

    .sidebar-header {
        padding: 0 12px 12px 12px;
        font-size: 11px;
    }

    .discord-role {
        padding: 6px 12px;
        font-size: 13px;
    }

    .discord-main {
        padding: 12px;
    }

    .main-header {
        gap: 12px;
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    .server-name {
        font-size: 18px;
    }

    .member-count {
        font-size: 12px;
    }

    .discord-category {
        margin-bottom: 20px;
    }

    .category-header {
        padding: 6px 0;
        font-size: 11px;
    }

    .discord-channel {
        padding: 4px 4px;
        margin: 1px 0;
        font-size: 13px;
    }

    .discord-info-panel {
        padding: 12px;
    }

    .info-header {
        padding-bottom: 12px;
        margin-bottom: 12px;
        font-size: 11px;
    }

    .info-item {
        padding: 6px 0;
    }

    .info-label,
    .info-value {
        font-size: 13px;
    }

    /* Modales mobile */
    .server-options-modal {
        padding: 20px;
    }

    .server-options-content {
        padding: 20px;
        border-radius: 15px;
        max-width: 95%;
    }

    .server-options-header h3 {
        font-size: 20px;
    }

    .server-options-header p {
        font-size: 14px;
    }

    .server-config-info {
        padding: 15px;
        border-radius: 15px;
    }

    .server-config-info h4 {
        font-size: 16px;
    }

    .server-options-buttons .btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    /* Popup de génération mobile */
    .generation-popup {
        padding: 20px;
    }

    .generation-content {
        max-width: 90%;
        padding: 30px 20px;
    }

    .generation-spinner {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }

    .generation-content h2 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .generation-content p {
        font-size: 16px;
    }

    /* Permissions panel mobile */
    .permissions-panel {
        min-width: 95%;
        max-width: 95%;
        max-height: 90vh;
    }

    .permissions-header {
        padding: 12px;
    }

    .permissions-title {
        font-size: 14px;
    }

    .permissions-content {
        padding: 12px;
    }

    .permission-overwrite {
        padding: 12px;
        margin-bottom: 12px;
    }

    .overwrite-role {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .permission-type {
        font-size: 11px;
    }

    .permission-item {
        padding: 3px 6px;
        font-size: 11px;
    }

    /* Boutons mobile */
    .btn {
        padding: 12px 16px;
        border-radius: 25px;
        font-size: 14px;
    }

    .btn.primary {
        width: 100%;
        max-width: 300px;
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin-top: 20px;
    }

    .btn.backTo {
        width: 100px;
        position: fixed;
        right: 0;
        bottom: 10px;
        margin-top: 15px;
        padding: 8px 12px;
        border-radius: 15px;
        background-color: var(--background);
    }

    .btn.discord {
        padding: 10px 16px;
        border-radius: 20px;
        font-size: 14px;
    }

    /* Badges et éléments d'interface mobile */
    .active-features {
        margin: 12px 0;
        gap: 8px;
    }

    .badge {
        padding: 4px 8px;
        border-radius: 15px;
        font-size: 11px;
    }

    /* Auth mobile */
    .auth {
        height: calc(100vh - 160px);
        padding: 20px;
    }

    .auth h2 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .auth p {
        font-size: 14px;
        margin-bottom: 20px;
        max-width: 100%;
    }

    .auth-content {
        padding: 15px;
        border-radius: 15px;
        gap: 8px;
    }

    /* Messages d'erreur mobile */
    .access-denied-error {
        padding: 30px 15px;
        border-radius: 15px;
        margin-top: 15px;
    }

    .error-icon {
        font-size: 36px;
        margin-bottom: 15px;
    }

    .access-denied-error h3 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .access-denied-error p {
        font-size: 14px;
    }

    /* Chat info mobile */
    .chat-info {
        display: none;
    }

    .chat-info strong {
        font-size: 11px;
    }

    /* Utilitaires mobile */
    .hidden {
        display: none !important;
    }

    .centered {
        text-align: center;
    }

    /* Scrollbar mobile */
    .apercuapn::-webkit-scrollbar {
        width: 6px;
    }

    /* Animations mobile */
    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

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

/* ========================================
   RESPONSIVE TRÈS PETIT ÉCRAN (320px-480px)
   ======================================== */

@media (max-width: 480px) {
    :root {
        --mobile-padding: 12px;
        --mobile-border-radius: 15px;
        --mobile-font-size: 13px;
    }

    .header {
        height: 55px;
        border-radius: 25px;
        padding: 0 10px;
    }

    .header .logo {
        height: 45px;
    }

    .logo-title {
        margin-left: 35px;
        font-size: 14px;
    }

    .userbox .displayname {
        max-width: 100px;
        font-size: 11px;
    }

    .step-item {
        padding: 10px 12px;
        font-size: 12px;
        min-width: 100px;
    }

    .step-index {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }

    .step h3 {
        font-size: 18px;
    }

    .guild-card {
        height: 60px;
        padding: 6px;
    }

    .guild-icon {
        width: 48px;
        height: 48px;
    }

    .guild-name {
        font-size: 12px;
    }

    .mode-card {
        padding: 15px;
    }

    .mode-card h4 {
        font-size: 18px;
    }

    .mode-card p {
        font-size: 13px;
    }

    .current-config-info {
        height: 50px;
    }

    .config-item {
        height: 50px;
    }

    .config-label {
        font-size: 11px;
    }

    .config-value {
        font-size: 14px;
    }

    .chat {
        height: 200px;
        padding: 12px;
    }

    .chat-pannel {
        height: 250px;
    }

    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .btn.primary {
        max-width: 250px;
    }
}

/* ========================================
   ORIENTATION PAYSAGE SUR MOBILE
   ======================================== */

@media (max-width: 768px) and (orientation: landscape) {
    .step-part {
        margin-top: 70px;
    }

    .stepper {
        flex-direction: row;
        overflow-x: auto;
        padding: 15px 0;
    }

    .step-item {
        min-width: 100px;
    }

    .chat-pannel {
        height: 200px;
    }

    .auth {
        height: calc(100vh - 140px);
    }
}

.addbot{
background: var(--primary-color);
border-radius:50px;
transition: all 0.3s ease;
width: 250px;
height: 40px;
}

.addbot:hover{
    width: 270px;
    height: 50px;
}