        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #333;
            overflow-x: hidden;
        }

        .container {
            width: 100%;
            max-width: 1000px; /* Élargi pour le chat */
            padding: 20px;
        }

        /* Welcome Screen */
        .welcome-screen {
            background: white;
            border-radius: 25px;
            padding: 50px 40px;
            text-align: center;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            animation: slideInUp 0.6s ease-out;
        }

        .logo {
            font-size: 3rem;
            margin-bottom: 20px;
            animation: pulse 2s infinite;
        }

        .welcome-title {
            font-size: 2.5rem;
            font-weight: 800;
            color: #2c3e50;
            margin-bottom: 15px;
        }

        .welcome-subtitle {
            font-size: 1.2rem;
            color: #5a6c7d;
            margin-bottom: 40px;
            line-height: 1.5;
        }

        .start-btn {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            padding: 18px 40px;
            border: none;
            border-radius: 50px;
            font-size: 1.2rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
        }

        .start-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
        }

        /* Color Selection Screen */
        .color-selection {
            display: none;
            background: white;
            border-radius: 25px;
            padding: 40px;
            text-align: center;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            animation: slideInUp 0.6s ease-out;
        }

        .color-title {
            font-size: 2.2rem;
            font-weight: 700;
            color: #2c3e50;
            margin-bottom: 15px;
        }

        .color-subtitle {
            font-size: 1.1rem;
            color: #5a6c7d;
            margin-bottom: 40px;
        }

        .colors-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            margin-bottom: 40px;
        }

        .color-option {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            border: 4px solid transparent;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
        }

        .color-option:hover {
            transform: scale(1.1);
            border-color: rgba(255, 255, 255, 0.8);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
        }

        .color-option.selected {
            border-color: #2c3e50;
            transform: scale(1.2);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
        }

        .color-rouge { background: #e74c3c; }
        .color-bleu { background: #3498db; }
        .color-vert { background: #2ecc71; }
        .color-violet { background: #9b59b6; }
        .color-rose { background: #e91e63; }
        .color-jaune { background: #f39c12; }
        .color-orange { background: #e67e22; }
        .color-noir { background: #34495e; }

        .color-label {
            text-align: center;
            margin-top: 10px;
            font-size: 0.9rem;
            color: #5a6c7d;
            font-weight: 500;
        }

        .confirm-btn {
            background: #2c3e50;
            color: white;
            padding: 15px 35px;
            border: none;
            border-radius: 50px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            opacity: 0.5;
            pointer-events: none;
        }

        .confirm-btn.active {
            opacity: 1;
            pointer-events: all;
        }

        .confirm-btn.active:hover {
            background: #1a252f;
            transform: translateY(-2px);
        }

        /* Welcome Back Screen */
        .welcome-back {
            display: none;
            background: white;
            border-radius: 25px;
            padding: 40px;
            text-align: center;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            animation: slideInUp 0.6s ease-out;
        }

        .user-avatar {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            margin: 0 auto 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            border: 4px solid #fff;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
        }

        .user-id {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 10px;
        }

        .last-visit {
            color: #666;
            margin-bottom: 30px;
        }

        .history-section {
            background: #f8f9fa;
            border-radius: 15px;
            padding: 20px;
            margin-bottom: 30px;
            text-align: left;
        }

        .history-title {
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 15px;
            color: #2c3e50;
        }

        .history-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 0;
            border-bottom: 1px solid #e9ecef;
        }

        .history-item:last-child {
            border-bottom: none;
        }

        .continue-btn {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            padding: 15px 35px;
            border: none;
            border-radius: 50px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-right: 15px;
        }

        .continue-btn:hover {
            transform: translateY(-2px);
        }

        .new-session-btn {
            background: transparent;
            color: #667eea;
            padding: 15px 35px;
            border: 2px solid #667eea;
            border-radius: 50px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .new-session-btn:hover {
            background: #667eea;
            color: white;
        }

        /* Chat Interface - Version moderne et agrandie */
        .chat-interface {
            display: none;
            background: white;
            border-radius: 20px;
            height: 95vh;
            max-height: 900px;
            width: 100%;
            max-width: 1000px;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
            animation: slideInUp 0.6s ease-out;
            overflow: hidden;
            position: relative;
            border: 1px solid rgba(0, 0, 0, 0.05);
        }

        .chat-header {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            padding: 20px 25px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-radius: 20px 20px 0 0;
            backdrop-filter: blur(10px);
            position: relative;
            overflow: hidden;
            min-height: 80px;
        }

        .chat-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 50%);
            pointer-events: none;
        }

        .chat-user-info {
            display: flex;
            align-items: center;
            gap: 15px;
            z-index: 1;
            flex: 1;
            min-width: 0; /* Permet la compression */
        }

        .chat-avatar {
            width: 55px;
            height: 55px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.8rem;
            border: 3px solid rgba(255, 255, 255, 0.3);
            backdrop-filter: blur(10px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
            flex-shrink: 0;
        }

        .chat-user-details {
            min-width: 0; /* Permet la compression */
            flex: 1;
        }

        .chat-user-details h3 {
            font-size: 1.2rem;
            margin-bottom: 3px;
            font-weight: 700;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 200px;
        }

        .chat-status {
            font-size: 0.9rem;
            opacity: 0.9;
            display: flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
        }

        .status-dot {
            width: 8px;
            height: 8px;
            background: #4CAF50;
            border-radius: 50%;
            animation: pulse 2s infinite;
            box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
            flex-shrink: 0;
        }

        .chat-actions {
            display: flex;
            gap: 10px;
            z-index: 1;
            flex-shrink: 0;
        }

        .chat-btn {
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 10px 16px;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.9rem;
            font-weight: 500;
            white-space: nowrap;
        }

        .chat-btn:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        }

        /* Responsive pour le header */
        @media (max-width: 768px) {
            .chat-header {
                padding: 15px 20px;
                border-radius: 0;
                min-height: 70px;
            }

            .chat-user-info {
                gap: 12px;
            }

            .chat-avatar {
                width: 45px;
                height: 45px;
                font-size: 1.4rem;
                border: 2px solid rgba(255, 255, 255, 0.3);
            }

            .chat-user-details h3 {
                font-size: 1.1rem;
                max-width: 150px;
            }

            .chat-status {
                font-size: 0.8rem;
                gap: 4px;
            }

            .status-dot {
                width: 6px;
                height: 6px;
            }

            .chat-actions {
                gap: 8px;
            }

            .chat-btn {
                padding: 8px 12px;
                font-size: 0.8rem;
            }
        }

        @media (max-width: 480px) {
            .chat-header {
                padding: 12px 15px;
                min-height: 60px;
            }

            .chat-user-info {
                gap: 10px;
            }

            .chat-avatar {
                width: 40px;
                height: 40px;
                font-size: 1.2rem;
            }

            .chat-user-details h3 {
                font-size: 1rem;
                max-width: 120px;
            }

            .chat-status {
                font-size: 0.75rem;
            }

            .chat-btn {
                padding: 6px 10px;
                font-size: 0.75rem;
            }

            /* Masquer le texte "Retour" sur très petits écrans */
            .chat-btn:first-child::before {
                content: '←';
            }
            
            .chat-btn:first-child {
                font-size: 0;
                width: 32px;
                height: 32px;
                padding: 0;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .chat-btn:first-child::before {
                font-size: 1.2rem;
            }

            .chat-btn:last-child {
                padding: 6px 8px;
                font-size: 0.7rem;
            }
        }

        .chat-messages {
            height: calc(100% - 180px);
            overflow-y: auto;
            padding: 35px 40px;
            display: flex;
            flex-direction: column;
            gap: 20px;
            background: linear-gradient(180deg, #fafbff 0%, #f8f9fa 100%);
            position: relative;
        }

        /* Scrollbar personnalisée */
        .chat-messages::-webkit-scrollbar {
            width: 6px;
        }

        .chat-messages::-webkit-scrollbar-track {
            background: transparent;
        }

        .chat-messages::-webkit-scrollbar-thumb {
            background: rgba(102, 126, 234, 0.3);
            border-radius: 10px;
        }

        .chat-messages::-webkit-scrollbar-thumb:hover {
            background: rgba(102, 126, 234, 0.5);
        }

        .message {
            max-width: 75%;
            padding: 18px 24px;
            border-radius: 24px;
            position: relative;
            animation: messageSlide 0.4s ease-out;
            font-size: 1.05rem;
            line-height: 1.6;
            word-wrap: break-word;
        }

        .message.system {
            align-self: center;
            background: linear-gradient(135deg, #e9ecef, #f8f9fa);
            color: #495057;
            font-size: 1rem;
            max-width: 85%;
            text-align: center;
            border-radius: 16px;
            border: 1px solid rgba(0, 0, 0, 0.05);
            backdrop-filter: blur(10px);
        }

        .message.user {
            align-self: flex-end;
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border-bottom-right-radius: 8px;
            box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
            position: relative;
        }

        .message.user::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
            border-radius: inherit;
            pointer-events: none;
        }

        .message.assistant {
            align-self: flex-start;
            background: white;
            color: #2c3e50;
            border: 1px solid #e9ecef;
            border-bottom-left-radius: 8px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            backdrop-filter: blur(10px);
            position: relative;
        }

        .message.assistant::before {
            content: '';
            position: absolute;
            left: -8px;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 30px;
            background: linear-gradient(135deg, #667eea, #764ba2);
            border-radius: 2px;
        }

        .message-time {
            font-size: 0.8rem;
            opacity: 0.6;
            margin-top: 8px;
            font-weight: 400;
        }

        .typing-indicator {
            align-self: flex-start;
            background: white;
            border: 1px solid #e9ecef;
            border-radius: 24px;
            padding: 20px 24px;
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            backdrop-filter: blur(10px);
        }

        .typing-dot {
            width: 10px;
            height: 10px;
            background: #667eea;
            border-radius: 50%;
            animation: typingBounce 1.4s infinite ease-in-out;
        }

        .typing-dot:nth-child(2) { animation-delay: 0.2s; }
        .typing-dot:nth-child(3) { animation-delay: 0.4s; }

        .chat-input-container {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: white;
            padding: 25px 35px 30px;
            border-top: 1px solid rgba(0, 0, 0, 0.06);
            border-radius: 0 0 20px 20px;
            backdrop-filter: blur(10px);
        }

        .chat-input-wrapper {
            display: flex;
            gap: 15px;
            align-items: flex-end;
            background: #f8f9fa;
            border-radius: 25px;
            padding: 8px;
            border: 2px solid transparent;
            transition: all 0.3s ease;
        }

        .chat-input-wrapper:focus-within {
            border-color: #667eea;
            box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
        }

        .chat-input {
            flex: 1;
            border: none;
            background: transparent;
            border-radius: 20px;
            padding: 15px 20px;
            font-size: 1.05rem;
            resize: none;
            max-height: 120px;
            min-height: 50px;
            font-family: inherit;
            line-height: 1.5;
        }

        .chat-input:focus {
            outline: none;
        }

        .chat-input::placeholder {
            color: #adb5bd;
            font-style: italic;
        }

        .send-btn {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border: none;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.3rem;
            transition: all 0.3s ease;
            flex-shrink: 0;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }

        .send-btn:hover {
            transform: scale(1.05) translateY(-2px);
            box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
        }

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

        /* Quick Actions modernisées */
        .quick-actions {
            display: flex;
            gap: 12px;
            margin-bottom: 20px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .quick-action {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
            border: 1px solid rgba(102, 126, 234, 0.2);
            color: #667eea;
            padding: 12px 20px;
            border-radius: 25px;
            font-size: 0.95rem;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 500;
            backdrop-filter: blur(10px);
        }

        .quick-action:hover {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
        }

        /* Responsive pour le chat moderne */
        @media (max-width: 768px) {
            .chat-interface {
                height: 100vh;
                max-height: none;
                border-radius: 0;
                max-width: 100%;
            }

            .chat-messages {
                padding: 25px 20px;
                height: calc(100% - 140px); /* Ajusté pour le header plus petit */
            }

            .message {
                max-width: 85%;
                padding: 14px 18px;
                font-size: 1rem;
            }

            .chat-input-container {
                padding: 20px;
            }

            .chat-input {
                padding: 12px 16px;
                font-size: 1rem;
            }

            .send-btn {
                width: 45px;
                height: 45px;
                font-size: 1.1rem;
            }

            .quick-actions {
                gap: 8px;
                margin-bottom: 15px;
            }

            .quick-action {
                padding: 10px 16px;
                font-size: 0.9rem;
            }
        }

        @media (max-width: 480px) {
            .chat-interface {
                height: 100vh;
                border-radius: 0;
            }

            .chat-messages {
                padding: 20px 15px;
                height: calc(100% - 120px); /* Ajusté pour le header encore plus petit */
            }

            .message {
                max-width: 90%;
                padding: 12px 16px;
            }

            .chat-input-container {
                padding: 15px;
            }

            .quick-action {
                padding: 8px 14px;
                font-size: 0.85rem;
            }
        }

        /* Animations */
        @keyframes slideInUp {
            from {
                opacity: 0;
                transform: translateY(50px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }

        @keyframes messageSlide {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes typingBounce {
            0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
            40% { transform: scale(1.2); opacity: 1; }
        }

        /* Responsive */
        @media (max-width: 768px) {
            body {
                padding: 10px;
            }

            .container {
                padding: 10px;
                max-width: 100%;
            }

            .welcome-screen,
            .color-selection,
            .welcome-back {
                padding: 25px 20px;
                border-radius: 20px;
            }

            .welcome-title {
                font-size: 2rem;
            }

            .color-title {
                font-size: 1.8rem;
            }

            .colors-grid {
                grid-template-columns: repeat(4, 1fr);
                gap: 12px;
            }

            .color-option {
                width: 55px;
                height: 55px;
                font-size: 1.3rem;
            }

            .continue-btn,
            .new-session-btn {
                width: 100%;
                margin-bottom: 10px;
                margin-right: 0;
                padding: 12px 25px;
            }

            /* Chat responsive */
            .chat-interface {
                height: 90vh;
                max-height: none;
                border-radius: 15px;
            }

            .chat-header {
                padding: 15px 20px;
                border-radius: 15px 15px 0 0;
            }

            .chat-avatar {
                width: 40px;
                height: 40px;
                font-size: 1.2rem;
            }

            .chat-user-details h3 {
                font-size: 1rem;
            }

            .chat-status {
                font-size: 0.8rem;
            }

            .chat-messages {
                padding: 20px 15px;
                height: calc(100% - 120px);
            }

            .message {
                max-width: 85%;
                padding: 10px 15px;
                font-size: 0.95rem;
            }

            .chat-input-container {
                padding: 15px;
            }

            .chat-input {
                padding: 10px 15px;
                font-size: 0.95rem;
            }

            .send-btn {
                width: 40px;
                height: 40px;
                font-size: 1rem;
            }

            .quick-actions {
                gap: 6px;
                margin-bottom: 10px;
            }

            .quick-action {
                padding: 6px 12px;
                font-size: 0.85rem;
            }
        }

        @media (max-width: 480px) {
            .colors-grid {
                grid-template-columns: repeat(3, 1fr);
                gap: 15px;
            }

            .color-option {
                width: 60px;
                height: 60px;
                font-size: 1.4rem;
            }

            .chat-interface {
                height: 95vh;
                border-radius: 10px;
            }

            .chat-header {
                border-radius: 10px 10px 0 0;
            }

            .message {
                max-width: 90%;
            }
        }