@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* Custom Selection Color */
::selection {
    background-color: rgba(91, 33, 182, 0.4); /* A deep, transparent violet */
}
::-moz-selection { /* Firefox */
    background-color: rgba(91, 33, 182, 0.4); /* A deep, transparent violet */
}

:root {
    --background-color: #0A0A0C;
    --text-color: #E2E2E2;
    --text-color-dark: #8A8A8E;
    --primary-glow-color-soft: rgba(79, 70, 229, 0.2);
    --primary-glow-color-border: rgba(79, 70, 229, 0.6);
    --container-bg: #141417;
    --container-border: #2D2D30;
    --error-color: #EF4444; /* Changed to a more vibrant red */
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* Pushes footer down */
    min-height: 100vh;
    position: relative;
    padding: 2rem;
    box-sizing: border-box;
    cursor: default;
}

/* Background image pour la page d'accueil */
body.home-page::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Ancienne image (pyramides égyptiennes) : https://images.unsplash.com/photo-1539768942893-daf53e448371?w=1920 */
    background-image: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1920');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -2;
    opacity: 0.15;
}

/* Overlay sombre pour améliorer la lisibilité */
body.home-page::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(10, 10, 12, 0.85) 0%,
        rgba(20, 20, 23, 0.9) 50%,
        rgba(10, 10, 12, 0.85) 100%
    );
    z-index: -1;
}

/* Étoiles filantes discrètes */
.shooting-star {
    position: fixed;
    width: 1px;
    height: 1px;
    background: rgba(212, 193, 248, 0.6);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
}

.shooting-star::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, rgba(212, 193, 248, 0.4), transparent);
    transform: rotate(-45deg);
    transform-origin: left center;
}

.shooting-star:nth-child(1) {
    top: 15%;
    right: 10%;
    animation: shooting-1 12s ease-in-out infinite;
}

.shooting-star:nth-child(2) {
    top: 50%;
    right: 30%;
    animation: shooting-2 15s ease-in-out infinite;
    animation-delay: 4s;
}

.shooting-star:nth-child(3) {
    top: 70%;
    right: 60%;
    animation: shooting-3 18s ease-in-out infinite;
    animation-delay: 8s;
}

