/* Reset de base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

body {
    font-family: system-ui, sans-serif;
    background-color: #f8f9fb;
    color: #222;
    line-height: 1.6;
}

a {
    color: #007BFF;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 0;
}

/* Header */
.site-header {
    background-color: #004080;
    color: white;
    padding: 0.8rem 0;
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
}
.main-nav a {
    color: white;
    font-weight: 500;
}
.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Avatar mini */
.avatar-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 5px;
    vertical-align: middle;
}

/* Formulaires */
form {
    background: white;
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    max-width: 500px;
    margin: 1rem auto;
}
form label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
}
form input[type="text"],
form input[type="email"],
form input[type="password"],
form select {
    width: 100%;
    padding: 0.6rem;
    margin-top: 0.3rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}
form button {
    background-color: #007BFF;
    color: white;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
form button:hover {
    background-color: #0056b3;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: -0.8rem;
    margin-bottom: 1rem;
}

.links {
    text-align: center;
    margin-top: 1rem;
}

.error {
    color: red;
    margin-top: 1rem;
    font-weight: bold;
}

/* Page d’accueil */
.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0.3rem;
    }

    form {
        padding: 1rem;
    }

    .message-thread li em {
        display: block;
        float: none;
        margin-top: 0.3em;
    }
}

/* Tables */
.user-table,
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.user-table th,
.user-table td,
.table th,
.table td {
    border: 1px solid #ccc;
    padding: 0.6rem;
    text-align: left;
}
.user-table th,
.table th {
    background-color: #007bff;
    color: white;
}
.banned {
    color: red;
    font-weight: bold;
}

/* Chat */
.chat-box {
    background: #fff;
    border: 1px solid #ccc;
    padding: 1rem;
    margin-bottom: 1rem;
    max-height: 400px;
    overflow-y: auto;
}
.chat-message {
    margin-bottom: 1rem;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 0.5rem;
}

/* Notifications */
.notif-popup {
    position: fixed;
    top: 70px;
    right: 20px;
    background: #004080;
    color: white;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    z-index: 999;
    min-width: 220px;
}
.notif-popup a {
    color: #fff;
    text-decoration: underline;
}

/* Admin */
.admin-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}
.admin-card {
    flex: 1 1 250px;
    background: white;
    border: 1px solid #ccc;
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: #004080;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}
.admin-card:hover {
    background: #f0f8ff;
    border-color: #007bff;
}
.admin-card h2 {
    margin-bottom: 0.5rem;
}
.page-content {
    margin-top: 1rem;
    line-height: 1.6;
}
.admin-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}
.stat-box {
    background: #f2f8ff;
    border: 1px solid #007bff;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    flex: 1;
}
.stat-box strong {
    font-size: 2rem;
    color: #004080;
}
.stat-box span {
    display: block;
    margin-top: 0.5rem;
    color: #333;
}

/* Footer */
.site-footer {
    background-color: #f5f5f5;
    padding: 15px;
    text-align: center;
    color: #333;
    border-top: 1px solid #ddd;
    font-size: 0.9em;
}

/* Messages */
.message-thread {
    list-style: none;
    padding: 0;
    margin: 1em 0;
}
.message-thread li {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 1em;
    margin-bottom: 1em;
    background-color: #f9f9ff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.message-thread li strong {
    color: #1a4d8f;
    font-weight: bold;
}
.message-thread li em {
    float: right;
    color: #888;
    font-size: 0.9em;
}
.message-thread li div {
    margin-top: 0.5em;
    white-space: pre-wrap;
}

/* Réponse */
#reply-form textarea {
    width: 100%;
    border: 1px solid #ccc;
    padding: 0.5em;
    border-radius: 5px;
    resize: vertical;
    font-size: 1em;
}
#reply-form button {
    margin-top: 0.5em;
    padding: 0.6em 1.2em;
    background-color: #1a4d8f;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 1em;
    cursor: pointer;
}
#reply-form button:hover {
    background-color: #163f77;
}

/* Divers */
.status {
    margin-top: 0.5em;
    font-weight: bold;
}
.avatar-msg {
    display: flex;
    gap: 0.8em;
    align-items: flex-start;
}
.avatar-thread {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ccc;
    background-color: #fff;
}
.msg-body {
    flex: 1;
}
.msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.msg-text {
    margin-top: 0.4em;
    white-space: pre-wrap;
}
.custom-fields {
    list-style: none;
    padding: 0;
}
.custom-fields li {
    margin-bottom: 0.5rem;
}
.custom-field-form label {
    display: block;
    margin-bottom: 1rem;
}
.button {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 1rem;
}
.button:hover {
    background: #0056b3;
}
