/* Variables CSS - Couleurs REPER */
:root {
    --primary-color: #a40528;      /* Rouge REPER principal */
    --primary-hover: #820306;      /* Rouge REPER foncé (hover) */
    --primary-light: #c6274a;      /* Rouge REPER clair */
    --secondary-color: #1E73BE;    /* Bleu REPER (liens) */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --background: #ffffff;         /* Fond blanc REPER */
    --surface: #ffffff;
    --text-primary: #222222;       /* Texte principal REPER */
    --text-secondary: #666666;     /* Texte secondaire REPER */
    --border-color: #e1e1e1;       /* Bordures REPER */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(164, 5, 40, 0.1), 0 4px 6px -2px rgba(164, 5, 40, 0.05);
    --border-radius: 0.5rem;
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    min-height: 100vh;
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Container admin - 100% de largeur */
.admin-container {
    max-width: 100%;
    padding: 1rem 2rem;
    width: 100%;
}

@media (max-width: 768px) {
    .admin-container {
        padding: 1rem;
    }
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
    border-bottom: 3px solid var(--primary-color);
}

header .logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
    display: inline-block;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Main */
main {
    max-width: 900px;
    margin: 0 auto;
}

/* Blocs explicatifs */
.info-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.info-block {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.info-block-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    margin-top: 0;
}

.info-block-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

.info-block-content p {
    margin: 0 0 0.75rem 0;
}

.info-block-content p:last-child {
    margin-bottom: 0;
}

.info-block-content ul,
.info-block-content ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.info-block-content li {
    margin-bottom: 0.5rem;
}

.info-block-content li:last-child {
    margin-bottom: 0;
}

/* Calendrier */
.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.date-section {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.date-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.slots-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

/* Créneaux */
.slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
    min-height: 80px;
    cursor: pointer;
}

.slot-available {
    background: var(--surface);
    color: var(--text-primary);
}

.slot-available:hover {
    border-color: var(--primary-color);
    background: rgba(164, 5, 40, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.slot-booked {
    background: #f3f4f6;
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
}

.slot-time {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.slot-status {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.slot-available .slot-status {
    color: var(--success-color);
}

.slot-booked .slot-status {
    color: var(--secondary-color);
}

/* État vide */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Formulaire */
.booking-summary {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.booking-summary h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.booking-summary p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.booking-summary strong {
    color: var(--text-primary);
}

.booking-form {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.required {
    color: var(--danger-color);
    margin-left: 0.25rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input:invalid {
    border-color: var(--danger-color);
}

/* Actions du formulaire */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--background);
    border-color: var(--secondary-color);
}

/* Page de remerciement */
.thank-you {
    text-align: center;
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto;
}

.thank-you-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
}

.thank-you h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.thank-you-message {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.booking-details {
    background: var(--background);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: left;
}

.booking-details p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.booking-details strong {
    color: var(--text-primary);
}

.thank-you-actions {
    margin-top: 2rem;
}

.email-warning {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 1.5rem 0;
}

.warning-message {
    color: #92400e;
    margin: 0;
    font-weight: 500;
}

/* Administration */
.login-form-container {
    max-width: 400px;
    margin: 3rem auto;
}

.login-form {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.login-form h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-align: center;
}

.admin-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.booking-count {
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    background: var(--background);
    border-radius: var(--border-radius);
}

.bookings-table-container {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    width: 100%;
}

.bookings-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 100%;
}

.bookings-table thead {
    background: var(--primary-color);
    color: white;
}

.bookings-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bookings-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.bookings-table tbody tr:hover {
    background: rgba(164, 5, 40, 0.05);
}

.bookings-table tbody tr:last-child td {
    border-bottom: none;
}

.date-small {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.btn-delete {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    font-family: inherit;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #d1fae5;
    border: 2px solid var(--success-color);
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    border: 2px solid var(--danger-color);
    color: #991b1b;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .info-blocks {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .info-block {
        padding: 1.25rem;
    }

    .info-block-title {
        font-size: 1.125rem;
    }

    .date-section {
        padding: 1rem;
    }

    .slots-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }

    .slot {
        min-height: 70px;
        padding: 0.75rem;
    }

    .slot-time {
        font-size: 1rem;
    }

    .slot-status {
        font-size: 0.75rem;
    }

    .booking-form {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .thank-you {
        padding: 2rem 1rem;
    }

    .thank-you-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .bookings-table-container {
        overflow-x: scroll;
    }
    
    .bookings-table {
        min-width: 800px;
    }
    
    .bookings-table th,
    .bookings-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .booking-count {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .slots-container {
        grid-template-columns: repeat(2, 1fr);
    }

    header {
        padding: 1rem 0;
    }
}

/* Amélioration de l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible pour l'accessibilité clavier */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}
