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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Navigation */
.app-header {
    background-color: #1e293b;
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    color: #3b82f6;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #3b82f6;
}

/* Conteneurs principaux */
.contact-container,
.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    flex: 1;
    width: 90%;
}

.title {
    font-size: 2rem;
    color: #0f172a;
    font-weight: 700;
}

.title-bar {
    width: 50px;
    height: 4px;
    background-color: #3b82f6;
    margin: 0.5rem 0 1.5rem 0;
    border-radius: 2px;
}

/* Dispositions Formulaire & Infos */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
    }
}

.info-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.icon-box {
    width: 45px;
    height: 45px;
    background-color: #eff6ff;
    color: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.info-item h3 {
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 0.2rem;
}

.info-item p {
    color: #64748b;
    font-size: 0.95rem;
}

/* Formulaire */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

@media (max-width: 576px) {
    .form-row {
        flex-direction: column;
    }
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-container {
    margin-top: 0.5rem;
}

.btn-submit {
    background-color: #3b82f6;
    color: #fff;
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: #2563eb;
}

/* Alerts */
.alert-success {
    padding: 1rem;
    background-color: #d1fae5;
    color: #065f46;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-danger {
    padding: 1rem;
    background-color: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Liens complémentaires */
.contacts-list-link {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.btn-contacts {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.btn-contacts:hover {
    text-decoration: underline;
}

/* Dashboard Admin Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn-logout {
    background-color: #ef4444;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-logout:hover {
    background-color: #dc2626;
}

/* -------------------------------------------------------------------------- */
/* Dashboard Admin Tableau — Conversion Mobile-First (Cards Stack)             */
/* -------------------------------------------------------------------------- */
.table-container {
    width: 100%;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

/* Mode Mobile (< 768px) : Transformation du Tableau en Cartes Individuelles */
@media (max-width: 767.98px) {

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    /* Masquer l'en-tête classique */
    thead {
        display: none;
    }

    /* Chaque ligne devient une carte */
    tbody tr {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        margin-bottom: 1rem;
        padding: 0.85rem 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    /* Cellules en mode Flex (Clé / Valeur) */
    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.6rem 0;
        border-bottom: 1px dashed #edf2f7;
        text-align: right;
        font-size: 0.9rem;
    }

    /* Injection automatique du libellé de colonne */
    td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #475569;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.5px;
        margin-right: 1rem;
        text-align: left;
    }

    /* Style spécifique pour la cellule Message */
    td.message-cell {
        border-bottom: none;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        background-color: #f8fafc;
        padding: 0.75rem;
        border-radius: 6px;
        margin-top: 0.5rem;
        max-width: 100%;
        word-break: break-word;
    }

    td.message-cell::before {
        margin-bottom: 0.35rem;
    }
}

/* Mode Bureau (>= 768px) : Tableau classique */
@media (min-width: 768px) {

    th,
    td {
        padding: 0.85rem 1rem;
        text-align: left;
        border-bottom: 1px solid #e2e8f0;
        font-size: 0.9rem;
        vertical-align: middle;
    }

    th {
        background-color: #f8fafc;
        color: #475569;
        font-weight: 600;
    }

    tbody tr:hover {
        background-color: #f8fafc;
    }

    .message-cell {
        max-width: 250px;
        word-wrap: break-word;
    }
}

/* Footer */
.app-footer {
    background-color: #1e293b;
    color: #94a3b8;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
    font-size: 0.9rem;
}

.app-footer a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* Conteneur du mot de passe et du bouton Oeil */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 2.8rem;
    /* Espace réservé pour éviter que le texte ne chevauche l'icône */
}

.toggle-password-btn {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    z-index: 2;
}

.toggle-password-btn:hover {
    color: #3b82f6;
}

.toggle-password-btn:focus {
    outline: none;
    color: #3b82f6;
}

/* Optimisation Mobile-First pour le conteneur de Login */
@media (max-width: 576px) {
    .contact-container[style*="max-width: 450px"] {
        width: 92%;
        margin: 1.5rem auto;
        padding: 1.5rem 1.2rem;
    }
}

/* --- Footer Stats Bar (Intégré au thème sombre) --- */
.footer-stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    background-color: transparent;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #cbd5e1;
}

.stat-divider {
    color: #475569;
}

/* Témoin lumineux vert clignotant */
.online-indicator {
    width: 9px;
    height: 9px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.icon-views {
    color: #94a3b8;
    font-size: 0.95rem;
}

.stat-label {
    color: #38bdf8;
    font-weight: 500;
    font-style: italic;
}

.stat-value {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: #22c55e;
    font-size: 0.95rem;
}

/* Responsive Mobile */
@media (max-width: 576px) {
    .footer-stats-bar {
        gap: 10px;
        font-size: 0.8rem;
    }
}


/* roue dentée */
.stat-admin-link {
    color: inherit;
    text-decoration: none;
    transition: transform 0.3s ease, color 0.3s ease;
    display: inline-block;
}

.stat-admin-link:hover {
    color: #007bff;
    transform: rotate(45deg);
}



/* Custom Visitor Logs Styles */
.fs-7 {
    font-size: 0.825rem;
}

.font-monospace {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
}

.table-responsive {
    scrollbar-width: thin;
}