/* ========================================
   VARIABLES
======================================== */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   HEADER 
======================================== */
header {
    background: var(--primary-color); 
    border-bottom: 1px solid var(--primary-hover);
    position: sticky;
    top: 0;
    z-index: 100;
    color: #fff;
}

.navbar {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-info {
    color: #fff;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ========================================
   LAYOUT GLOBAL (IMPORTANT)
======================================== */
.app-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* CONTENU PRINCIPAL */
.app-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* SIDEBAR DROITE */
.app-sidebar {
    width: 350px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    align-self: flex-start;
}

/* ========================================
   ALERTES
======================================== */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ========================================
   BUTTONS
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

    .btn-primary:hover {
        background: var(--primary-hover);
    }

.btn-secondary {
    background: var(--secondary-color);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* ========================================
   SIDEBAR NEWS 
======================================== */
.app-sidebar h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.news-article {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

    .news-article h3 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }

    .news-article time {
        font-size: 0.8rem;
        color: var(--text-secondary);
        display: block;
        margin-bottom: 0.5rem;
    }

.news-image img {
    width: 100%;
    border-radius: var(--radius);
    margin-top: 0.5rem;
}

.news-attachment {
    display: inline-flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
}

/* ========================================
   LOGIN FORMS (FTP + Admin)
======================================== */
.home-container,
.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 2rem;
}

.home-main,
.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    min-width: 420px;
}

    .login-section h1,
    .auth-card h1 {
        font-size: 1.5rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .login-section .subtitle,
    .auth-card .subtitle {
        color: var(--text-secondary);
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .login-section .form-group,
    .auth-card .form-group {
        margin-bottom: 1rem;
    }

        .login-section .form-group label,
        .auth-card .form-group label {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            font-size: 0.875rem;
            color: var(--text-secondary);
            margin-bottom: 0.35rem;
            white-space: normal;
            word-wrap: break-word;
        }

        .login-section .form-group input,
        .auth-card .form-group input {
            width: 100%;
            padding: 0.6rem 0.85rem;
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            font-size: 0.9rem;
            background: var(--surface);
            color: var(--text-primary);
            transition: border-color 0.2s;
        }

            .login-section .form-group input:focus,
            .auth-card .form-group input:focus {
                outline: none;
                border-color: var(--primary-color);
                box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
            }

    .login-section .btn-primary,
    .auth-card .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
        font-size: 0.95rem;
        margin-top: 0.5rem;
        box-sizing: border-box;
    }

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.875rem;
}

    .auth-footer a {
        color: var(--text-secondary);
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
    }

        .auth-footer a:hover {
            color: var(--primary-color);
        }

.logged-in-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    padding: 1rem 0;
    color: var(--success-color);
}

    .logged-in-message p {
        color: var(--text-primary);
        margin: 0;
    }

/* ========================================
   FILE BROWSER
======================================== */
/* ========================================
   FILE BROWSER
======================================== */
.file-browser {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.browser-header {
    margin-bottom: 1.25rem;
}

    .browser-header h1 {
        font-size: 1.5rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

/* BREADCRUMB */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--primary-color);
    text-decoration: none;
}

    .breadcrumb-item:hover {
        text-decoration: underline;
    }

    .breadcrumb-item.active {
        color: var(--text-secondary);
        font-weight: 500;
    }

.breadcrumb-separator {
    color: var(--text-secondary);
}

/* DOSSIER PARENT */
.parent-folder {
    margin-bottom: 1rem;
}

/* TABLE */
.file-table-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

    .file-table thead {
        background: var(--background);
        border-bottom: 1px solid var(--border-color);
    }

        .file-table thead th {
            padding: 0.75rem 1rem;
            text-align: left;
            font-weight: 600;
            color: var(--text-secondary);
            font-size: 0.8rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

            .file-table thead th a {
                color: var(--text-secondary);
                text-decoration: none;
                display: inline-flex;
                align-items: center;
                gap: 0.35rem;
                transition: color 0.2s;
            }

                .file-table thead th a:hover {
                    color: var(--primary-color);
                }

    .file-table tbody tr {
        border-bottom: 1px solid var(--border-color);
        transition: background 0.15s;
    }

        .file-table tbody tr:last-child {
            border-bottom: none;
        }

        .file-table tbody tr:hover {
            background: var(--background);
        }

    .file-table td {
        padding: 0.65rem 1rem;
        vertical-align: middle;
    }

/* COLONNES */
.col-icon {
    width: 36px;
    color: var(--warning-color);
    font-size: 1rem;
}

.file-row .col-icon {
    color: var(--text-secondary);
}

.col-name a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

    .col-name a:hover {
        text-decoration: underline;
    }

.col-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
    width: 160px;
}

.col-size {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: right;
    width: 90px;
}

/* DOSSIER VIDE */
.empty-folder {
    text-align: center;
    padding: 3rem !important;
    color: var(--text-secondary);
}

    .empty-folder i {
        font-size: 2.5rem;
        display: block;
        margin-bottom: 0.5rem;
        opacity: 0.4;
    }

/* STATS */
.browser-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

    .browser-stats span {
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }
/* ========================================
   FOOTER
======================================== */
footer {
    background: var(--primary-color); 
    color: #fff;
    padding: 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}
footer a {
    color: #fff;
    text-decoration: none;
}

/* Icônes FontAwesome */
footer i {
    color: #fff;
}

/* Effet hover optionnel */
footer a:hover {
    opacity: 0.8;
}

/* Social icons spacing */
.footer-social a {
    margin: 0 0.4rem;
    font-size: 1.1rem;
}
/* ========================================
   LANGUAGE SWITCHER
======================================== */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

    .lang-btn img {
        width: 22px;
        height: 16px;
        border-radius: 3px;
        object-fit: cover;
    }

    .lang-btn:hover {
        background: rgba(255,255,255,0.2);
        transform: translateY(-1px);
    }

    .lang-btn.active {
        background: #fff;
        color: var(--primary-color);
        border-color: #fff;
    }
/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 968px) {
    .app-layout {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        order: -1;
    }

}
