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

:root {
    --primary-color: #0099cc;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --neutral-color: #e5e7eb;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --border-color: #d1d5db;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-dark);
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header .subtitle {
    font-size: 0.95rem;
    color: var(--text-light);
}

/* Main */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

/* Présentation */
.description ul {
    list-style: none;
    margin-top: 1rem;
}

.description li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bg-light);
    font-size: 1.05rem;
}

.description li:last-child {
    border-bottom: none;
}

/* CALENDRIER VISUEL */
.calendar-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.calendar-controls h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.btn-nav {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.btn-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.btn-nav:active {
    transform: translateY(0);
}

/* Grille calendrier */
.calendar-grid {
    max-width: 550px;
    margin: 0 auto;
    max-width: 550px;
    margin: 0 auto;
}
.calendar-grid {
    max-width: 550px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-top: 1rem;
}

.calendar-day-header {
    text-align: center;
    padding: 0.5rem 0.25rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-light);
    border-radius: 8px;
}

.calendar-day {
    aspect-ratio: 1; max-width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    position: relative;
    transition: all 0.3s;
    cursor: default;
    font-size: 0.95rem;
    font-weight: 600;
}

.calendar-day:not(.empty):hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
}

.calendar-day.empty {
    border: none;
    background: transparent;
}

/* États du jour */
.calendar-day.available {
    background: linear-gradient(135deg, #86efac 0%, #22c55e 100%);
    border-color: var(--success-color);
    color: #14532d;
}

.calendar-day.unavailable {
    background: linear-gradient(135deg, #fca5a5 0%, #ef4444 100%);
    border-color: var(--danger-color);
    color: #7f1d1d;
}

.calendar-day.neutral {
    background: white;
    border-color: var(--border-color);
    color: var(--text-light);
}

/* Aujourd'hui */
.calendar-day.today {
    border: 3px solid #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
    font-weight: 800;
}

.calendar-day.today::after {
    content: "Aujourd'hui";
    position: absolute;
    bottom: 2px;
    font-size: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #d97706;
}

/* Légende */
.legend {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legend-color {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.legend-color.available {
    background: linear-gradient(135deg, #86efac 0%, #22c55e 100%);
    border-color: var(--success-color);
}

.legend-color.unavailable {
    background: linear-gradient(135deg, #fca5a5 0%, #ef4444 100%);
    border-color: var(--danger-color);

}
.legend-color.pending {
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
    border-color: #f59e0b;
}
}
/* Contact */
.contact-info {
    margin: 0.75rem 0;
    font-size: 1.05rem;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Admin */
.admin-section {
    display: grid;
    gap: 2rem;
}

.admin-controls {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 153, 204, 0.1);
}

/* Boutons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.btn-delete {
    background: var(--danger-color);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-delete:hover {
    background: #dc2626;
}

/* Liste périodes admin */
.periode-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    border-left: 4px solid;
}

.periode-item.available {
    border-left-color: var(--success-color);
    background: rgba(16, 185, 129, 0.15);
}

.periode-item.unavailable {
    border-left-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.15);
}

/* Messages */
.loading, .empty, .error {
    text-align: center;
    padding: 2rem;
    font-size: 0.95rem;
}

.error {
    color: var(--danger-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-light);
    margin-top: 3rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

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

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .calendar-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-nav {
        width: 100%;
    }
    
    .calendar-grid {
    max-width: 550px;
    margin: 0 auto;
        gap: 4px;
    }
    
    .calendar-day {
        font-size: 0.9rem;
    }
    
    .calendar-day.today::after {
        font-size: 0.5rem;
    }
    
    .legend {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Admin calendar section */
.admin-calendar-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.admin-mode-selector {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 1rem 0;
    padding: 1rem;
    background: white;
    border-radius: 12px;
}

.admin-mode-selector label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background 0.3s;
}

.admin-mode-selector label:hover {
    background: var(--bg-light);
}

.admin-mode-selector input[type="radio"] {
    cursor: pointer;
}

/* Jours cliquables dans l'admin */
.calendar-day.admin-day {
    cursor: pointer;
    user-select: none;
}

.calendar-day.admin-day:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    z-index: 20;
}

.calendar-day.admin-day:active {
    transform: scale(1.05);
}

/* Légende avec couleur neutre */
.legend-color.neutral {
    background: white;
    border-color: var(--border-color);
}

/* Statut À confirmer */
.calendar-day.pending {
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
    color: #92400e;
}

.calendar-day.pending:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.calendar-day.pending::after {
    content: '?';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #78350f;
}

.admin-day.pending {
    cursor: pointer;
}

.periode-item.pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
}

.periode-item.pending .statut {
    color: #92400e;
}

/* Commentaires dans les périodes */
.commentaire {
    margin: 0.5rem 0 0 0;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    font-size: 0.9rem;
    font-style: italic;
    color: #4b5563;
}

/* Actions des périodes */
.periode-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-comment {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.btn-comment:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.periode-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.periode-info {
    flex: 1;
}
