:root {
    /* Color Palette - Premium Dark Mode */
    --bg-base: #0f1115;
    --bg-surface: #1a1d24;
    --bg-surface-hover: #232730;
    --bg-surface-active: #2c313c;
    
    --border-color: #2a2e39;
    --border-focus: #4b5563;
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --brand-primary: #3b82f6;
    --brand-primary-hover: #2563eb;
    --brand-accent: #60a5fa;
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    
    /* Typography */
    --font-family: 'Inter', sans-serif;
    
    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --sidebar-width: 260px;
    --topbar-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding: 0 8px;
}

.brand .logo-icon {
    font-size: 32px;
    color: var(--brand-primary);
}

.brand h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand h1 span {
    color: var(--brand-primary);
    font-weight: 300;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--brand-primary);
}

.storage-info {
    margin-top: auto;
    padding: 16px;
    background-color: var(--bg-base);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.storage-bar {
    height: 6px;
    background-color: var(--bg-surface-hover);
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

.storage-fill {
    height: 100%;
    background-color: var(--brand-primary);
    border-radius: 4px;
}

.storage-info p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background-color: var(--bg-base);
    border-bottom: 1px solid var(--border-color);
}

.search-container {
    position: relative;
    width: 400px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.search-container input {
    width: 100%;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 40px 12px 48px;
    border-radius: 20px;
    font-size: 14px;
    transition: var(--transition);
}

.search-container input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.clear-search {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}

.clear-search:hover {
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--brand-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--brand-primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--border-focus);
}

.btn-icon {
    padding: 8px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.btn-danger-icon:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Content Area */
.content-area {
    flex-grow: 1;
    padding: 24px 32px;
    overflow-y: auto;
    position: relative;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 500;
}

.breadcrumb-item {
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

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

.breadcrumb-item:last-child {
    color: var(--text-primary);
    cursor: default;
}

.breadcrumb-item:last-child:hover {
    color: var(--text-primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* File Grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.item-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-focus);
    background-color: var(--bg-surface-hover);
}

.item-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.item-icon.folder { color: #facc15; }
.item-icon.image { color: #38bdf8; }
.item-icon.pdf { color: #f87171; }
.item-icon.video { color: #c084fc; }
.item-icon.audio { color: #4ade80; }
.item-icon.code { color: #94a3b8; }
.item-icon.archive { color: #fb923c; }
.item-icon.file { color: var(--text-secondary); }

.item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.item-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--transition);
}

.item-card:hover .item-actions {
    opacity: 1;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60%;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    color: var(--border-focus);
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition);
}

.btn-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.form-input {
    width: 100%;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Drag & Drop Overlay */
#drop-zone-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 17, 21, 0.9);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone-content {
    border: 3px dashed var(--brand-primary);
    border-radius: 20px;
    padding: 60px;
    text-align: center;
    color: var(--text-primary);
}

.drop-zone-content i {
    font-size: 80px;
    color: var(--brand-primary);
    margin-bottom: 16px;
}

/* Upload Progress Widget */
.upload-progress-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 350px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 40;
    display: flex;
    flex-direction: column;
    max-height: 400px;
}

.upload-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-surface-active);
    border-radius: 12px 12px 0 0;
}

.upload-header h4 {
    font-size: 14px;
    font-weight: 600;
}

.upload-list {
    padding: 8px 0;
    overflow-y: auto;
}

.upload-item {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.upload-item:last-child {
    border-bottom: none;
}

.upload-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.upload-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.upload-status {
    color: var(--text-muted);
}

.progress-bar {
    height: 4px;
    background-color: var(--bg-base);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--brand-primary);
    width: 0%;
    transition: width 0.2s;
}

.upload-item.success .progress-fill {
    background-color: var(--success);
}
.upload-item.error .progress-fill {
    background-color: var(--danger);
}
.upload-item.error .upload-status {
    color: var(--danger);
}
