/* Réinitialisation et configuration de base */
:root {
    --primary-color: #F57C00;
    /* Orange */
    --secondary-color: #FF9800;
    /* Orange plus clair */
    --dark-color: #212121;
    /* Noir doux */
    --light-color: #FFFFFF;
    /* Blanc */
    --text-color: #424242;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f4f9;
    color: var(--text-color);
    line-height: 1.6;
}

/* En-tête */
.main-header {
    background: var(--dark-color);
    color: var(--light-color);
    padding: 1.5rem 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

.main-header h1 {
    margin-bottom: 0.2rem;
}

/* Conteneur du tableau de bord */
.dashboard-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Style des cartes */
.card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--light-color);
    text-decoration: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-content {
    padding: 1.5rem;

    @media (min-width: 900px) {
        .dashboard-container {
            grid-template-columns: repeat(4, 1fr);
        }
    }
}

.card-content h2 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.card-content p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Responsive pour les écrans plus larges (tablettes et ordinateurs) */
@media (min-width: 600px) {
    .dashboard-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .dashboard-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 900px) {
    .dashboard-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Styles pour les pages de formulaire */
.back-button {
    position: absolute;
    top: 1.5rem;
    left: 1rem;
    color: var(--light-color);
    text-decoration: none;
    font-size: 1rem;
}

.form-container {
    max-width: 600px;
    margin: 1rem auto;
    padding: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    /* Ajout de textarea ici */
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
}

.btn-submit {
    width: 100%;
    padding: 0.9rem;
    border: none;
    border-radius: 5px;
    background-color: var(--primary-color);
    color: var(--light-color);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-submit:hover {
    background-color: #e65100;
    /* Orange plus foncé */
}

.btn-submit:disabled {
    background-color: #9e9e9e;
    cursor: not-allowed;
}

/* Messages de feedback */
.feedback {
    padding: 0.8rem;
    margin-top: 1rem;
    border-radius: 5px;
    text-align: center;
    display: none;
    /* Caché par défaut */
}

.feedback.success {
    background-color: #D4EDDA;
    color: #155724;
    display: block;
}

.feedback.error {
    background-color: #F8D7DA;
    color: #721C24;
    display: block;
}

/* --- STYLES POUR LA PAGE LISTE DES INVITÉS --- */

.list-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

/* Statistiques */
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--light-color);
    padding: 0.8rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.stat-card h4 {
    font-size: 0.8rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.stat-card span {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Barre de recherche */
.search-wrapper {
    margin-bottom: 1.5rem;
}

#search-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

/* Liste des invités */
.invites-list {
    display: grid;
    gap: 1rem;
}

.loading-message, .no-results {
    text-align: center;
    padding: 2rem;
    color: #777;
}

/* Carte d'invité */
.invite-card {
    background: var(--light-color);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    /* Animation */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.invite-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background-color: #fafafa;
    border-bottom: 1px solid #eee;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.invite-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--dark-color);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.recu {
    background-color: #4CAF50;
    /* Vert */
}

.status-dot.non-recu {
    background-color: #9E9E9E;
    /* Gris */
}

.card-body {
    padding: 1rem;
    display: grid;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.card-body p {
    margin: 0;
}

.card-body .description {
    font-style: italic;
    color: #555;
    font-size: 0.85rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background-color: #fafafa;
    border-top: 1px solid #eee;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.date {
    font-size: 0.8rem;
    color: #777;
}

.btn-edit {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-edit:hover {
    background-color: #e65100;
}

/* --- STYLES POUR LA PAGE LISTE DES TABLES --- */
.tables-list {
    display: grid;
    gap: 1rem;
}

.table-card {
    background: var(--light-color);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.table-card-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.table-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--dark-color);
}

.table-card-body {
    padding: 1rem;
}

.occupation-info {
    font-size: 0.95rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 6px;
    transition: width 0.5s ease-in-out;
}

.table-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background-color: #fafafa;
    border-top: 1px solid #eee;
}

.btn-edit-table, .btn-delete-table {
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-edit-table {
    background-color: #2196F3;
    /* Bleu */
    color: white;
}

.btn-delete-table {
    background-color: #f44336;
    /* Rouge */
    color: white;
}

/* Style pour le toggle switch */
.form-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Style des cartes */
.card {
    color: var(--light-color);
    text-decoration: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    /* Pour les effets de survol */
}

/* Dégradés uniques pour chaque carte */
.card-1 {
    background: linear-gradient(135deg, #f7971e, #ffd200);
}

/* Orange -> Jaune */
.card-2 {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
}

/* Bleu Ciel -> Bleu */
.card-3 {
    background: linear-gradient(135deg, #d4145a, #fbb03b);
}

/* Magenta -> Orange */
.card-4 {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

/* Vert d'eau -> Vert clair */
/* --- Section des KPIs sur la page d'accueil --- */
.kpi-section {
    padding: 1rem;
    max-width: 1200px;
    margin: 1rem auto 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.kpi-card {
    background: var(--light-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.kpi-icon {
    flex-shrink: 0;
    color: var(--primary-color);
}

.kpi-icon svg {
    width: 32px;
    height: 32px;
}

.kpi-info {
    display: flex;
    flex-direction: column;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.1;
}

.kpi-label {
    font-size: 0.9rem;
    color: #666;
}

@media (min-width: 600px) {
    .kpi-section {
        grid-template-columns: repeat(4, 1fr);
    }
}