:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    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;
    color: var(--dark-color);
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: 8px;
}

.nav-links a:hover {
    background: var(--primary-color);
    color: white;
}

/* Cartes */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 24px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

/* Grille de documents */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.document-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.document-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px;
    text-align: center;
    font-size: 3rem;
}

.document-info {
    padding: 16px;
}

.document-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.document-meta {
    color: var(--gray-color);
    font-size: 0.85rem;
    margin-top: 8px;
}

.validity-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-top: 8px;
}

.validity-valid {
    background: var(--success-color);
    color: white;
}

.validity-expiring {
    background: var(--warning-color);
    color: white;
}

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

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

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

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

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

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

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

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

/* Notifications */
.notification-bell {
    position: relative;
    cursor: pointer;
}

.notification-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
}

.notification-dropdown {
    position: absolute;
    top: 40px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: none;
    z-index: 1000;
}

.notification-dropdown.show {
    display: block;
}

.notification-item {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
}

.notification-item:hover {
    background: #f5f5f5;
}

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

.modal.show {
    display: flex;
}

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

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 16px;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 16px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 8px;
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-zone:hover {
    background: rgba(67, 97, 238, 0.1);
}

/* Statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--gray-color);
    margin-top: 8px;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: #e0e0e0;
    border-radius: 20px;
    font-size: 0.75rem;
    margin: 4px;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Améliorations pour les formulaires */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
    font-size: 0.95rem;
}

.input-group label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 45px;
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--gray-color);
    transition: var(--transition);
    background: none;
    border: none;
    font-size: 1.1rem;
    padding: 5px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--primary-color);
    background: rgba(67, 97, 238, 0.1);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.95);
}

/* Animation de shake pour les erreurs */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Indicateur de force du mot de passe */
.password-strength {
    margin-top: 8px;
    font-size: 0.85rem;
}

.strength-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.strength-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: all 0.3s ease;
    width: 0%;
}

.strength-weak { 
    background: linear-gradient(90deg, #f44336, #ff9800);
    width: 25%; 
}

.strength-medium { 
    background: linear-gradient(90deg, #ff9800, #ffc107);
    width: 50%; 
}

.strength-strong { 
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    width: 75%; 
}

.strength-very-strong { 
    background: linear-gradient(90deg, #2e7d32, #4caf50);
    width: 100%; 
}

/* Messages d'erreur et de succès */
.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left-color: #c62828;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left-color: #2e7d32;
}

.alert i {
    margin-right: 8px;
}

/* Responsive pour les petits écrans */
@media (max-width: 480px) {
    .card {
        padding: 20px;
    }
    
    .toggle-password {
        right: 8px;
        width: 28px;
        height: 28px;
    }
    
    .input-group label {
        font-size: 0.9rem;
    }
}