/* ============================================
   RESET & BASE
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #0a0a0a;
    color: #e8e8e8;
    line-height: 1.6;
    min-height: 100vh;
}

/* Mode chat uniquement si .chat-container existe */
body:has(.chat-container) {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    padding: 20px 30px;
    text-align: center;
    border-bottom: 2px solid rgba(255, 77, 87, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.header h1 {
    font-size: 2em;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    letter-spacing: 0.5px;
}

.heart {
    color: #ff4d57;
    font-size: 1.3em;
    animation: heartbeat 1.8s ease-in-out infinite;
    display: inline-block;
    filter: drop-shadow(0 0 8px rgba(255, 77, 87, 0.6));
}

@keyframes heartbeat {
    0%, 100% { 
        transform: scale(1); 
    }
    14% { 
        transform: scale(1.2); 
    }
    28% { 
        transform: scale(1); 
    }
    42% { 
        transform: scale(1.2); 
    }
    56% { 
        transform: scale(1); 
    }
}

.subtitle {
    color: #888;
    font-size: 0.9em;
    margin-top: 8px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* ============================================
   CHAT CONTAINER
   ============================================ */

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: #0a0a0a;
    overflow: hidden;
}

/* ============================================
   MESSAGES
   ============================================ */

#messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#messages::-webkit-scrollbar {
    width: 10px;
}

#messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 5px;
}

#messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #333 0%, #222 100%);
    border-radius: 5px;
    border: 2px solid #0a0a0a;
}

#messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #444 0%, #333 100%);
}

/* ============================================
   MESSAGE BUBBLES - VERSION ÉPURÉE
   ============================================ */

.message {
    padding: 16px 22px;
    border-radius: 16px;
    max-width: 75%;
    word-wrap: break-word;
    animation: slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    line-height: 1.7;
    font-size: 15px;
    position: relative;
    box-shadow: none;
    border-bottom: 1px solid rgba(224, 224, 224, 0.1);
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(20px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.user-message {
    background: #333;
    color: #fff;
    align-self: flex-end;
    margin-left: auto;
    font-weight: 400;
    text-shadow: none;
    border: 1px solid #444;
}

.assistant-message {
    background: #222;
    color: #fff;
    align-self: flex-start;
    font-weight: 400;
    text-shadow: none;
    border: none;
    box-shadow: none;
}

.message:last-child {
    border-bottom: none;
}

/* ============================================
   INPUT CONTAINER
   ============================================ */

.input-container {
    display: flex;
    gap: 12px;
    padding: 20px 25px;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
    border-top: 2px solid rgba(255, 77, 87, 0.2);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

#userInput {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #333;
    border-radius: 12px;
    background: #1a1a1a;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

#userInput:focus {
    border-color: #ff6b35;
    background: #222;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

#userInput::placeholder {
    color: #666;
    font-style: italic;
}

#sendBtn {
    padding: 16px 40px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff4d57 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 77, 87, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#sendBtn:hover {
    background: linear-gradient(135deg, #ff7f50 0%, #ff6b6b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 77, 87, 0.4);
}

#sendBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 77, 87, 0.3);
}

#sendBtn:disabled {
    background: #2a2a2a;
    color: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================
   BOUTONS DE SUGGESTION
   ============================================ */

.message button[type="button"],
button[type="button"] {
    background: #1a1a1a !important;
    color: #ffffff !important;
    border: 1px solid #2a2a2a !important;
    border-radius: 20px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.message button[type="button"]:hover,
button[type="button"]:hover {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.message button[type="button"]:active,
button[type="button"]:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* ============================================
   LOADING
   ============================================ */

.loading {
    display: none;
    color: #ff6b35;
    padding: 15px 20px;
    text-align: center;
    font-style: italic;
    font-size: 14px;
    font-weight: 500;
}

.loading.active {
    display: block;
    animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 0.4; 
    }
    50% { 
        opacity: 1; 
    }
}

/* ============================================
   PAGE AVIS - FORMULAIRE
   ============================================ */

.content-page {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.content-page h2 {
    color: #ff6b35;
    font-size: 2em;
    margin-bottom: 30px;
    text-align: center;
}

.form-group {
    margin-bottom: 25px;
}

.form-group > label {
    display: block;
    color: #e8e8e8;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

/* ============================================
   ÉTOILES - CSS PUR
   ============================================ */

.rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 8px;
    font-size: 40px;
    margin: 10px 0;
}

.rating input[type="radio"] {
    display: none;
}

.rating label {
    cursor: pointer;
    transition: all 0.2s ease;
    filter: grayscale(100%);
    opacity: 0.4;
}

/* Hover : allume l'étoile + toutes celles d'après */
.rating label:hover,
.rating label:hover ~ label {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

/* Checked : garde l'étoile + toutes celles d'après allumées */
.rating input[type="radio"]:checked ~ label {
    filter: grayscale(0%);
    opacity: 1;
}

/* ============================================
   INPUT & TEXTAREA
   ============================================ */

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: #0a0a0a;
    border: 2px solid #333;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b35;
    background: #111;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.6;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #666;
    font-style: italic;
}

/* ============================================
   BOUTON SUBMIT
   ============================================ */

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff4d57 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 77, 87, 0.3);
    margin-top: 10px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #ff7f50 0%, #ff6b6b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 77, 87, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 77, 87, 0.3);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5em;
    }
    
    .message {
        max-width: 85%;
        font-size: 14px;
    }
    
    .input-container {
        padding: 15px;
    }
    
    #userInput {
        font-size: 14px;
    }
    
    #sendBtn {
        padding: 14px 25px;
        font-size: 14px;
    }
    
    .content-page {
        margin: 20px;
        padding: 25px;
    }
    
    .content-page h2 {
        font-size: 1.6em;
    }
    
    .rating {
        font-size: 32px;
    }
}
