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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

body::after {
    content: '';
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 250px;
    height: 250px;
    background: url('logo.png') no-repeat center;
    background-size: contain;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

h1, h2, h3 {
    color: white;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

h1 {
    font-size: 2.5rem;
    text-align: center;
}

h2 {
    font-size: 1.8rem;
}

/* Header avec logo */
.header {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header img {
    height: 60px;
    width: auto;
}

.header h1 {
    color: #667eea;
    margin: 0;
    text-shadow: none;
}

.welcome {
    background: rgba(255,255,255,0.9);
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.welcome p {
    color: #667eea;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Boutons */
button {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 5px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    background: #667eea;
    color: white;
}

button:active {
    transform: translateY(0);
}

/* Contrôles de vue */
#viewControls {
    text-align: center;
    margin: 20px 0;
    background: rgba(255,255,255,0.9);
    padding: 15px;
    border-radius: 10px;
}

#viewControls button {
    background: #667eea;
    color: white;
    margin: 0 5px;
}

#viewControls button:hover {
    background: #764ba2;
}

/* Navigation année */
#yearNavigation {
    text-align: center;
    margin: 20px 0;
    background: rgba(255,255,255,0.9);
    padding: 15px;
    border-radius: 10px;
}

#currentYearDisplay {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin: 0 20px;
}

/* Calendrier */
#yearView {
    background: rgba(255,255,255,0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

#yearView h2 {
    color: #667eea;
    text-align: center;
    text-shadow: none;
    margin-bottom: 30px;
}

.month-container {
    display: inline-block;
    margin: 10px;
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 15px;
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    vertical-align: top;
}

.month-container > div:first-child {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.day-cell {
    display: inline-block;
    width: 35px;
    height: 35px;
    text-align: center;
    line-height: 35px;
    border: 1px solid #e0e0e0;
    margin: 1px;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.day-cell:hover {
    transform: scale(1.1);
}

.formation-day {
    background: #667eea !important;
    color: white !important;
    cursor: pointer;
    font-weight: bold;
}

/* Popup */
#popup {
    background: white;
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    max-width: 500px;
}

#popup h3 {
    color: #667eea;
    text-shadow: none;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#popup button {
    width: 100%;
    margin: 8px 0;
    background: #667eea;
    color: white;
}

#popup button:hover {
    background: #764ba2;
}

#popup button:last-child {
    background: #e74c3c;
}

#popup button:last-child:hover {
    background: #c0392b;
}

/* Overlay */
#overlay {
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

/* Formulaires */
input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    margin: 8px 0;
    transition: border 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

form {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

label {
    display: block;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 5px;
}

/* Page de connexion */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.login-container h1 {
    color: #667eea;
    text-shadow: none;
    text-align: center;
    margin-bottom: 30px;
}

.logo-center {
    text-align: center;
    margin-bottom: 20px;
}

.logo-center img {
    width: 120px;
    height: auto;
}

/* Gestion apprenants */
#apprenantsContainer {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
}

#apprenantsContainer h2 {
    color: #667eea;
    text-shadow: none;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#apprenantsContainer form {
    background: transparent;
    padding: 0;
    box-shadow: none;
    margin-bottom: 20px;
}

#apprenantsContainer #btnCloseApprenants {
    width: 100%;
    background: #e74c3c;
    color: white;
    margin-top: 10px;
}

#apprenantsContainer #btnCloseApprenants:hover {
    background: #c0392b;
}

#listeApprenants {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

#listeApprenants h3 {
    color: #667eea;
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-shadow: none;
}

#listeApprenants {
    margin-top: 20px;
}

#listeApprenants > div {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#listeApprenants button {
    background: #e74c3c;
    color: white;
    padding: 8px 15px;
}

#listeApprenants button:hover {
    background: #c0392b;
}

/* Calendrier de création */
#calendarContainer {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
}

#calendarContainer h2 {
    color: #667eea;
    text-shadow: none;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#calendarContainer p {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
}

#creationCalendar {
    max-height: 60vh;
    overflow-y: auto;
}

#btnSaveYear {
    background: #2ecc71;
    color: white;
    width: auto;
    padding: 12px 30px;
}

#btnSaveYear:hover {
    background: #27ae60;
}

#btnCancelYear {
    background: #e74c3c;
    color: white;
    width: auto;
    padding: 12px 30px;
}

#btnCancelYear:hover {
    background: #c0392b;
}

.selected-day {
    background: #2ecc71 !important;
    color: white !important;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .header img {
        height: 50px;
        margin-bottom: 10px;
    }
    
    body::after {
        width: 100px;
        height: 100px;
        bottom: 10px;
        right: 10px;
    }
    
    .month-container {
        display: block;
        margin: 10px auto;
        max-width: 100%;
    }
    
    .day-cell {
        width: 12%;
        height: auto;
        padding: 8px 0;
        font-size: 0.9rem;
    }
    
    button {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    #popup {
        width: 90%;
        max-width: 90%;
        padding: 15px;
    }
    
    #yearNavigation {
        font-size: 0.9rem;
    }
    
    #currentYearDisplay {
        display: block;
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .day-cell {
        width: 13%;
        font-size: 0.8rem;
    }
    
    button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}