@keyframes shooting-1 {
    0%, 90%, 100% {
        transform: translate(0, 0);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    15% {
        transform: translate(-150px, 150px);
        opacity: 0;
    }
}

@keyframes shooting-2 {
    0%, 90%, 100% {
        transform: translate(0, 0);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    15% {
        transform: translate(-180px, 180px);
        opacity: 0;
    }
}

@keyframes shooting-3 {
    0%, 90%, 100% {
        transform: translate(0, 0);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    15% {
        transform: translate(-160px, 160px);
        opacity: 0;
    }
}

#tsparticles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Removing old background effects */
/*
body::before,
body::after {
    content: none;
}
*/

/* Add this new rule */
body.no-scroll {
    overflow: hidden;
}

/* --- Aurora Background Effect --- */


/* --- Cursor Spotlight Effect --- */


@keyframes aurora-flow {
    0%   { transform: translate(-50%, -65%) rotate(10deg) scale(1); }
    50%  { transform: translate(-50%, -60%) rotate(-10deg) scale(1.1); }
    100% { transform: translate(-50%, -65%) rotate(10deg) scale(1); }
}


/* --- Main Container --- */
.main-container {
    position: relative;
    z-index: 1;
    flex-grow: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 2vh; /* Descendre tous les éléments très légèrement */
}

/* Logo sobre en haut de la page */
.home-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 2rem;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.home-logo:hover {
    opacity: 1;
}

.text-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 25px; /* Espace réduit entre description et formulaire */
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.error-message {
    color: var(--error-color);
    background-color: transparent;
    border: none;
    padding: 0;
    margin-top: 12px;
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: center;
}
.error-message a {
    color: var(--error-color);
    text-decoration: none; /* remove underline by default */
}
.error-message a:hover {
    text-decoration: underline;
}

h1 {
    font-size: 2.1rem; /* Reduced from 2.25rem */
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #D4C1F8, #A396F4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0; /* Reset browser default margins */
}

.subtitle {
    font-size: 0.95rem; /* Reduced from 1rem */
    color: var(--text-color-dark);
    margin-top: 8px; /* Reduced from 10px */
    margin-bottom: 0; /* No margin needed as parent provides it */
    max-width: 360px; /* Reduced from 380px */
    line-height: 1.6;
}

/* --- Unified Login Group --- */
.login-group {
    display: flex;
    align-items: center;
    gap: 0.4rem; /* Reduced from 0.5rem */
    background-color: var(--container-bg);
    border: 1px solid var(--container-border);
    border-radius: 9999px; /* pill shape */
    padding: 0.3rem; /* Reduced from 0.4rem */
    box-shadow: 0 5px 25px rgba(0,0,0,0.2), 0 0 40px var(--primary-glow-color-soft) inset;
}

.icon-button {
    background-color: transparent;
    border: none;
    border-radius: 50%;
    padding: 0.3rem; /* Reduced from 0.4rem */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.icon-button:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.icon-button svg {
    width: 1.1rem; /* Reduced from 1.15rem */
    height: 1.1rem; /* Reduced from 1.15rem */
    color: var(--text-color-dark);
    transition: color 0.2s ease-in-out;
}
.icon-button:hover svg {
    color: var(--text-color);
}

.email-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 0.9rem; /* Reduced from 1rem */
    width: 200px; /* Reduced from 220px */
    padding: 0 0.5rem;
    cursor: text;
}

.email-input::placeholder {
    color: var(--text-color-dark);
}

.divider {
    width: 1px;
    height: 18px; /* Reduced from 20px */
    background-color: var(--container-border);
}

/* --- Request Access Button --- */
.request-access-btn {
    margin-top: 20px;
    background: transparent;
    border: none;
    color: var(--text-color-dark);
    font-size: 0.8rem;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 8px 0;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
}

.request-access-btn:hover {
    color: var(--text-color);
    text-decoration-color: var(--text-color-dark);
}

/* --- Access Modal --- */
.access-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 12, 0);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.access-modal.show {
    background: rgba(10, 10, 12, 0.95);
}

.access-modal-content {
    background: var(--container-bg);
    border: 1px solid var(--container-border);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile: Full screen modal */
@media (max-width: 768px) {
    .access-modal {
        padding: 0;
        align-items: stretch;
    }
    
    .access-modal-content {
        max-width: 100%;
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
        padding: 2rem 1.5rem;
        overflow-y: auto;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
    }
    
    .access-modal-content h2 {
        font-size: 1.3rem;
        word-break: break-word;
    }
    
    .access-modal .form-group input,
    .access-modal .form-group textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

.access-modal.show .access-modal-content {
    opacity: 1;
    transform: translateY(0);
}

.access-modal-content h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-color-dark);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-color);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    color: var(--text-color-dark);
    font-size: 0.8rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-right: 2.5rem;
}

.input-tooltip {
    position: absolute;
    right: 0;
    top: -2.5rem;
    background: rgba(20, 20, 23, 0.95);
    border: 1px solid var(--container-border);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.input-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.input-tooltip::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 1rem;
    width: 8px;
    height: 8px;
    background: rgba(20, 20, 23, 0.95);
    border-right: 1px solid var(--container-border);
    border-bottom: 1px solid var(--container-border);
    transform: rotate(45deg);
}

.input-icon {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    font-weight: normal;
    pointer-events: auto;
    cursor: help;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.input-icon:hover {
    opacity: 1;
}

.input-icon.success {
    color: #22c55e;
    opacity: 0.6;
}

.input-icon.warning {
    color: #fbbf24;
    font-size: 0.95rem;
}

/* Custom Context Menu */
.custom-context-menu {
    position: absolute;
    background: rgba(20, 20, 23, 0.98);
    border: 1px solid var(--container-border);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 150px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95) translateY(-5px);
    transform-origin: top left;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.custom-context-menu.show {
    opacity: 1;
    pointer-events: all;
    transform: scale(1) translateY(0);
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: var(--text-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    user-select: none;
}

.context-menu-item:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.context-menu-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.context-menu-item svg {
    flex-shrink: 0;
}

.form-group input,
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    border: 1px solid var(--container-border);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    color: var(--text-color);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--text-color-dark);
    background: rgba(255, 255, 255, 0.02);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-color-dark);
    opacity: 0.6;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Server Info */
.server-info {
    margin-top: 0.75rem;
    font-size: 0.8rem;
}

.server-loading {
    color: var(--text-color-dark);
    padding: 0.5rem;
    text-align: center;
}

.server-error {
    color: var(--error-color);
    padding: 0.5rem;
    text-align: center;
}

.email-valid {
    color: #22c55e;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
}

.email-verified {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--container-border);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.email-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.email-details {
    flex: 1;
    min-width: 0;
}

.email-provider {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
}

.email-desc {
    color: var(--text-color-dark);
    font-size: 0.7rem;
}

.server-verified {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--container-border);
    border-radius: 8px;
}

