/* 
 * PrivacyCloud - Nextcloud 1:1 Theme (Support für OS Dark & Light Mode)
 */
:root {
    /* Nextcloud Standard Colors */
    --bg-main: #ffffff;
    --bg-header: #0082c9; /* NC Blau */
    --bg-sidebar: #f7f7f7;
    --text-main: #222222;
    --text-muted: #888888;
    --border-color: #ededed;
    --accent: #0082c9;
    --hover-bg: #f5f5f5;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Automatische Anpassung, falls das System auf Dark Mode steht */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #181b21;
        --bg-header: #20242b;
        --bg-sidebar: #22262d;
        --text-main: #eeeeee;
        --text-muted: #aaaaaa;
        --border-color: #313742;
        --accent: #1d82ba;
        --hover-bg: #2d333e;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0; padding: 0;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-family);
    height: 100vh;
    overflow: hidden; /* Der Scrollbereich im Explorer regelt das */
}

/* --- 1. LOGIN SCREEN --- */
.login-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-header) url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="40" stroke="rgba(255,255,255,0.05)" stroke-width="2" fill="none"/></svg>') repeat;
    display: flex; justify-content: center; align-items: center; z-index: 10000;
}
.login-box {
    background: var(--bg-main); padding: 40px; border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3); text-align: center; width: 350px;
}
.logo-area { margin-bottom: 20px; }
.logo-area h2 { margin: 10px 0 0 0; color: var(--text-main); font-weight: 300;}
.login-box input {
    width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid var(--border-color);
    border-radius: 5px; background: var(--bg-main); color: var(--text-main); font-size: 1rem; outline: none;
}
.login-box input:focus { border-color: var(--accent); }
.login-box button {
    width: 100%; padding: 12px; background: var(--accent); color: white;
    border: none; border-radius: 5px; font-size: 1rem; cursor: pointer; font-weight: 600; transition: opacity 0.2s;
}
.login-box button:hover { opacity: 0.9; }
.error-msg { color: #e1144b; font-size: 0.9rem; margin-top: 10px; }

/* --- 2. HEADER --- */
.app-layout { display: flex; flex-direction: column; height: 100vh; }
.nc-header {
    height: 50px; background-color: var(--bg-header); color: white;
    display: flex; justify-content: space-between; align-items: center; padding: 0 15px; flex-shrink: 0;
}
.header-left { display: flex; align-items: center; font-weight: 600; font-size: 1.05rem; }
.logo-text { margin-right: 15px; }
.top-nav { display: flex; }
.top-nav a { color: rgba(255,255,255,0.7); text-decoration: none; padding: 16px 15px; font-size: 0.95rem; }
.top-nav a:hover { color: white; }
.top-nav a.active { color: white; border-bottom: 3px solid white; }
.header-right { display: flex; align-items: center; gap: 15px; }
.search-bar { background: rgba(0,0,0,0.2); border: none; border-radius: 20px; padding: 6px 15px; color: white; width: 220px; outline:none; }
.search-bar::placeholder { color: rgba(255,255,255,0.6); }
.avatar { width: 32px; height: 32px; background-color: #fce205; color: #333; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold; cursor: pointer; }

/* --- 3. SIDEBAR --- */
.nc-main { display: flex; flex-grow: 1; overflow: hidden; }
.nc-sidebar { width: 250px; background-color: var(--bg-sidebar); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; padding: 15px 0; }
.nc-sidebar ul { list-style: none; padding: 0; margin: 0; }
.nc-sidebar li { padding: 12px 20px; cursor: pointer; font-size: 0.95rem; color: var(--text-muted); display:flex; gap:10px;}
.nc-sidebar li:hover { background-color: var(--hover-bg); color: var(--text-main); }
.nc-sidebar li.active { background-color: var(--hover-bg); border-left: 4px solid var(--accent); color: var(--text-main); font-weight: 600;}
.spacer { flex-grow: 1; }
.storage-info { padding: 20px; text-align: left; font-size: 0.8rem; color: var(--text-muted); }
.storage-info .bar { height: 5px; background: var(--border-color); border-radius: 3px; margin-bottom: 5px; overflow: hidden;}
.storage-info .fill { height: 100%; background: var(--accent); }

/* --- 4. EXPLORER (MIDDLE CONTENT) --- */
.nc-content { flex-grow: 1; display: flex; flex-direction: column; background-color: var(--bg-main); width: calc(100% - 250px);}
.controls-bar { height: 55px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; padding: 0 20px; flex-shrink:0;}
.breadcrumbs { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; color:var(--text-muted);}
.breadcrumbs span { cursor: pointer; }
.breadcrumbs span:hover { color: var(--accent); }
.breadcrumbs .separator { font-size: 0.9rem; }
.breadcrumbs .current { font-weight: bold; color: var(--text-main); cursor: default; }

.actions { display: flex; gap: 10px; }
.action-btn { background: transparent; border: 1px solid var(--border-color); padding: 8px 16px; border-radius: 4px; color: var(--text-main); cursor: pointer; font-size: 0.9rem; font-weight: 600; transition: background 0.1s; }
.action-btn:hover { background: var(--hover-bg); }
.action-btn.primary { background: var(--accent); color: white; border: none; }
.action-btn.primary:hover { opacity:0.9; }

/* TABLE VIEW */
.table-container { flex-grow: 1; overflow-y: auto; padding: 0 20px; position: relative;}
.file-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.file-table th { text-align: left; padding: 10px 5px; border-bottom: 1px solid var(--border-color); color: var(--text-muted); font-weight: normal; font-size: 0.9rem; position: sticky; top:0; background:var(--bg-main);}
.file-table td { padding: 12px 5px; border-bottom: 1px solid var(--border-color); cursor: pointer; color:var(--text-main);}
.file-table tr:hover td { background-color: var(--hover-bg); }
.col-icon { width: 40px; font-size: 1.5rem; text-align: center; }
.col-name { font-weight: 500; font-size: 0.95rem; }
.col-size { width: 100px; color: var(--text-muted); text-align: right; font-size:0.9rem;}
.col-menu { width: 40px; text-align:right;}

.empty-state { text-align: center; padding: 50px; color: var(--text-muted); margin-top: 40px; }
.hidden { display: none !important; }

/* --- 5. OVERLAYS & MODALS --- */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: flex-start; z-index: 9999; overflow-y: auto; padding: 5vh 0; }
.modal { background: var(--bg-main); padding: 25px; border-radius: 8px; width: 300px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); margin: auto; }
.large-modal { width: 450px; max-width: 95vw; }
.modal h3 { margin-top: 0; font-weight:400; font-size:1.2rem;}
.modal input { width: 100%; padding: 10px; margin-bottom: 15px; border: 1px solid var(--border-color); background: var(--bg-main); color: var(--text-main); border-radius:4px;}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions button { padding: 8px 12px; border: none; border-radius: 4px; cursor: pointer; font-weight:600;}
.modal-actions button.primary { background: var(--accent); color: white; }

.media-player { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #000; padding: 20px; border-radius: 8px; box-shadow: 0 0 0 100vmax rgba(0,0,0,0.85); z-index: 1000; width: 90%; max-width: 900px; }
.player-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; color: white;}
.player-header h3 { margin:0; font-weight:500;}
#closePlayer { background:none; border:none; color:white; font-size:1.5rem; cursor:pointer;}
video, img { max-width: 100%; border-radius: 4px; display: block; margin: 0 auto; max-height: 70vh;}
audio { width: 100%; }
