:root {
    --primary: #4361ee;
    --primary-hover: #3a56d4;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --light: #f8f9fa;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #e5e7eb;
    --white: #ffffff;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius: 0.5rem;
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f3f4f6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--dark);
    font-weight: 600;
    line-height: 1.25;
}

/* Layout */
.auth-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--white);
}

.auth-card {
    flex: 1;
    max-width: 500px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--white);
}

.auth-illustration {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    text-align: center;
}

.auth-illustration img {
    max-width: 80%;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
}

.auth-illustration h2 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    color: var(--white);
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo i {
    font-size: 2rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
}

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

/* Formulaires */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group label {
    position: absolute;
    left: 1rem;
    color: var(--gray);
    pointer-events: none;
    transition: var(--transition);
}

.input-group input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    background-color: #f9fafb;
}

.input-group input:focus {
    background-color: var(--white);
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.input-group input:focus + label {
    color: var(--primary);
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.5;
}

.btn:active {
    transform: translateY(0);
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--dark);
    border: 1px solid var(--light-gray);
}

.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: var(--gray);
}

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

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

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

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
}

/* Alertes */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.alert i {
    font-size: 1.25rem;
}

.error, .alert-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.success, .alert-success {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

/* Footer Auth */
.auth-footer {
    margin-top: 2.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray);
}

.forgot-password {
    display: block;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--gray);
}

.forgot-password:hover {
    color: var(--primary);
}

/* Dashboard Styles */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--light-gray);
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 2rem;
}

.profile i {
    font-size: 4rem;
    color: var(--primary-light);
    margin-bottom: 1rem;
    background: #eff6ff;
    padding: 1rem;
    border-radius: 50%;
}

.profile h3 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--dark);
}

.sidebar nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    color: var(--gray);
    font-weight: 500;
}

.sidebar nav a:hover {
    background-color: #f3f4f6;
    color: var(--dark);
}

.sidebar nav li.active a {
    background-color: #eff6ff;
    color: var(--primary);
}

.sidebar nav li.active a i {
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2.5rem;
    background-color: #f9fafb;
    overflow-y: auto;
}

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

.header-actions h1 {
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Upload Section */
.upload-section {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.upload-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-mode {
    flex: 1;
    background: #f3f4f6;
    color: var(--gray);
    border: 1px solid transparent;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-mode.active {
    background: #eff6ff;
    color: var(--primary);
    border-color: #bfdbfe;
}

.btn-mode:hover:not(.active) {
    background: #e5e7eb;
}

.upload-area {
    border: 2px dashed var(--light-gray);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    background-color: #f9fafb;
}

.upload-area i {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.upload-area p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.upload-area.highlight {
    border-color: var(--primary);
    background-color: #eff6ff;
}

.upload-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

/* Progress Bar */
#progressContainer {
    margin-top: 1.5rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

progress {
    width: 100%;
    height: 0.75rem;
    border-radius: 1rem;
    overflow: hidden;
}

progress::-webkit-progress-bar {
    background-color: #e5e7eb;
}

progress::-webkit-progress-value {
    background-color: var(--primary);
    transition: width 0.3s ease;
}

/* File List */
.file-list {
    background: var(--white);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

th {
    background-color: #f9fafb;
    font-weight: 600;
    color: var(--gray);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    color: var(--dark);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f9fafb;
}

td i {
    margin-right: 0.5rem;
    color: var(--gray);
    width: 1.25rem;
    text-align: center;
}

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

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

/* Settings */
.settings-content {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    max-width: 800px;
}

.settings-form {
    margin-bottom: 3rem;
}

.settings-form h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--light-gray);
    color: var(--dark);
}

.settings-form .input-group {
    margin-bottom: 1.25rem;
}

.settings-form .input-group label {
    position: relative;
    left: 0;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--dark);
    font-weight: 500;
}

.settings-form .input-group input {
    padding: 0.75rem 1rem;
}

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

.modal-content {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-content.modal-lg {
    max-width: 900px;
    height: 85vh;
    padding: 0;
    overflow: hidden;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
    z-index: 10;
}

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

/* Alerts floating (JS generated) */
.alert-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--white);
}

.alert-success {
    background-color: #10b981;
}

.alert-error {
    background-color: #ef4444;
}

@keyframes slideIn {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Preview Modal Specifics */
.preview-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h2 {
    margin: 0;
    font-size: 1.25rem;
    padding-right: 2rem;
}

.preview-content {
    flex: 1;
    overflow-y: auto;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1rem;
}

.preview-content img,
.preview-content video,
.preview-content iframe {
    box-shadow: var(--shadow-md);
    border-radius: 4px;
}

.loading-spinner {
    font-size: 1.5rem;
    color: var(--gray);
}

.preview-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--light-gray);
    display: flex;
    justify-content: flex-end;
    background: var(--white);
}

/* Responsive */
@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }
    
    .auth-card {
        max-width: 100%;
        padding: 2rem;
    }
    
    .auth-illustration {
        display: none;
    }

    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
    }

    .profile {
        flex-direction: row;
        gap: 1rem;
        padding-bottom: 0;
        border-bottom: none;
        margin-bottom: 1rem;
    }

    .profile i {
        font-size: 2.5rem;
        margin-bottom: 0;
    }

    .main-content {
        padding: 1.5rem;
    }

    .header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .upload-options {
        flex-direction: column;
    }
}