/* Variables CSS */
:root {
    --primary-color: #f97316;
    --primary-dark: #ea580c;
    --secondary-color: #f8fafc;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.logout {
    color: var(--danger-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

/* Contenu principal */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page de connexion */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

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

.login-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

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

.login-header p {
    color: var(--text-secondary);
}

.login-form {
    margin-bottom: 2rem;
}

/* Tableau de bord */
.dashboard-container {
    animation: fadeIn 0.5s ease;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.dashboard-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Cartes */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Boutons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--text-light);
    color: white;
}

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

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Liste des tâches */
.tasks-list {
    max-height: 500px;
    overflow-y: auto;
}

.task-item {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: between;
    align-items: flex-start;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.task-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.task-item.overdue {
    border-left: 4px solid var(--danger-color);
}

.task-content {
    flex: 1;
}

.task-content h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.task-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.task-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

/* État vide */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Calendrier */
.calendar-container {
    animation: fadeIn 0.5s ease;
}

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

.calendar-header h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
}

.current-month {
    color: var(--text-primary);
    font-size: 1.5rem;
}

/* Grille du calendrier */
.calendar-grid {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.calendar-week-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--primary-color);
    color: white;
}

.calendar-day-header {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.calendar-day-header:last-child {
    border-right: none;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--border-color);
}

.calendar-week:last-child {
    border-bottom: none;
}

.calendar-day {
    min-height: 120px;
    padding: 0.75rem;
    border-right: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.3);
    transition: background-color 0.3s ease;
    position: relative;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.5);
}

.calendar-day.other-month {
    background: rgba(248, 250, 252, 0.5);
    color: var(--text-light);
}

.calendar-day.today {
    background: rgba(249, 115, 22, 0.1);
}

