@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;700&display=swap');

body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #ffe3ec, #fff7e9);
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    text-align: center;
    width: 90%;
    max-width: 600px;
    margin-top: 60px;
    animation: fadeIn 1s ease-in-out;
}

h1 {
    color: #ff5c8d;
    text-shadow: 1px 1px 3px #fff;
    font-weight: 700;
    margin-bottom: 10px;
}

.subtitle {
    color: #555;
    font-weight: 400;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 20px;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-3px);
}

input, textarea {
    width: 90%;
    margin: 8px 0;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #ddd;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}

input:focus, textarea:focus {
    border-color: #ff5c8d;
    outline: none;
    box-shadow: 0 0 5px #ffadc4;
}

textarea {
    height: 100px;
    resize: none;
}

button {
    background: linear-gradient(135deg, #ff5c8d, #ff85a1);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 25px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

button:hover {
    background: linear-gradient(135deg, #ff3e7f, #ff7f9d);
    transform: scale(1.05);
}

.note {
    font-size: 0.9rem;
    color: #666;
    margin-top: 15px;
}

/* --- Animations globales --- */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes floatIn {
    from { opacity: 0; transform: translateY(15px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ----------- ADMIN PAGE ET MESSAGES ----------- */

.admin-container {
    max-width: 800px;
    margin: 60px auto;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
    animation: fadeIn 1s ease-in-out;
}
 
.title {
    color: #ff5c8d;
    margin-bottom: 20px;
}
 
.login-card input {
    width: 70%;
    margin-top: 10px;
}
 
.hidden {
    display: none;
}
 
/* --- Toolbar (haut de page admin) --- */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
 
.tools {
    display: flex;
    gap: 10px;
    align-items: center;
}
 
#search {
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
}
 
#search:focus {
    outline: none;
    border-color: #ff5c8d;
    box-shadow: 0 0 5px #ffadc4;
}
 
button.danger {
    background: linear-gradient(135deg, #ff6b6b, #ff3b3b);
}
 
button.danger:hover {
    background: linear-gradient(135deg, #ff4444, #ff2a2a);
    transform: scale(1.05);
}

/* --- Messages (bubbles) --- */

.messages {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 15px 10px;
    align-items: center;
    animation: fadeIn 0.6s ease;
}

/* Style général de la bulle */
.bubble {
    position: relative;
    padding: 16px 22px;
    /* Ajout de padding à droite pour faire de la place au bouton Supprimer */
    padding-right: 55px; 
    border-radius: 18px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-width: 75%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: floatIn 0.7s ease both;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Effet au survol */
.bubble:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* Bulles alternées */
.bubble.left {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(255, 245, 250, 0.85), rgba(255, 210, 230, 0.5));
    border-top-left-radius: 5px;
}

.bubble.right {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(240, 235, 255, 0.85), rgba(210, 200, 255, 0.45));
    border-top-right-radius: 5px;
}

/* Nom de l’expéditeur */
.sender {
    font-weight: 700;
    font-size: 1.05rem;
    color: #ff4f8a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sender::before {
    content: "👤";
    font-size: 1.1rem;
}

/* Texte du message */
.text {
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
    white-space: pre-wrap;
    text-align: left;
}

/* Date et heure */
.date {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #666;
    text-align: right;
    font-style: italic;
}

/* Quand aucun message n’est présent */
.empty {
    color: #aaa;
    font-style: italic;
    font-size: 1rem;
    margin-top: 30px;
}

/* --- Bouton de suppression dans Admin --- */

.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff5c8d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 0.8rem;
    cursor: pointer;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background 0.2s, transform 0.2s;
    font-weight: 700;
}

.delete-btn:hover {
    background: #e6005c;
    transform: scale(1.1);
}