/* Extracted and improved styles */
html { scroll-behavior: smooth; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.05); }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.2); border-radius: var(--radius-sm); }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.3); }

/* Frutiger Aero Theme: Glossy, Gradients, Blue/Green/White */
body {
    font-family: var(--font-family);
    padding: 0; margin: 0; height: 100vh; display: flex;
    background: var(--bg-gradient);
    color: var(--text-color);
}

/* Sidebar: Glassy */
#sidebar {
    width: 250px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--glass-border);
    display: flex; flex-direction: column;
    padding-top: var(--spacing-lg);
}
.logo {
    padding: 0 var(--spacing-lg) var(--spacing-lg);
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    color: var(--secondary-color);
    display: flex; align-items: center; gap: var(--spacing-sm);
    text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}
.logo i { background: -webkit-linear-gradient(#00a6ed, #005a9e); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-size: 28px; }

.nav-item {
    padding: 10px var(--spacing-lg); cursor: pointer; color: #444; margin: 2px 10px; border-radius: 6px;
    display: flex; align-items: center; gap: 10px; font-size: var(--font-size-md); transition: all 0.2s;
}
.nav-item:hover { background: rgba(255,255,255,0.5); color: #000; }
.nav-item.active {
    background: linear-gradient(180deg, #ffffff 0%, #e1f5fe 100%);
    color: var(--primary-color);
    font-weight: var(--font-weight-bold);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #cce3f0;
}

.user-profile {
    margin-top: auto;
    padding: var(--spacing-lg);
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar {
    width: 32px; height: 32px; background: var(--primary-color); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: bold;
}

/* Main Content */
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: rgba(255,255,255,0.4); margin: 10px; border-radius: var(--radius-lg); border: 1px solid var(--glass-border); box-shadow: var(--shadow-md); }

/* Header: Glossy Bar */
header {
    background: linear-gradient(180deg, #ffffff 0%, #f0f4f8 100%);
    border-bottom: 1px solid #dcdfe3;
    padding: 12px var(--spacing-lg);
    display: flex; align-items: center; justify-content: space-between;
    border-radius: 12px 12px 0 0;
}

/* Search Bar: Pill */
.search-bar { position: relative; width: 400px; }
.search-bar input {
    width: 100%; padding: 8px 15px 8px 35px;
    border: 1px solid #b3c6d4; border-radius: var(--radius-pill);
    background: white;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.search-bar i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #888; }

/* Buttons: Glossy Green/Blue */
.btn-glossy {
    background: var(--primary-gradient);
    color: white; border: 1px solid #1565C0;
    padding: 8px 16px; border-radius: var(--radius-pill);
    cursor: pointer; font-weight: 600; font-size: 13px;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}
.btn-glossy:hover { filter: brightness(1.1); }
.btn-glossy.green {
    background: var(--success-gradient);
    border: 1px solid #2e7d32;
}

/* File Browser */
#file-browser { flex: 1; overflow-y: auto; padding: 20px; }

/* Improved Table for Mobile */
#file-table-container { overflow-x: auto; } /* Wrapper added in JS/HTML later */
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 600px; }
th { text-align: left; padding: 10px; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid #ddd; }
td { padding: 10px; border-bottom: 1px solid rgba(0,0,0,0.05); font-size: 14px; vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,0.6); }

.file-icon { width: 24px; text-align: center; margin-right: 12px; font-size: 18px; color: #555; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1)); }
.folder-icon { color: #fbc02d; }

/* Action Buttons in Row */
.row-actions { opacity: 0; transition: opacity 0.2s; display: flex; gap: 5px; }
tr:hover .row-actions { opacity: 1; }
.mini-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 5px; font-size: 14px; }
.mini-btn:hover { color: var(--primary-color); transform: scale(1.1); }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; align-items: center; justify-content: center; }
.modal { background: white; padding: 0; border-radius: 8px; box-shadow: var(--shadow-lg); width: 600px; max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; max-width: 90%; }
.modal-header { padding: 15px 20px; background: #f5f5f5; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; font-weight: bold; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 15px; border-top: 1px solid #eee; text-align: right; background: #fafafa; }

/* Responsive adjustments */
@media (max-width: 768px) {
    body { flex-direction: column; }
    #sidebar { width: 100%; height: auto; padding-bottom: 10px; border-right: none; border-bottom: 1px solid var(--glass-border); }
    .nav-item { display: inline-flex; margin: 5px; }
    #main { margin: 0; border-radius: 0; border: none; }
    .search-bar { width: 100%; margin-bottom: 10px; }
    header { flex-direction: column; align-items: stretch; gap: 10px; height: auto; }
}