.calendar-day:last-child {
    border-right: none;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.day-number {
    font-weight: 600;
    color: var(--text-primary);
}

.other-month .day-number {
    color: var(--text-light);
}

.today-badge {
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.day-tasks {
    max-height: 80px;
    overflow-y: auto;
    font-size: 0.8rem;
}

.calendar-task {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
    padding: 0.3rem 0.5rem;
    margin-bottom: 0.3rem;
    border-left: 3px solid var(--primary-color);
}

.no-tasks {
    color: var(--text-light);
    font-style: italic;
}

.add-task-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.calendar-day:hover .add-task-btn {
    opacity: 1;
}

.add-task-btn:hover {
    transform: scale(1.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--danger-color);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Alertes */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .calendar-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .calendar-day {
        min-height: 100px;
        padding: 0.5rem;
    }
    
    .main-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .login-glass {
        padding: 2rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .calendar-day-header {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

/* Styles pour les tâches accomplies */
.task-item.accomplished {
    border-left: 4px solid var(--accent-color);
    background: rgba(16, 185, 129, 0.05);
}

.accomplished-task {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.task-title {
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.2rem;
}

.task-collab {
    color: var(--primary-color);
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
}

.task-desc {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-style: italic;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.task-header h3 {
    margin-bottom: 0;
    flex: 1;
}

.task-header .task-date {
    font-size: 0.875rem;
    color: var(--accent-color);
    font-weight: 500;
    white-space: nowrap;
    margin-left: 1rem;
}

.task-collaborateur {
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.past-day {
    background: rgba(248, 250, 252, 0.7);
}

/* Désactiver l'ajout pour les jours futurs */
.calendar-day:not(.past-day):not(.today) .add-task-btn {
    display: none;
}


/* Corrections Responsive */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.tasks-card {
    min-height: 400px;
}

.tasks-list {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Scrollbar personnalisée */
.tasks-list::-webkit-scrollbar {
    width: 6px;
}

.tasks-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.tasks-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

/* Amélioration des cartes de tâches */
.task-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.3s ease;
    break-inside: avoid;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.task-content {
    flex: 1;
    min-width: 0; /* Important pour le text-overflow */
}

.task-content h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.task-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    word-wrap: break-word;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.task-actions {
    flex-shrink: 0;
    margin-left: 1rem;
}

/* Header des tâches responsive */
.task-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.task-header h3 {
    margin-bottom: 0;
    line-height: 1.4;
}

.task-header .task-date {
    font-size: 0.875rem;
    color: var(--accent-color);
    font-weight: 500;
    white-space: nowrap;
}

/* Media Queries améliorées */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .add-task-card {
        order: 1;
    }
    
    .tasks-card {
        order: 2;
    }
    
    .task-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .task-header .task-date {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .task-item {
        flex-direction: column;
        padding: 1rem;
    }
    
    .task-actions {
        margin-left: 0;
        margin-top: 1rem;
        align-self: flex-end;
    }
    
    .task-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .calendar-navigation {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .calendar-navigation .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .dashboard-header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .task-item {
        padding: 0.875rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 0.625rem 0.875rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        width: 100%;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
}

/* Correction spécifique pour les longs textes */
.task-content h3 {
    hyphens: auto;
    -webkit-hyphens: auto;
    line-height: 1.3;
}

.task-description {
    line-height: 1.4;
    max-height: 3em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Amélioration du calendrier responsive */
@media (max-width: 768px) {
    .calendar-day {
        min-height: 100px;
        padding: 0.5rem;
    }
    
    .day-tasks {
        max-height: 60px;
    }
    
    .calendar-task {
        font-size: 0.7rem;
        padding: 0.25rem;
    }
    
    .add-task-btn {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .calendar-day {
        min-height: 80px;
        padding: 0.25rem;
    }
    
    .day-number {
        font-size: 0.875rem;
    }
    
    .today-badge {
        font-size: 0.6rem;
        padding: 0.1rem 0.3rem;
    }
}

/* Correction pour les modales sur mobile */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .task-form {
        padding: 1rem 1.5rem;
    }
}

/* Empêcher le débordement horizontal */
body {
    overflow-x: hidden;
}

.main-content {
    max-width: 100%;
    overflow-x: hidden;
}

/* Amélioration des formulaires sur mobile */
@media (max-width: 480px) {
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group textarea {
        font-size: 0.9rem;
    }
    
    .login-glass {
        padding: 1.5rem;
        margin: 1rem;
    }
}

/* Styles améliorés pour l'affichage des collaborateurs dans le calendrier */
.calendar-task {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    padding: 0.4rem;
    margin-bottom: 0.3rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-task:hover {
    background: rgba(16, 185, 129, 0.15);
    transform: scale(1.02);
}

.task-title {
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.2rem;
    line-height: 1.2;
    display: flex;
    align-items: flex-start;
    gap: 0.2rem;
}

.task-title:before {
    content: "✓";
    font-weight: bold;
    color: var(--accent-color);
    flex-shrink: 0;
}

.task-collab {
    color: var(--primary-color);
    font-size: 0.65rem;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 8px;
    display: inline-block;
}

/* Styles pour le détail du jour */
.day-detail-modal {
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.day-detail-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.day-detail-task {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-color);
}

.detail-task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.detail-task-header h4 {
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    margin-right: 1rem;
}

.detail-task-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.detail-task-collaborateur {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.detail-task-meta {
    color: var(--text-light);
    font-size: 0.875rem;
}

.empty-day-detail {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
}

.empty-day-detail i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-day-detail h4 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.day-detail-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Styles pour le calendrier interactif */
.day-tasks {
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 60px;
}

.day-tasks:hover {
    background: rgba(99, 102, 241, 0.05);
    border-radius: 4px;
}

.more-tasks {
    font-size: 0.65rem;
    color: var(--primary-color);
    font-weight: 500;
    text-align: center;
    margin-top: 0.2rem;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 8px;
}

/* Amélioration de l'affichage dans le calendrier */
.calendar-task {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    padding: 0.3rem;
    margin-bottom: 0.2rem;
    font-size: 0.65rem;
    cursor: pointer;
}

.task-title {
    font-weight: 600;
    color: var(--accent-color);
    line-height: 1.2;
    margin-bottom: 0.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-collab {
    color: var(--primary-color);
    font-size: 0.6rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Corrections Responsive Mobile */
@media (max-width: 768px) {
    .calendar-container {
        padding: 0.5rem;
    }
    
    .calendar-header {
        margin-bottom: 1rem;
    }
    
    .calendar-header h1 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .calendar-navigation {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .calendar-navigation .btn {
        width: 100%;
        justify-content: center;
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .current-month {
        font-size: 1.1rem;
        text-align: center;
        order: -1;
    }
    
    .calendar-legend {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .calendar-grid {
        border-radius: 10px;
        overflow-x: auto;
    }
    
    .calendar-week-header {
        min-width: 500px;
    }
    
    .calendar-week {
        min-width: 500px;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 0.3rem;
    }
    
    .day-number {
        font-size: 0.8rem;
    }
    
    .today-badge {
        font-size: 0.6rem;
        padding: 0.1rem 0.3rem;
    }
    
    .calendar-task {
        font-size: 0.6rem;
        padding: 0.2rem;
        margin-bottom: 0.1rem;
    }
    
    .task-title {
        font-size: 0.6rem;
        line-height: 1.1;
    }
    
    .task-collab {
        font-size: 0.55rem;
    }
    
    .more-tasks {
        font-size: 0.55rem;
    }
    
    .no-tasks {
        font-size: 0.6rem;
    }
    
    .add-task-btn {
        width: 18px;
        height: 18px;
        font-size: 0.5rem;
        bottom: 0.2rem;
        right: 0.2rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .calendar-header h1 {
        font-size: 1.3rem;
    }
    
    .calendar-navigation {
        padding: 0.5rem;
    }
    
    .current-month {
        font-size: 1rem;
    }
    
    .calendar-day {
        min-height: 70px;
        padding: 0.2rem;
    }
    
    .day-number {
        font-size: 0.75rem;
    }
    
    .calendar-task {
        font-size: 0.55rem;
        padding: 0.15rem;
    }
    
    .task-title {
        font-size: 0.55rem;
    }
    
    .task-collab {
        font-size: 0.5rem;
    }
    
    /* Navigation bar mobile */
    .nav-container {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .nav-logo {
        font-size: 1.2rem;
        justify-content: center;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .nav-link {
        justify-content: center;
        padding: 0.5rem;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
    }
    
    .user-info {
        justify-content: center;
        order: -1;
    }
}

/* Correction spécifique pour les très petits écrans */
@media (max-width: 360px) {
    .calendar-day {
        min-height: 65px;
    }
    
    .day-number {
        font-size: 0.7rem;
    }
    
    .calendar-task {
        font-size: 0.5rem;
    }
    
    .task-title {
        font-size: 0.5rem;
    }
}

/* Amélioration du scroll horizontal pour le calendrier */
.calendar-grid-container {
    overflow-x: auto;
    border-radius: 12px;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}

.calendar-grid {
    min-width: 500px;
}

/* Navigation bar mobile améliorée */
@media (max-width: 768px) {
    .navbar {
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    .nav-container {
        padding: 0.5rem 1rem;
    }
    
    .nav-logo {
        font-size: 1.1rem;
    }
    
    .nav-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        width: 100%;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem;
        text-align: center;
        justify-content: center;
    }
    
    .user-info {
        grid-column: 1 / -1;
        justify-content: center;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-link.logout {
        grid-column: 1 / -1;
    }
}

/* Amélioration des modales sur mobile */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
    }
    
    .day-detail-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header {
        padding: 1rem 1.25rem;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .task-form {
        padding: 1rem 1.25rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group textarea {
        font-size: 0.9rem;
        padding: 0.625rem 0.875rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

/* Correction du header sur mobile */
@media (max-width: 480px) {
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .dashboard-header p {
        font-size: 0.9rem;
    }
    
    .card h2 {
        font-size: 1.1rem;
    }
}


/* NAVBAR MOBILE ULTRA COMPACTE */
@media (max-width: 768px) {
    .navbar {
        min-height: 50px;
        padding: 0;
    }
    
    .nav-container {
        padding: 0.5rem;
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        min-height: 50px;
    }
    
    .nav-logo {
        font-size: 0.9rem;
        flex-shrink: 0;
    }
    
    .nav-logo i {
        font-size: 0.9rem;
    }
    
    .nav-links {
        display: flex;
        flex-direction: row;
        gap: 0.3rem;
        align-items: center;
        flex-wrap: nowrap;
        margin-left: auto;
    }
    
    .user-info {
        display: none;
    }
    
    .nav-link {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
        background: rgba(99, 102, 241, 0.1);
        border-radius: 6px;
        min-height: 32px;
        min-width: auto;
        white-space: nowrap;
    }
    
    .nav-link i {
        font-size: 0.65rem;
        margin-right: 0.2rem;
    }
    
    .nav-link.logout {
        background: rgba(239, 68, 68, 0.1);
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.4rem;
    }
    
    .nav-logo {
        font-size: 0.8rem;
    }
    
    .nav-logo span {
        display: none; /* Cache "TaskTracker" */
    }
    
    .nav-logo i {
        font-size: 0.9rem;
        margin-right: 0;
    }
    
    .nav-links {
        gap: 0.2rem;
    }
    
    .nav-link {
        padding: 0.3rem;
        font-size: 0;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-link i {
        margin-right: 0;
        font-size: 0.7rem;
    }
    
    /* Tooltips pour les icônes */
    .nav-link[data-tooltip] {
        position: relative;
    }
    
    .nav-link[data-tooltip]:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: -30px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 0.3rem 0.6rem;
        border-radius: 4px;
        font-size: 0.7rem;
        white-space: nowrap;
        z-index: 1000;
    }
}

/* Ajustement du contenu principal pour compenser la navbar réduite */
@media (max-width: 768px) {
    .main-content {
        padding-top: 0.5rem;
    }
    
    .calendar-container {
        padding-top: 0;
    }
}

/* Styles pour les cours dans le calendrier */
.day-classes {
    margin-bottom: 0.3rem;
}

.class-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-left-width: 3px;
    border-radius: 4px;
    padding: 0.2rem 0.3rem;
    margin-bottom: 0.2rem;
    font-size: 0.6rem;
}

.class-subject {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.class-time {
    color: var(--text-secondary);
    font-size: 0.55rem;
}

/* Ajustement pour les jours avec cours */
.calendar-day.has-classes .day-tasks {
    max-height: 40px;
}

/* Sur mobile */
@media (max-width: 768px) {
    .class-item {
        font-size: 0.55rem;
        padding: 0.15rem 0.25rem;
    }
    
    .class-time {
        font-size: 0.5rem;
    }
}

@media (max-width: 480px) {
    .class-item {
        font-size: 0.5rem;
    }
    
    .class-time {
        font-size: 0.45rem;
    }
}