:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --dispo: #22c55e;
    --pas-dispo: #ef4444;
    --jsp: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.app-container {
    background: var(--surface);
    max-width: 800px;
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

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

header p {
    color: var(--text-muted);
}

.user-section {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.user-section select {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: border 0.3s;
    background-color: var(--card-bg);
    color: var(--text-color);
    appearance: none;
    cursor: pointer;
}

.user-section select:focus {
    outline: none;
    border-color: var(--primary);
}

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.btn-icon {
    background: var(--border);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: #cbd5e1;
}

.calendar-wrapper {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    background: var(--bg-color);
    font-weight: 600;
    text-align: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.day {
    min-height: 120px;
    padding: 0.5rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.day:nth-child(2n) {
    border-right: none;
}

.day.disabled {
    background: var(--bg-color);
    color: #cbd5e1;
    pointer-events: none;
}

.day.weekend {
    background: #fdfdfd;
    cursor: pointer;
    transition: background 0.2s;
}

.day.weekend:hover {
    background: #f1f5f9;
}

.day-number {
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-align: right;
    color: var(--text-muted);
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0.5rem;
}

.badge {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.badge.b-dispo { background: var(--dispo); }
.badge.b-pas-dispo { background: var(--pas-dispo); }
.badge.b-jsp { background: var(--jsp); color: white;}

.my-choice {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
}

.choice-btn {
    border: 1px solid var(--border);
    background: white;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 600;
    color: var(--text-muted);
}

.choice-btn:hover {
    background: var(--bg-color);
}

.choice-btn.active.v-dispo { background: var(--dispo); color: white; border-color: var(--dispo); }
.choice-btn.active.v-pas-dispo { background: var(--pas-dispo); color: white; border-color: var(--pas-dispo); }
.choice-btn.active.v-jsp { background: var(--jsp); color: white; border-color: var(--jsp); }

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.close-btn:hover {
    color: var(--text-main);
}

.modal-body {
    margin-top: 1.5rem;
}

.modal-group {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
}

.modal-group strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.modal-group p {
    color: var(--text-main);
    line-height: 1.5;
}