/* Styles de base pour le corps de la page */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #121212; /* Fond sombre */
    color: #E0E0E0; /* Texte clair */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column; /* Empile les enfants (header, main, footer) verticalement */
    min-height: 100vh;
}

/* Conteneur principal */
.container {
    max-width: 800px;
    padding: 20px;
}

/* En-tête avec le logo et le nom du site */
header {
    margin-bottom: 40px;
}

/* Style du logo */
.logo {
    font-size: 4em;
    font-weight: bold;
    color: #C62828; /* Couleur qui se démarque */
}

/* Style du slogan et des messages */
.slogan {
    font-size: 1.8em;
    margin-top: 10px;
    margin-bottom: 10px;
    color: #BDBDBD;
}

.description {
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 20px;
    color: #BDBDBD;
}

/* Message sur la gratuité */
.gratuit-message {
    font-size: 1.2em;
    color: #E57373;
    margin-bottom: 40px;
}

/* Style des boutons */
.button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 40px;
}

.button {
    display: inline-block;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s, background-color 0.2s;
    cursor: pointer;
}

.button:hover {
    transform: translateY(-3px);
}

.button.primary {
    background-color: #C62828;
    color: #FFFFFF;
}

.button.secondary {
    background-color: transparent;
    color: #C62828;
    border: 2px solid #C62828;
}

/* Styles pour le formulaire de connexion */
.login-form-container {
    background-color: #1e1e1e;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.login-form-container h2 {
    color: #E0E0E0;
    margin-bottom: 25px;
    font-size: 1.6em;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #BDBDBD;
}

.form-group input {
    width: calc(100% - 22px);
    padding: 10px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: #E0E0E0;
    font-size: 1em;
}

.error-message {
    color: #FF5252;
    margin-bottom: 15px;
    font-weight: bold;
}

.login-form-container button.button {
    margin-top: 20px;
}

/* Style des paragraphes de liens */
.login-form-container p {
    margin-top: 20px;
    font-size: 1em;
}

/* Style des liens par défaut (non visités) */
.login-form-container a {
    color: #8AC9FF; /* Bleu doux */
    text-decoration: none;
    font-weight: bold;
}
/* Style des liens visités (bleu un peu plus foncé) */
.login-form-container a:visited {
    color: #66A8D2; /* Un peu plus bleu */
}
.login-form-container a:hover {
    text-decoration: underline;
}

/* Styles spécifiques pour la page profil */
.profile-container {
    background-color: #1e1e1e;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 800px;
    text-align: left;
    margin-top: 20px;
}

.profile-header {
    text-align: center;
    margin-bottom: 20px;
}

.profile-header h1 {
    color: #C62828;
    font-size: 2em;
    margin-bottom: 5px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.profile-info p {
    font-size: 1.1em;
    color: #BDBDBD;
}
        
.profile-info .label {
    font-weight: bold;
    color: #E0E0E0;
}

.photos-container {
    margin-top: 40px;
}
        
.photos-container h2 {
    color: #C62828;
    font-size: 1.5em;
    margin-bottom: 20px;
    text-align: center;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    justify-content: center;
}

.photo-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logout-link {
    margin-top: 40px;
    text-align: center;
}

.logout-link a {
    color: #8AC9FF;
    text-decoration: none;
    font-weight: bold;
}

.logout-link a:hover {
    text-decoration: underline;
}

/* Styles de la page principale */
.main-header {
    background-color: #1e1e1e;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header .logo-container {
    display: flex;
    align-items: center;
    gap: 0; 
}

/* --- Règles pour le nouveau design du header --- */
.header-text-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-heart {
    width: 50px;
    height: auto;
}

.logo-pixel-art {
    width: 150px;
    height: auto;
    margin-left: 4px;
}

.tagline {
    font-size: 0.9em;
    margin: 0;
    padding-left: 5px;
}
/* --- Fin des règles pour le header --- */

/* Menu de navigation */
.nav-menu {
    display: flex;
    gap: 25px;
}

.nav-menu a {
    color: #E0E0E0;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: #C62828;
}

/* Corps de la page */
.main-content {
    padding: 30px 20px;
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.profile-card {
    background-color: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    transition: transform 0.3s;
}

.profile-card:hover {
    transform: translateY(-5px);
}

.profile-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-info {
    padding: 15px;
}

.profile-info h3 {
    color: #E0E0E0;
    font-size: 1.4em;
    margin: 0 0 5px 0;
}

.profile-info p {
    color: #BDBDBD;
    font-size: 0.9em;
    margin: 0;
}

/* Pied de page */
.main-footer {
    background-color: #1e1e1e;
    color: #BDBDBD;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* --- Styles pour les modales et la lightbox --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    padding-top: 50px; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgb(0,0,0); 
    background-color: rgba(0,0,0,0.9); 
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
}

.modal-content, #caption {
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {transform:scale(0)} 
    to {transform:scale(1)}
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Style pour la modale d'envoi de message */
.message-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    padding-top: 60px;
}

.message-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    text-align: center;
}