.server-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.server-details {
    flex: 1;
    min-width: 0;
}

.server-name {
    color: var(--text-color);
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-stats {
    color: var(--text-color-dark);
    font-size: 0.75rem;
}

.submit-access-btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: transparent;
    border: 1px solid var(--container-border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1.5rem;
}

.submit-access-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--text-color-dark);
}

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

.access-response {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.85rem;
}

.access-response p {
    margin: 0;
    padding: 0.75rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

/* --- Footer --- */
footer {
    color: var(--text-color-dark);
    font-size: 0.875rem; /* 14px */
    z-index: 1;
    margin-bottom: 0;
    padding-bottom: 0;
    cursor: default;
}


/* --- Dashboard Specific Styles --- */
body.dashboard-page {
    background: #0F0F0F;
    padding: 0;
    min-height: 100vh;
}

.dashboard-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    background: #141414;
    border-bottom: 1px solid #222;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-header h1 {
    font-size: 1.4rem;
    margin: 0;
    color: #FFFFFF;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

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

.btn-danger {
    background-color: #4B1414;
    color: #FEE2E2;
}
.btn-danger:hover {
    background-color: #B91C1C;
}

.btn-primary {
    background-color: #4F46E5;
    color: #FFFFFF;
}
.btn-primary:hover {
    background-color: #6366F1;
}

.btn-success {
    background-color: #065F46; /* Darker green */
    color: #D1FAE5;
}
.btn-success:hover {
    background-color: #15803D;
}

/* --- New Icon Buttons --- */
.btn-icon {
    background: transparent;
    border: 1px solid #2A2A2A;
    padding: 0.4rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #999;
}
.btn-icon:hover {
    background-color: #1F1F1F;
    border-color: #333;
    color: #FFF;
}
.btn-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}
.bot-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* --- Hold to delete button --- */
.btn-delete {
    position: relative;
}

.delete-tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--container-bg);
    color: var(--text-color);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}
.delete-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

.btn-delete .progress-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    z-index: 2; /* Bring progress to front */
}

.btn-delete > svg:not(.progress-ring) {
    position: relative;
    z-index: 1; /* Send icon to back */
}


