/* Variables CSS pour une cohérence visuelle - Thème vert sur fond blanc */
:root {
    --primary-color: #28a745;
    --primary-hover: #218838;
    --secondary-color: #20c997;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    --background: #ffffff;
    --surface: #f8f9fa;
    --surface-hover: #e9ecef;
    --border-color: #dee2e6;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.file-manager-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* Header principal avec gradient vert */
.header-section {
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.header-section::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"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.file-manager-container h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: black;
    position: relative;
    z-index: 1;
}

.file-manager-container h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 0.5rem;
}

/* Cards système sur fond blanc */
.system-limits,
.upload-options {
    background: var(--background);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.system-limits:hover,
.upload-options:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
    border-color: var(--primary-hover);
}

.system-limits h3,
.upload-options h3 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.system-limits h3::before {
    content: '⚙️';
    font-size: 1.25rem;
}

.upload-options h3::before {
    content: '🔧';
    font-size: 1.25rem;
}

.system-limits ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.system-limits li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    padding: 0.75rem;
    background: var(--surface);
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--primary-color);
    font-size: 0.875rem;
    transition: var(--transition);
}

.system-limits li:hover {
    background: var(--surface-hover);
    border-left-color: var(--secondary-color);
}

/* Usage info avec thème vert */
.usage-info {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--background);
    border-radius: var(--border-radius);
    border: 1px solid var(--primary-color);
    position: relative;
    z-index: 1;
    color:black;
}

.usage-info strong {
    color: var(--primary-color);
    font-size: 1rem;
    display: block;
    margin-bottom: 0.75rem;
}

.usage-bar {
    width: 100%;
    height: 12px;
    background: var(--surface);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.usage-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 6px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.usage-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.usage-progress.warning {
    background: linear-gradient(90deg, var(--warning-color), var(--error-color));
}

/* Options d'upload */
.upload-settings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.upload-settings label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    border: 1px solid transparent;
}

.upload-settings label:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
}

.upload-settings input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    border-radius: 4px;
}

/* Zone d'upload avec thème vert */
.upload-zone {
    background: var(--background);
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    margin: 1.5rem 0;
    z-index: 1;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.upload-zone:hover,
.upload-zone.dragover {
    background: var(--surface);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-zone:hover::before,
.upload-zone.dragover::before {
    opacity: 0.1;
    width: 200px;
    height: 200px;
}

.file-input {
    display: none;
}

.upload-label {
    cursor: pointer;
    display: block;
    position: relative;
    z-index: 1;
}

.upload-text {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.upload-text::before {
    content: '📁';
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

.upload-limit {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Barre de progression d'upload */
.upload-progress-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--background);
    border-radius: var(--border-radius);
    border: 1px solid var(--primary-color);
    position: relative;
    z-index: 1;
}

.upload-progress-bar {
    width: 100%;
    height: 12px;
    background: var(--surface);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 6px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progress-shimmer 1.5s infinite;
}

@keyframes progress-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.upload-progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-speed {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Section des fichiers sur fond blanc */
.files-section {
    background: var(--background);
    border-top: 1px solid var(--border-color);
}

.files-header {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 2rem;
    font-weight: 600;
}

.file-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1.5fr 1fr 1.5fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    background: var(--background);
}

.file-row:not(.header):hover {
    background: var(--surface);
}

.file-row.header {
    font-weight: 600;
    background: transparent;
    color: white;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    box-shadow: none !important;
}

.file-row:last-child {
    border-bottom: none;
}

.file-name {
    font-weight: 500;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-name::before {
    content: '📄';
    font-size: 1.25rem;
    flex-shrink: 0;
}

.file-size,
.file-date,
.file-modified {
    color: white;
    font-size: 0.875rem;
}

.file-status {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
}

#filesList .file-row div{
    color:black !important;
}

/* Actions des fichiers avec thème vert */
.file-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.file-actions button {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    border: none;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.download-file {
    background: var(--secondary-color);
    color: white;
}

.download-file:hover {
    background: #1ba085;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.delete-file {
    background: var(--error-color);
    color: white;
}

.delete-file::before {
    content: none !important;
}

.delete-file:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Notifications avec thème vert */
.fmu-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    min-width: 320px;
    max-width: 480px;
    display: none;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fmu-notification.success {
    background: linear-gradient(135deg, var(--success-color), var(--secondary-color));
}

.fmu-notification.error {
    background: linear-gradient(135deg, var(--error-color), #c82333);
}

.fmu-notification.info {
    background: linear-gradient(135deg, var(--info-color), var(--primary-color));
}

.close-notification {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
    float: right;
    cursor: pointer;
    margin-left: 1rem;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: var(--transition);
}

.close-notification:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Responsive design amélioré */
@media (max-width: 1024px) {
    .file-manager-container {
        margin: 1rem;
    }
    
    .header-section {
        padding: 1.5rem;
    }
    
    .file-manager-container h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .file-manager-container {
        margin: 0.5rem;
        border-radius: var(--border-radius-sm);
    }
    
    .header-section {
        padding: 1rem;
    }
    
    .file-manager-container h1 {
        font-size: 1.75rem;
    }
    
    .system-limits,
    .upload-options,
    .usage-info {
        margin: 1rem 0;
        padding: 1rem;
    }
    
    .upload-zone {
        padding: 2rem 1rem;
    }
    
    .upload-text {
        font-size: 1.125rem;
    }
    
    .file-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
        text-align: left;
    }
    
    .file-row > div {
        padding: 0.5rem 0;
    }
    
    .files-header {
        display: none;
    }
    
    .file-name::before { content: "📄 "; }
    .file-size::before { content: "📏 "; color: var(--text-muted); }
    .file-date::before { content: "📅 "; color: var(--text-muted); }
    .file-modified::before { content: "🔄 "; color: var(--text-muted); }
    .file-status::before { content: "✅ "; color: var(--text-muted); }
    
    .file-actions {
        justify-content: flex-start;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .file-actions button {
        width: 100%;
        justify-content: center;
    }
    
    .fmu-notification {
        left: 0.5rem;
        right: 0.5rem;
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .file-manager-container h1 {
        font-size: 1.5rem;
    }
    
    .upload-settings {
        gap: 0.75rem;
    }
    
    .upload-settings label {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}

/* Animations d'entrée */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-manager-container {
    animation: fadeInUp 0.6s ease-out;
}

.file-row:not(.header) {
    animation: fadeInUp 0.4s ease-out;
    animation-fill-mode: both;
}

.file-row:nth-child(1) { animation-delay: 0.1s; }
.file-row:nth-child(2) { animation-delay: 0.2s; }
.file-row:nth-child(3) { animation-delay: 0.3s; }
.file-row:nth-child(4) { animation-delay: 0.4s; }
.file-row:nth-child(5) { animation-delay: 0.5s; }

/* États de focus pour l'accessibilité */
button:focus,
input:focus,
label:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}