/* main.css */

/* Reset simple */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #fdf7f2, #f6fbf7);
    color: #243036;
}

/* Layout général */
.app-header {
    padding: 1.5rem 1rem;
    background: linear-gradient(90deg, #f8dada, #f7f3d6, #d7f3e4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.app-header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-title h1 {
    margin: 0;
    font-size: 1.4rem;
    letter-spacing: 0.04em;
}

.app-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff, #e74c3c);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
    position: relative;
}

.app-logo::after {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.8);
}

.app-tagline {
    font-size: 0.85rem;
    color: #5b6a71;
}

.app-container {
    max-width: 960px;
    margin: 1.5rem auto;
    padding: 0 1rem 3rem;
}

/* Cartes */
.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.25rem 1.25rem 1rem;
    box-shadow: 0 8px 20px rgba(16, 33, 43, 0.05);
    margin-bottom: 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(16, 33, 43, 0.08);
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    background: linear-gradient(135deg, #e74c3c, #f39c12);
    color: #fff;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 6px 14px rgba(231, 76, 60, 0.42);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.24);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #3ba97b, #27ae60);
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
}

/* Formulaires */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #445158;
    display: block;
    margin-bottom: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="date"],
textarea {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    border: 1px solid rgba(36, 48, 54, 0.2);
    font-size: 0.9rem;
    background: #fbfbfd;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15);
    background: #fff;
}

textarea {
    resize: vertical;
    min-height: 70px;
}

/* Tableaux */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

th,
td {
    padding: 0.4rem 0.5rem;
    text-align: left;
}

th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7a80;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

tbody tr:nth-child(even) {
    background: #fafafa;
}

/* Participants dynamique */
.participants-table input[type="text"],
.participants-table input[type="email"] {
    font-size: 0.85rem;
}

.participant-row-organizer td {
    background: rgba(231, 76, 60, 0.03);
    border-bottom: 1px dashed rgba(231, 76, 60, 0.25);
}

.participant-organizer-hint {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: #c0392b;
}

/* Admin événement : consultation */
#event-participants-body .chip {
    margin-bottom: 0.1rem;
}


/* Tags / petits textes */
.muted {
    color: #8a9aa1;
    font-size: 0.85rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    background: rgba(231, 76, 60, 0.08);
    color: #c0392b;
}

/* Cartes événements */
.event-card h3 {
    margin: 0 0 0.25rem;
}

.event-meta {
    margin: 0.15rem 0;
    font-size: 0.85rem;
    color: #66757c;
}

/* Modale */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.modal-overlay.is-visible {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 440px;
    width: 100%;
    padding: 1.2rem 1.3rem 1rem;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.28);
    transform: translateY(12px);
    transition: transform 0.2s ease;
}

.modal-overlay.is-visible .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.modal-body {
    font-size: 0.9rem;
    color: #344049;
    margin-bottom: 0.7rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Badge statut modale */
.modal-badge {
    font-size: 0.78rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(39, 174, 96, 0.12);
    color: #1e8449;
}

/* Erreur */
.modal-badge.error {
    background: rgba(192, 57, 43, 0.12);
    color: #c0392b;
}

/* Header scintillant léger */
@keyframes subtle-twinkle {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6); }
    50% { box-shadow: 0 0 8px 4px rgba(255, 255, 255, 0.8); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6); }
}

.app-logo {
    animation: subtle-twinkle 4s ease-in-out infinite;
}

/* Footer */
.app-footer {
    max-width: 960px;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
    font-size: 0.8rem;
    color: #9aa7ad;
    text-align: center;
}