/* --- New Dashboard Grid Layout --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    padding: 2rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Mobile: Stack dashboard columns */
@media (max-width: 768px) {
    body {
        padding: 0;
        background: var(--background-color) !important;
    }
    
    body.dashboard-page {
        padding: 0.75rem;
        overflow-x: hidden;
        background: var(--background-color) !important;
    }
    
    /* Désactiver tous les fonds animés sur mobile */
    body::before,
    body::after,
    body.home-page::before,
    body.home-page::after,
    body.dashboard-page::before,
    body.dashboard-page::after {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
    
    #tsparticles {
        display: none !important;
    }
    
    /* Fond uni noir partout */
    body, body.home-page, body.dashboard-page {
        background-color: var(--background-color) !important;
        background-image: none !important;
    }
    
    .dashboard-container {
        max-width: 100%;
        width: 100%;
        padding: 0;
        overflow-x: hidden;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .dashboard-header h1 {
        font-size: 1.3rem;
        margin: 0;
        word-break: break-word;
    }
    
    .header-actions {
        display: flex;
        gap: 0.5rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
    }
    
    .grid-col-1, .grid-col-2 {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .dashboard-section {
        padding: 1rem 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
        /* Fond uni sur mobile - complètement invisible */
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    
    .dashboard-section h2 {
        font-size: 1.1rem;
        word-break: break-word;
    }
    
    .dashboard-section h3 {
        font-size: 1rem;
    }
    
    /* Bot list: vertical on mobile */
    .bot-instance-list {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
    }
    
    .bot-instance-list .item-list-item {
        min-width: auto;
        width: 100%;
        max-width: 100%;
        flex-basis: auto;
        flex-grow: 0;
    }
    
    .item-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        word-break: break-word;
        overflow: hidden;
        margin-bottom: 1rem;
        padding: 1rem !important;
    }
    
    /* Garder les blocs pour les instances de bot */
    .bot-instance-list .item-list-item {
        background-color: rgba(20, 20, 23, 0.7) !important;
        border: 1px solid rgba(45, 45, 48, 0.6) !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    }
    
    .bot-instance-list .item-list-item:hover {
        background-color: rgba(25, 25, 28, 0.8) !important;
        border-color: rgba(79, 70, 229, 0.4) !important;
    }
    
    /* Pas de bloc pour les autres listes */
    .item-list:not(.bot-instance-list) .item-list-item {
        background-color: transparent !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0.5rem 0 !important;
    }
    
    .item-list-item > div {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    .item-list-item p {
        word-break: break-word;
        max-width: 100%;
        overflow-wrap: break-word;
        white-space: normal;
        margin: 0;
    }
    
    .item-list-item strong {
        word-break: break-all;
        max-width: 100%;
    }
    
    .bot-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    /* Forms on mobile */
    .form-group {
        margin-bottom: 0.875rem;
        width: 100%;
        max-width: 100%;
    }
    
    .form-input, .form-group input, .form-group textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        background-color: rgba(28, 28, 33, 0.4) !important;
        border: 1px solid rgba(45, 45, 48, 0.3) !important;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
    
    .btn-small {
        width: auto;
    }
    
    /* Supprimer tous les backgrounds de cartes sauf bot-instance-list */
    .dashboard-section,
    .item-list:not(.bot-instance-list),
    .glass-container {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    /* Garder transparent pour la liste elle-même, mais pas les items */
    .bot-instance-list {
        background: transparent !important;
        border: none !important;
    }
    
    /* Prevent any overflow */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
}

.dashboard-section {
    background: #141414;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 0;
}

.dashboard-section h2 {
    font-size: 1.125rem;
    color: #FFFFFF;
    margin: 0 0 1.5rem 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.dashboard-section h3 {
    font-size: 0.95rem;
    color: #FFFFFF;
    margin: 2rem 0 1rem 0;
    font-weight: 600;
}

.item-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Horizontal Bot Instance List */
.bot-instance-list {
    flex-direction: row;
    align-items: stretch; /* Make items same height */
    flex-wrap: wrap;
}

.bot-instance-list .item-list-item {
    flex-grow: 1;
    flex-basis: 0;
    min-width: 180px; /* Prevent shrinking too much */
    max-width: 100%;
    overflow: hidden;
}

.item-list-item {
    background-color: #1A1A1A;
    border: 1px solid #2A2A2A;
    padding: 1.25rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    overflow: hidden;
    word-wrap: break-word;
}

.item-list-item:hover {
    background-color: #1F1F1F;
    border-color: #333;
}

.item-list-item p {
    margin: 0;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    color: #999;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    background-color: #1A1A1A;
    border: 1px solid #2A2A2A;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #FFFFFF;
    transition: all 0.2s;
    box-sizing: border-box;
    font-size: 0.9rem;
}

.form-input:focus {
    border-color: #444;
    background-color: #1F1F1F;
    outline: none;
}

.error-text {
    color: var(--error-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--container-border);
    color: var(--text-color-dark);
}

.btn-secondary:hover {
    background-color: var(--container-bg);
    border-color: #555;
    color: var(--text-color);
}


/* --- Stats Page --- */
.glass-container {
    background: rgba(10, 10, 12, 0.7);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border-radius: 20px;
    border: 1px solid rgba(45, 45, 48, 0.5);
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    width: 80%;
    max-width: 1200px;
}

.glass-container h1 {
    margin-bottom: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: rgba(20, 20, 23, 0.5);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--container-border);
    transition: background-color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.stat-card:hover {
    background: rgba(30, 30, 33, 0.7);
}

.stat-card.active {
    background: rgba(79, 70, 229, 0.2);
    border-color: rgba(79, 70, 229, 0.6);
}

.stat-card h4 {
    margin: 0 0 0.5rem 0;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color-dark);
}

.stat-card p {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
}

.chart-container {
    height: 300px;
    margin: 2rem 0;
    position: relative;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--container-border);
    scrollbar-width: thin;
    scrollbar-color: var(--container-border) transparent;
}

.table-container::-webkit-scrollbar { width: 8px; }
.table-container::-webkit-scrollbar-track { background: transparent; }
.table-container::-webkit-scrollbar-thumb {
    background-color: var(--container-border);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.table-container::-webkit-scrollbar-thumb:hover { background-color: #555; }

.table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-color);
}

.table th, .table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid #222;
    font-size: 0.875rem;
    white-space: nowrap;
}

.table th {
    background-color: #1A1A1A;
    font-weight: 500;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tbody tr { transition: background-color 0.2s; }
.table tbody tr:hover { background-color: #1A1A1A; }
.table tbody tr:last-child td { border-bottom: none; }

.table td {
    font-family: 'Menlo', 'Consolas', 'Monaco', monospace;
    color: #E5E5E5;
}
.table td:first-child, .table th:first-child { padding-left: 20px; }
.table td:last-child, .table th:last-child { padding-right: 20px; }

/* Status Pill Styles */
.status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: capitalize;
    display: inline-block;
}

.status-waiting {
    background-color: rgba(251, 191, 36, 0.1);
    color: #FBBF24;
}

.status-pending {
    background-color: #A16207; /* Amber */
    color: #FEF3C7;
}
.status-confirmed {
    background-color: #166534; /* Darker green */
    color: #DCFCE7;
}
.status-expired {
    background-color: #4B5563; /* Gray */
    color: #D1D5DB;
}

.status-limited-icon {
    padding: 0 !important;
    width: 16px !important;
    height: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 0 !important;
}

.status-limited {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    color: #FBBF24;
    font-size: 0.9rem;
    text-transform: capitalize;
    line-height: 16px; /* aligne verticalement le texte avec les icônes */
}


/* --- Spinner --- */
.spinner {
    box-sizing: border-box;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--text-color);
    border-radius: 50%;
    width: 1.1rem; /* Match icon size */
    height: 1.1rem; /* Match icon size */
    animation: spin 1s linear infinite;
    display: none; /* Hidden by default */
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Pagination --- */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-info {
    color: var(--text-color-dark);
    font-size: 0.9rem;
} 

.info-popup {
    position: absolute;
    z-index: 1000;
    border: 1px solid var(--container-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    background: var(--container-bg);
    padding: 4px;
}
.info-popup img {
    display: block;
    max-width: 350px;
    height: auto;
    border-radius: 6px;
} 

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #1c1c21;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--container-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
    position: relative;
    color: var(--text-color);
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-color-dark);
    cursor: pointer;
    line-height: 1;
}

.modal-content h3 {
    margin-top: 0;
    color: var(--text-color);
    font-size: 1.4rem;
}

.modal-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.modal-content p, .modal-content li {
    color: var(--text-color-dark);
    line-height: 1.6;
}

.modal-content strong {
    color: var(--text-color);
    font-weight: 600;
}

.modal-content a {
    color: #818CF8;
    text-decoration: none;
}
.modal-content a:hover {
    text-decoration: underline;
}

.modal-content ol {
    padding-left: 1.5rem;
} 

/* Bot card clickable */
.item-list-item[data-invite] {
    cursor: pointer;
} 

/* Success Animation */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #4CAF50;
}

.check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

.check-icon::before, .check-icon::after {
    content: '';
    height: 100px;
    position: absolute;
    background: var(--container-bg);
    transform: rotate(-45deg);
}

.icon-line {
    height: 5px;
    background-color: #4CAF50;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

.icon-circle {
    top: -4px;
    left: -4px;
    z-index: 10;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: absolute;
    box-sizing: content-box;
    border: 4px solid rgba(76, 175, 80, 0.5);
}

.icon-fix {
    top: 8px;
    width: 5px;
    left: 26px;
    z-index: 1;
    height: 85px;
    position: absolute;
    transform: rotate(-45deg);
    background-color: var(--container-bg);
}

@keyframes rotate-circle {
    0% {
        transform: rotate(-45deg);
    }
    5% {
        transform: rotate(-45deg);
    }
    12% {
        transform: rotate(-405deg);
    }
    100% {
        transform: rotate(-405deg);
    }
}

@keyframes icon-line-tip {
    0% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    54% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    70% {
        width: 50px;
        left: -8px;
        top: 37px;
    }
    84% {
        width: 17px;
        left: 21px;
        top: 48px;
    }
    100% {
        width: 25px;
        left: 14px;
        top: 46px;
    }
}

@keyframes icon-line-long {
    0% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    65% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    84% {
        width: 55px;
        right: 0px;
        top: 35px;
    }
    100% {
        width: 47px;
        right: 8px;
        top: 38px;
    }
}