.message-modal-content textarea {
    width: 100%;
    height: 150px;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}
/* --- Fin des styles de modales --- */


/* --- Styles pour la page Messages --- */
.messages-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.conversations-list, .chat-window {
    background-color: #1e1e1e; /* Cohérence avec le reste du site */
    color: #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.conversations-list {
    flex: 1 1 300px;
    min-width: 250px;
}

.chat-window {
    flex: 3 1 600px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Éléments de la liste de conversations */
.conversation-item {
    padding: 10px;
    margin-bottom: 5px;
    border-bottom: 1px solid #333; /* Cohérence avec le reste du site */
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #e0e0e0;
    text-decoration: none;
}

.conversation-item:hover {
    background-color: #333;
}

.conversation-item.active {
    background-color: #C62828; /* Cohérence avec le reste du site */
    font-weight: bold;
    color: #fff;
}

/* Cartes de demandes */
.request-card {
    background-color: #333;
    border: 1px solid #C62828; /* Cohérence avec le reste du site */
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
}
.request-card.sent {
    border-color: #66bb6a;
}
.request-card p {
    margin-bottom: 10px;
}
.request-card .actions button {
    margin-right: 10px;
}

/* Chat Box */
.chat-box {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 500px;
    padding: 10px;
    border: 1px solid #333; /* Cohérence avec le reste du site */
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    background-color: #121212; /* Cohérence avec le reste du site */
}
.chat-message {
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 20px;
    max-width: 75%;
    word-wrap: break-word;
    color: #fff;
    font-size: 0.95em;
}

.chat-message.sent {
    background-color: #C62828; /* Cohérence avec le reste du site */
    align-self: flex-end;
    margin-left: auto;
    text-align: left;
}

.chat-message.received {
    background-color: #333; /* Cohérence avec le reste du site */
    align-self: flex-start;
    text-align: left;
}

.chat-message small {
    display: block;
    font-size: 0.7em;
    color: #bbb;
    margin-top: 5px;
}
.chat-input {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.chat-input textarea {
    flex-grow: 1;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #C62828; /* Cohérence avec le reste du site */
    resize: vertical;
    min-height: 40px;
    max-height: 120px;
    background-color: #333;
    color: #e0e0e0;
}
.chat-input button {
    padding: 10px 20px;
}
.chat-input.disabled textarea, .chat-input.disabled button {
    background-color: #555 !important;
    color: #999 !important;
    cursor: not-allowed;
}
.chat-input.disabled button {
    border: 1px solid #999;
}

/* Notification Badge */
.notification-badge {
    background-color: #ef5350;
    color: white;
    border-radius: 50%;
    padding: 3px 8px;
    font-size: 0.75em;
    margin-left: 8px;
    min-width: 25px;
    text-align: center;
    box-shadow: 0 0 5px rgba(239, 83, 80, 0.5);
}

/* Media Queries pour le responsive design */
@media (min-width: 600px) {
    .button-group {
        flex-direction: row;
        justify-content: center;
    }
}
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-header .logo-container {
        margin-bottom: 15px;
    }

    .nav-menu {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        padding: 10px 0;
        border-bottom: 1px solid #333;
    }

    .profiles-grid {
        grid-template-columns: 1fr;
    }
    .messages-layout {
        flex-direction: column;
    }
    .conversations-list, .chat-window {
        flex: 1 1 100%;
    }
}