:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --background-dark: #0a0e27;
    --background-darker: #060919;
    --background-card: rgba(255, 255, 255, 0.05);
    --background-input: rgba(255, 255, 255, 0.08);
    --background-bot: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    --background-user: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --border-color: rgba(102, 126, 234, 0.2);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(102, 126, 234, 0.3);
    --accent-color: #667eea;
}

@media (prefers-color-scheme: light) {
    :root {
        --background-dark: #f7fafc;
        --background-darker: #edf2f7;
        --background-card: rgba(255, 255, 255, 0.9);
        --background-input: #ffffff;
        --background-bot: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
        --text-primary: #1a202c;
        --text-secondary: #4a5568;
        --text-muted: #718096;
        --border-color: rgba(102, 126, 234, 0.3);
        --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
        --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.15);
        --shadow-lg: 0 20px 60px rgba(102, 126, 234, 0.2);
    }
}

* {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    --vh: 1vh;
}

body {
    background: var(--background-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Particules d'arrière-plan */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 50%;
    opacity: 0.4;
    animation: float 6s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.8;
    }
}

/* Layout */
.flex-row {
    display: flex;
    flex-direction: row;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.main {
    position: relative;
    z-index: 1;
    height: 100vh;
}

.option-container {
    width: 0;
    display: none;
}

.main-content {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    padding: 10px 30px;
    background: var(--background-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 36px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #48bb78;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(72, 187, 120, 0);
    }
}

/* Main Container */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 30px 30px;
    overflow: hidden;
}

.container-box {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: var(--background-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

/* Chat Container */
.chat-container {
    flex: 1;
    padding: 10px 5px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-gutter: stable;
    scrollbar-color: var(--accent-color) transparent;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border-radius: 20px;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: slideIn 0.4s ease-out;
    max-width: 85%;
    min-width: 100px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.bot-avatar {
    background: var(--background-bot);
    border: 1px solid var(--border-color);

}

.bot-avatar img , .user-avatar img, .logo-icon img{
    width: 50px;
    border-radius: 50%;
}

.user-avatar {
    background: var(--background-user);
}

.message-content {
    flex: 1;

    border-radius: 16px;
    line-height: 1.6;
    word-wrap: break-word;
}

.bot-message {
    align-self: flex-start;

}

.bot-message .message-content {
    background: var(--background-bot);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    padding: 10px 20px;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;

}

.user-message .message-content {
    background: var(--background-user);
    color: white;
    border-bottom-right-radius: 4px;
    padding: 5px 10px 10px 15px;
}

.name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--accent-color);
}

.user-message .name {
    color: rgba(255, 255, 255, 0.9);
}

.first-message {
}

.first-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.support-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--accent-color);
    color: white !important;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.support-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.typing-message .message-content {
    padding: 10px 20px;
}

.typing-message img {
    width: 50px;
    opacity: 0.6;
}

.image-message {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin-top: 10px;
    border: 1px solid var(--border-color);
}

/* Code blocks */
pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    margin: 10px 0;
    overflow-x: auto;
    font-size: 14px;
}

code {
    background: rgba(102, 126, 234, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

pre code {
    background: none;
    padding: 0;
}

/* Prompt Container */
.prompt-container {
    padding: 10px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.prompt-options {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.prompt-options > div {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    background: var(--background-input);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.prompt-options > div:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.prompt-options > div.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.prompt-options svg {
    width: 18px;
    height: 18px;
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.input {
    flex: 1;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0);;
    border: none;
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 15px;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    max-height: 200px;
    scrollbar-width: none;
}



.input::placeholder {
    color: var(--text-muted);
}

.send-button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 14px;
    background: var(--primary-gradient);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.send-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.send-button:active {
    transform: translateY(0) scale(0.98);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.send-button svg {
    width: 24px;
    height: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }

    .header h1 {
        font-size: 22px;
    }

    .logo-icon {
        font-size: 28px;
    }

    .status-badge {
        font-size: 12px;
        padding: 6px 12px;
    }

    .main-container {
        padding: 15px;
    }

    .message {
        max-width: 95%;
    }

    .prompt-options > div span {
        display: none;
    }

    .prompt-options > div {
        padding: 10px;
    }
}

@media (max-width: 500px) {
    .container-box {
        border-radius: 15px;
    }

    .chat-container {
        padding: 15px;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .message-content {
        padding: 12px 16px;
        font-size: 14px;
    }
}