/* Reset et variables CSS */
:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f093fb;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --dark: #1f2937;
    --light: #f8fafc;
    --border: #e5e7eb;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: var(--dark);
}

/* Layout principal */
#app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Conteneurs */
.auth-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.6s ease;
}

.dashboard-container {
    background: var(--light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 1200px;
    min-height: 80vh;
    display: flex;
    overflow: hidden;
    animation: fadeIn 0.6s ease;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    color: white;
    padding: 30px 0;
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

.logo {
    text-align: center;
    padding: 0 30px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.logo p {
    opacity: 0.8;
    font-size: 0.9rem;
}

.nav-menu {
    list-style: none;
    position: relative;
    z-index: 1;
}

.nav-item {
    margin: 5px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 15px 30px;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: white;
    transform: scaleY(0);
    transition: var(--transition);
}

.nav-link.active::before,
.nav-link:hover::before {
    transform: scaleY(1);
}

.nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* Main content */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Formulaires */
.auth-header {
    background: linear-gradient(45deg, var(--accent), var(--primary));
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.auth-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.auth-form {
    padding: 40px 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-control:invalid {
    border-color: var(--error);
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 25px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    width: 100%;
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border: 2px solid var(--border);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(-1px);
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.card-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.card-subtitle {
    color: #6b7280;
    font-size: 0.9rem;
}

/* QR Code */
.qr-container {
    text-align: center;
    padding: 30px;
    background: var(--light);
    border-radius: var(--radius);
    margin: 20px 0;
}

.qr-preview {
    display: inline-block;
    padding: 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* Historique */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.history-item {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.history-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.history-qr {
    text-align: center;
    margin-bottom: 15px;
}

.history-info h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--dark);
}

.history-info p {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.history-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.85rem;
}

/* Notifications */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    border-left: 4px solid;
    font-weight: 500;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-color: var(--success);
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: var(--error);
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: var(--warning);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
        max-width: 100%;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
        padding: 20px 0;
    }
    
    .main-content {
        order: 1;
        padding: 20px;
    }
    
    .nav-menu {
        display: flex;
        overflow-x: auto;
        padding: 0 20px;
    }
    
    .nav-item {
        flex-shrink: 0;
        margin: 0 5px;
    }
    
    .auth-container {
        margin: 10px;
    }
    
    .auth-header {
        padding: 30px 20px;
    }
    
    .auth-form {
        padding: 30px 20px;
    }
    
    .history-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease;
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }