* {
    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;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.activity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.activity-selector label {
    font-weight: 600;
    color: #495057;
}

#activitySelect {
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 250px;
}

#activitySelect:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.activity-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

.activity-option-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.month-navigation {
    display: flex;
    align-items: center;
    gap: 20px;
}

.month-navigation button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.month-navigation button:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.actions {
    display: flex;
    gap: 10px;
}

.clear-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

#currentMonth {
    font-size: 1.5rem;
    font-weight: 600;
    color: #495057;
    min-width: 200px;
    text-align: center;
}

.calendar-container {
    padding: 30px;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    background: #e9ecef;
    border-radius: 10px;
    padding: 10px;
}

.day-header {
    background: #495057;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    border-radius: 5px;
}

.week-total-header {
    background: #2c3e50;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    border-radius: 5px;
    font-size: 0.9rem;
}

.day-cell {
    background: white;
    min-height: 80px;
    padding: 6px;
    border-radius: 5px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.day-cell:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.day-cell.has-activity {
    background: #e3f2fd;
}

.day-number {
    font-weight: 600;
    color: #495057;
    margin-bottom: 3px;
    font-size: 0.9rem;
}

.activity-hours {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.activity-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    border-left: 3px solid;
}

.hours-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.hours-count {
    font-weight: 600;
    min-width: 25px;
    text-align: center;
    font-size: 0.7rem;
}

.control-btn {
    background: #667eea;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #5a6fd8;
    transform: scale(1.1);
}

.control-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.legend {
    padding: 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.legend h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border-left: 4px solid;
}

.legend-name {
    font-weight: 500;
    color: #495057;
}

.summary {
    padding: 30px;
    background: white;
}

.summary h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-item-name {
    font-weight: 500;
    color: #495057;
}

.summary-item-hours {
    font-weight: 600;
    font-size: 1.1rem;
    color: #495057;
}

.other-month {
    color: #ccc;
    background: #f8f9fa;
}

.other-month .day-number {
    color: #ccc;
}

.week-total-cell {
    background: #f8f9fa;
    min-height: 80px;
    padding: 6px;
    border-radius: 5px;
    border: 2px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: default;
    pointer-events: none;
}

.week-total-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.9);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    border-left: 3px solid;
}

.week-total-hours {
    font-weight: 600;
    color: #495057;
}

/* Styles pour l'authentification */
.login-screen, .change-password-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-container, .change-password-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header, .change-password-header {
    margin-bottom: 30px;
}

.login-header h1, .change-password-header h1 {
    color: #495057;
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-header p, .change-password-header p {
    color: #6c757d;
    font-size: 1.1rem;
}

.login-form, .change-password-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 5px;
    display: block;
}

.btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    width: 100%;
}

.btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-primary {
    background: #667eea;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
}

.admin-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
}

.admin-link:hover {
    text-decoration: underline;
}

.user-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-actions .btn {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
}

/* Styles pour l'application principale */
.container header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.container header h1 {
    margin-bottom: 0;
}

.container header p {
    margin-bottom: 0;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .activity-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    #activitySelect {
        min-width: auto;
    }
    
    .calendar {
        gap: 1px;
    }
    
    .day-cell {
        min-height: 80px;
        padding: 5px;
    }
    
    .activity-item {
        font-size: 0.75rem;
        padding: 2px 4px;
    }
    
    .control-btn {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    
    .container header {
        flex-direction: column;
        text-align: center;
    }
    
    .user-actions {
        justify-content: center;
    }
}
