@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-base: #09090b;
    --bg-sidebar: #0e0e11;
    --bg-surface: #141418;
    --bg-surface-hover: #1c1c22;
    --text-main: #f8fafc;
    --text-muted: #80808e;
    --border-light: rgba(255, 255, 255, 0.06);
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.15);
    --danger: #f87171;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Effet halo lumineux en arrière-plan */
body::before {
    content: ''; position: absolute; top: -20%; left: -10%; width: 60vw; height: 60vh;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
    filter: blur(80px); z-index: -1; pointer-events: none;
}

body.page-centree { justify-content: center; align-items: center; flex-direction: column; }

/* --- SIDEBAR --- */
.sidebar {
    width: 280px; background-color: var(--bg-sidebar); border-right: 1px solid var(--border-light);
    display: flex; flex-direction: column; z-index: 10;
}

.brand {
    padding: 24px; display: flex; align-items: center; gap: 12px;
    font-size: 20px; font-weight: 600; letter-spacing: 0.5px;
}
.brand-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 10px var(--accent); }
.brand-sub { font-size: 11px; color: var(--text-muted); font-weight: 400; display: block; margin-top: 2px;}

.sidebar-content { padding: 0 16px; flex: 1; overflow-y: auto; }

.btn-new-folder {
    width: 100%; padding: 14px; background: transparent; border: 1px solid var(--border-light);
    color: var(--accent); border-radius: 8px; font-weight: 500; font-size: 13px;
    letter-spacing: 1px; cursor: pointer; transition: all 0.2s; margin-bottom: 30px;
    display: flex; justify-content: center; align-items: center; gap: 8px;
}
.btn-new-folder:hover { background: var(--accent-glow); border-color: var(--accent); }

.nav-section { margin-bottom: 30px; }
.nav-title { 
    font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text-muted); margin-bottom: 12px; padding-left: 12px;
}

.nav-link {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; text-decoration: none; color: var(--text-muted);
    border-radius: 6px; transition: all 0.2s; font-size: 14px; margin-bottom: 4px;
}
.nav-link-left { display: flex; align-items: center; gap: 12px; }
.nav-link:hover { color: var(--text-main); background: var(--bg-surface); }
.nav-link.active { 
    background: var(--bg-surface-hover); color: var(--text-main);
    border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0;
}
.nav-badge {
    background: var(--bg-base); border: 1px solid var(--border-light);
    padding: 2px 8px; border-radius: 12px; font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: var(--text-muted);
}

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border-light); }
.sidebar-footer .nav-link { margin-bottom: 0; font-size: 13px; }

/* --- MAIN CONTENT --- */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
    padding: 20px 40px; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border-light); background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(20px); z-index: 5;
}

/* Fil d'ariane cliquable */
.breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.crumb-link { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.crumb-link:hover { color: var(--text-main); }
.crumb-link.current { color: var(--text-main); pointer-events: none; }
.crumb-sep { color: var(--border-light); }

.topbar-actions { display: flex; align-items: center; gap: 16px; }
.btn-upload {
    padding: 8px 16px; background: var(--bg-surface); border: 1px solid var(--border-light);
    color: var(--text-main); border-radius: 6px; font-size: 13px; cursor: pointer; transition: 0.2s;
}
.btn-upload:hover { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600;}

.file-area { flex: 1; padding: 20px 40px; overflow-y: auto; }

/* Affichage en liste (Premium) */
.file-list { display: flex; flex-direction: column; gap: 4px; }
.file-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; background: var(--bg-surface); border: 1px solid transparent;
    border-radius: 8px; transition: all 0.2s; text-decoration: none; color: inherit;
}
.file-row:hover { background: var(--bg-surface-hover); border-color: var(--border-light); transform: translateX(4px); }

.file-info { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }
.file-icon { font-size: 20px; width: 30px; text-align: center;}
.file-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500;}

.file-meta-group { display: flex; align-items: center; gap: 40px; color: var(--text-muted); font-size: 13px; }
.file-date { font-family: 'JetBrains Mono', monospace; font-size: 12px; width: 120px; text-align: right;}
.file-size { font-family: 'JetBrains Mono', monospace; font-size: 12px; width: 80px; text-align: right;}

.file-actions { display: flex; gap: 12px; width: 80px; justify-content: flex-end; }
.action-btn { 
    background: transparent; border: none; color: var(--text-muted); 
    cursor: pointer; font-size: 16px; transition: 0.2s; text-decoration: none;
}
.action-btn:hover { color: var(--accent); }
.action-btn.delete:hover { color: var(--danger); }

/* Formulaires Auth & Profil */
.auth-box {
    background: var(--bg-surface); padding: 40px; border-radius: 16px;
    border: 1px solid var(--border-light); width: 100%; max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.form-input {
    width: 100%; padding: 12px 16px; background: var(--bg-base); border: 1px solid var(--border-light);
    color: var(--text-main); border-radius: 8px; margin-bottom: 16px; outline: none; transition: 0.2s;
}
.form-input:focus { border-color: var(--accent); }
.btn-primary {
    width: 100%; padding: 12px; background: var(--accent); color: #000; border: none;
    border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 0 15px var(--accent-glow); }
/* --- MODALE PRÉVISUALISATION (Style Google Drive) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.9); z-index: 99999;
    display: none; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-content {
    width: 100%; height: 100%; display: flex; flex-direction: column;
}
.modal-header {
    position: absolute; top: 20px; right: 30px; z-index: 100000;
}
.close-btn {
    background: rgba(255, 255, 255, 0.1); border: none; color: white;
    font-size: 24px; width: 45px; height: 45px; border-radius: 50%;
    cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center;
}
.close-btn:hover { background: rgba(255, 255, 255, 0.3); }
.modal-body {
    flex: 1; display: flex; justify-content: center; align-items: center;
    padding: 40px; overflow: hidden;
}
.modal-body img, .modal-body video {
    max-width: 90vw; max-height: 90vh; object-fit: contain;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5); border-radius: 4px;
}
.modal-body iframe {
    width: 80vw; height: 90vh; border-radius: 8px; background: white; border: none;
}