/* ==========================================
   VARIABLES CSS
   ========================================== */
:root {
    --primary: #1779ba;
    --primary-dark: #125a8c;
    --secondary: #767676;
    --success: #3adb76;
    --warning: #ffae00;
    --danger: #cc4b37;
    --light: #f4f4f4;
    --gray: #cacaca;
    --dark: #333;
    --white: #fff;
    --border-radius: 8px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: 0.3s ease;
    --bottom-nav-height: 65px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
        
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    line-height: 1.6; 
    color: #333;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}


/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a, .btn {
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary {
    background: #0d6efd; /*#667eea*/
    color: white;
}

.btn-primary:hover {
    background: #0a58ca; /*#5a67d8*/
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-logout {
    background: #e53e3e;
    color: white;
}

.btn-logout:hover {
    background: #c53030;
}

/* Main content */
main {
    /*margin-top: 80px;
    padding: 4rem 0;*/
}

.hero {
    text-align: center;
    color: white;
    margin-bottom: 4rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-buttons .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Features section */
.features {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    margin: 2rem 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.features h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 15px;
    background: #f8f9ff;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.user-status {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.welcome-message {
    color: #28a745;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .features { padding: 2rem 1rem; }
    nav { flex-direction: column; gap: 1rem; }
}

/* login.php */
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; }
input[type="text"], input[type="password"] { 
    width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; 
}

button { padding: 10px; background: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; } /*width: 100%;*/
button:hover { background: #0056b3; }
.error { color: red; margin-bottom: 10px; }
.links { text-align: center; margin-top: 15px; }
.success { color: green; margin-bottom: 10px; }

/* dashbord.php */
.user-info { background: #f8f9fa; padding: 20px; border-radius: 8px; margin-bottom: 20px; }
.user-info h3 { margin-top: 0; color: #333; }
.user-info p { margin: 5px 0; color: #666; }
.logout-btn { background: #dc3545; color: white; padding: 8px 15px; text-decoration: none; border-radius: 4px; }
.logout-btn:hover { background: #c82333; }
.welcome { color: #28a745; }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    /*max-width: 500px;*/
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.divider {
    border-top: 1px solid #eee;
    margin: 20px 0;
    padding-top: 20px;
}

.help-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    /*margin-top: 20px;*/
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.table-actions {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.table-actions .btn {
    font-size: 12px;
    padding: 5px 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.user-meta {
    font-size: 12px;
    color: #666;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #28a745;
    color: white;
}

.status-inactive {
    background: #6c757d;
    color: white;
}

.role-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.role-super-admin {
    background: #dc3545;
}

.role-admin {
    background: #fd7e14;
}

.role-user {
    background: #20c997;
}

.invitation-item {
    background: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.invitation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.invitation-meta {
    font-size: 13px;
    color: #666;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .btn-group {
        flex-direction: column;
    }
}

/* dans folders.php */
.tab-button {
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #007bff !important;
    border-bottom-color: #007bff !important;
}

.active-tab {
    color: #007bff !important;
    border-bottom-color: #007bff !important;
    font-weight: 500 !important;
}

.btn-small:hover {
    opacity: 0.8;
    transform: scale(0.95);
}

table tr:hover {
    background-color: #f8f9fa;
}

/* Styles pour les dropzones */
.document-dropzone {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    margin: 15px 0;
}

.document-dropzone:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.document-dropzone.dragover {
    border-color: #007bff;
    background: #e6f3ff;
    transform: scale(1.02);
}

.document-dropzone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    top: 0;
    left: 0;
    cursor: pointer;
    z-index: 2;
}

.dropzone-content {
    pointer-events: none; /* Évite les conflits d'événements */
    /*display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;*/
}

.dropzone-icon {
    font-size: 48px;
    color: #6c757d;
}

.dropzone-text {
    font-size: 16px;
    color: #333;
    margin: 0;
}

.dropzone-browse {
    color: #007bff;
    text-decoration: underline;
    font-weight: bold;
}

.dropzone-formats {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.file-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
}

.file-status.no-file {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
}

.file-status.file-selected {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.file-preview {
    max-width: 300px;
    margin: 15px auto;
}

.file-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.document-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}      

/* ==========================================
   TOAST
   ========================================== */
#toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 1rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 90%;
    width: auto;
    min-width: 300px;
}

.toastPerso {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    animation: slideUp 0.3s ease-out;
    transition: all 0.3s ease;
}

.toastPerso.hiding {
    animation: slideDown 0.3s ease-in;
}

.toastPerso.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left: 8px solid #10b981;
    color: #065f46;
}

.toastPerso.warning {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    border-left: 8px solid #f59e0b;
    color: #78350f;
}

.toastPerso.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 8px solid #ef4444;
    color: #991b1b;
}

.toastPerso-icon {
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toastPerso.success .toast-icon {
    /*background: #10b981;*/
    color: white;
}

.toastPerso.warning .toast-icon {
    /*background: #f59e0b;*/
    color: white;
}

.toastPerso.error .toast-icon {
    /*background: #ef4444;*/
    color: white;
}

.toast-message {
    flex: 1;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0.6;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.hidden {
    display: none !important;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100px);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .toast-container {
        min-width: auto;
        width: calc(100% - 2rem);
    }
    
    .toast-message {
        font-size: 14px;
    }
}