/* /srv/http/assets/css/style.css */

:root {
    --bg-color: #0f0f0f;
    --surface-color: #1e1e1e;
    --primary-color: #4CAF50;
    --danger-color: #ff5252;
    --accent-color: #2196F3;
    --folder-color: #FFC107;
    --text-muted: #888888;
}

/* ==========================================
   1. BASE GLOBAL
   ========================================== */

/* --- THÈME GLASSMORPHISM : NORDIQUE (Public) --- */
.theme-glass {
    --bg-color: #0d1117;           /* Bleu nuit arctique */
    --surface-color: rgba(255, 255, 255, 0.05); /* Verre givré */
    --primary-color: #58a6ff;      /* Bleu ciel polaire */
    --accent-color: #ffffff;
    --text-main: #f0f6fc;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);
    --font-main: 'Inter', system-ui, sans-serif;
}

/* --- THÈME CYBERPUNK : NUIT NÉON (Privé) --- */
.theme-cyber {
    --bg-color: #050505;           /* Noir pur */
    --surface-color: #0a0a0a;      /* Gris machine */
    --primary-color: #39ff14;      /* Vert néon (CachyOS style) */
    --accent-color: #ff00ff;       /* Magenta électrique */
    --text-main: #39ff14;
    --glass-border: #1a1a1a;
    --glass-blur: none;            /* Pas de flou pour un look brut */
    --font-main: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Application globale des variables */
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Exemple d'adaptation d'un bloc au Glassmorphism */
.box, .gallery-item, .login-box {
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

.btn {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-block;
    text-align: center;
    border: none;
    font-family: inherit;
}

input[type="text"], input[type="password"], input[type="file"] {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 8px;
    border-radius: 4px;
    font-family: inherit;
    box-sizing: border-box;
}

input[type="text"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px var(--primary-color);
}

/* ==========================================
   2. PAGE DE CONNEXION (login.php)
   ========================================== */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 0;
}

.login-box {
    background: var(--surface-color);
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
}

input[type="text"], input[type="password"], input[type="file"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.3); /* Fond sombre universel */
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    font-family: inherit;
}

input[type="text"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(88, 166, 255, 0.5);
}

.login-box .btn {
    width: 100%;
    padding: 10px;
}

.error {
    color: var(--danger-color);
    margin-bottom: 15px;
}

/* ==========================================
   3. CONTENEURS (Drive & Share)
   ========================================== */
.drive-container {
    max-width: 900px;
    margin: 40px auto;
    background: var(--surface-color);
    padding: 20px;
    border-radius: 8px;
}

.box {
    border: 1px solid #444;
    padding: 15px;
    border-radius: 4px;
    flex: 1;
}

.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.msg {
    padding: 10px;
    margin-bottom: 20px;
    background: #333;
    border-left: 4px solid var(--primary-color);
}

.disk-usage progress {
    width: 100%;
    height: 20px;
}

.btn-delete {
    color: var(--danger-color);
    text-decoration: none;
    font-weight: bold;
    margin-left: 10px;
    font-size: 1.1em;
}

.btn-share {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
}

/* ==========================================
   4. LISTES ET EXPLORATEUR (Drive & Share)
   ========================================== */
/* UI Drive Privé */
.explorer-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #333;
}

.explorer-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.item-info {
    flex: 1;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* UI Share Public */
.item {
    padding: 12px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

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

.folder-icon {
    color: var(--folder-color);
    margin-right: 10px;
}

.file-icon {
    color: var(--accent-color);
    margin-right: 10px;
}

.size {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* ==========================================
   5. GALERIE PUBLIQUE (index.php)
   ========================================== */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--surface-color);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.lightbox {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 15, 15, 0.95);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: #ccc;
}

/* ==========================================
 *  6. HEADER & NAVIGATION
 *  ========================================== */
.site-header {
    background-color: var(--surface-color);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

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

/* Le Menu Déroulant (Desktop) */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #111;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 1;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #333;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #333;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Bouton Hamburger Mobile (caché par défaut) */
.menu-toggle {
    display: none;
    font-size: 1.8em;
    cursor: pointer;
    background: none;
    border: none;
    color: white;
}

/* --- Boutons : Thème Nordique (Glassmorphism) --- */
.theme-glass .btn {
    background: rgba(88, 166, 255, 0.2); /* Bleu ciel translucide */
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    border-radius: 6px;
}

.theme-glass .btn:hover {
    background: var(--primary-color);
    color: var(--bg-color);
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
}

/* --- Boutons : Thème Nuit Néon (Cyberpunk) --- */
.theme-cyber .btn {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 0; /* Bordures dures, pas d'arrondi */
    transition: all 0.2s ease;
    box-shadow: 0 0 5px var(--primary-color), inset 0 0 5px var(--primary-color); /* Effet Glow */
}

.theme-cyber .btn:hover {
    background: var(--primary-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--primary-color), inset 0 0 10px var(--primary-color);
}

/* --- Typographie et Liens --- */
/* Pour que la police monospace du thème cyber s'applique bien partout */
.theme-cyber input, .theme-cyber button, .theme-cyber a {
    font-family: 'Fira Code', monospace;
}

/* Couleurs des liens dans l'explorateur */
.theme-cyber .explorer-item a,
.theme-cyber .item a {
    color: var(--accent-color); /* Magenta électrique pour les fichiers */
    text-shadow: 0 0 3px var(--accent-color);
}

.theme-cyber .explorer-item .folder-icon,
.theme-cyber .item .folder-icon {
    color: var(--primary-color); /* Vert néon pour les dossiers */
    text-shadow: 0 0 3px var(--primary-color);
}

.logo-img {
    height: 40px; /* Ajustez selon la taille souhaitée */
    width: auto;
    display: block;
    transition: filter 0.3s ease;
}

/* Effet néon sur le logo uniquement dans le thème Cyberpunk */
.theme-cyber .logo-img {
    filter: drop-shadow(0 0 5px var(--primary-color));
}

/* ==========================================
 *  7. FOOTER
 *  ========================================== */
.site-footer {
    background-color: var(--surface-color);
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid #333;
    font-size: 0.9em;
}

/* ==========================================
 *  8. RESPONSIVE DESIGN (Mobiles & Fenêtres réduites)
 *  ========================================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: var(--surface-color);
        border-bottom: 1px solid #333;
        padding: 10px 0;
        box-shadow: 0px 8px 16px rgba(0,0,0,0.5);
    }

    .nav-links.active {
        display: flex;
    }

    .dropdown:hover .dropdown-content {
        display: none;
    }

    .dropdown-content {
        display: block;
        position: static;
        box-shadow: none;
        border: none;
        background: transparent;
        padding-left: 20px;
    }

    .menu-toggle {
        display: block;
    }
}
