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

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #6B7280;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --background: #F9FAFB;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Authentification */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7C3AED 100%);
}

.auth-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

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

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

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.auth-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
}

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

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

/* Messages d'erreur */
.error-message {
    background: #FEE2E2;
    color: var(--danger-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

/* Boutons */
.btn-primary {
    width: 100%;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-secondary {
    padding: 8px 16px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-secondary:hover {
    opacity: 0.9;
}

/* Navigation avec chevrons */
.btn-icon {
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Chevrons sans contour */
.btn-icon.prev::before {
    content: "‹";
    font-weight: bold;
}

.btn-icon.next::before {
    content: "›";
    font-weight: bold;
}

.btn-add {
    padding: 0px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 35px;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-icon-small {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-icon-small:hover {
    opacity: 1;
}

.btn-validate {
    padding: 16px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-validate:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-validate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dashboard */
.dashboard-container {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 250px;
    grid-template-rows: auto auto 1fr auto;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.navbar {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-radius: 12px;
}

.navbar-brand h1 {
    font-size: 24px;
    color: var(--primary-color);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.date-navigation {
    grid-column: 1;
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.current-date {
    flex: 1;
    text-align: center;
}

.current-date h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

#dayStatus {
    color: var(--success-color);
    font-size: 14px;
    font-weight: 500;
}

.main-content {
    grid-column: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.content-section {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
}

/* Tâches */
.task-item {
    display: flex;
    align-items: start;
    gap: 12px;
    padding: 12px;
    background: var(--background);
    border-radius: 8px;
    transition: all 0.2s;
}

.task-item:hover {
    box-shadow: var(--shadow);
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.completed .task-content h4 {
    text-decoration: line-through;
}

.task-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.task-content {
    flex: 1;
    cursor: pointer;
}

.task-content h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.task-content p {
    font-size: 14px;
    color: var(--text-secondary);
}

.task-actions {
    display: flex;
    gap: 8px;
}

/* Éléments de travail */
.work-item {
    display: flex;
    align-items: start;
    gap: 12px;
    padding: 12px;
    background: var(--background);
    border-radius: 8px;
    transition: all 0.2s;
}

.work-item:hover {
    box-shadow: var(--shadow);
}

.work-content {
    flex: 1;
    cursor: pointer;
}

.work-content h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.work-content p {
    font-size: 14px;
    color: var(--text-secondary);
}

.work-actions {
    display: flex;
    gap: 8px;
}

/* Validation */
.validate-section {
    grid-column: 1;
    padding: 20px;
    border-radius: 12px;
    margin: auto;
}

/* Historique */
.history-panel {
    grid-column: 2;
    grid-row: 2 / -1;
    padding: 20px;
    border-radius: 12px;
}

.history-panel h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px; /* Réduit de 8px à 6px */
}

.history-item {
    display: flex;
    flex-direction: column;
    gap: 4px; /* Réduit de 8px à 4px */
    padding: 8px 12px; /* Réduit de 14px à 8px verticalement */
    background: var(--surface); /* Fond uniforme blanc */
    border-radius: 8px; /* Réduit de 10px à 8px */
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    position: relative;
}

.history-item:hover {
    background: var(--background); /* Fond gris léger au hover */
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.history-item.validated {
    border-left: 4px solid var(--success-color);
}

.history-item:not(.validated) {
    border-left: 4px solid var(--secondary-color); /* Couleur neutre au lieu de warning */
}

/* Suppression des classes de completion avec fonds colorés */
.history-item.fully-completed {
    background: var(--surface); /* Fond uniforme */
    border-left: 4px solid #10b981;
}

.history-item.mostly-completed {
    background: var(--surface); /* Fond uniforme */
    border-left: 4px solid #f59e0b;
}

.history-item.half-completed {
    background: var(--surface); /* Fond uniforme */
    border-left: 4px solid #ea580c;
}

.history-item.low-completed {
    background: var(--surface); /* Fond uniforme */
    border-left: 4px solid #ef4444;
}

/* Header de l'historique - Version condensée */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px; /* Réduit l'espacement */
}

.history-date {
    font-size: 13px; /* Réduit de 14px à 13px */
    font-weight: 600;
    color: var(--text-primary);
}

.history-validation {
    font-size: 14px; /* Réduit de 16px à 14px */
    color: var(--success-color);
}

/* Statistiques - Version condensée sur une ligne */
.history-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.task-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.progress-text {
    font-size: 11px; /* Réduit de 12px à 11px */
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.progress-bar {
    flex: 1;
    height: 4px; /* Réduit de 6px à 4px */
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    overflow: hidden;
    min-width: 40px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.completion-badge {
    font-size: 10px; /* Réduit de 11px à 10px */
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 1px 6px; /* Réduit le padding */
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    white-space: nowrap;
}

.completion-percentage {
    font-size: 10px; /* Réduit de 11px à 10px */
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

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

.modal-content {
    background: var(--surface);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
}

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

.modal-content form {
    padding: 20px;
}

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

.modal-content label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto 1fr auto auto;
    }
    
    .history-panel {
        grid-column: 1;
        grid-row: auto;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .navbar {
        flex-direction: column;
        gap: 12px;
    }
    
    .date-navigation {
        flex-direction: column;
    }
}

