:root {
    --bg-color: #0f172a;
    --sidebar-bg: rgba(30, 41, 59, 0.7);
    --card-bg: rgba(30, 41, 59, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: rgba(255, 255, 255, 0.1);
    --danger-color: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    background: radial-gradient(circle at top right, #1e1b4b 0%, #0f172a 50%, #020617 100%);
}

/* Sidebar */
.sidebar {
    width: 140px;
    min-width: 140px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 5px;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar.collapsed {
    margin-left: -140px;
    opacity: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--accent-color);
}

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

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

.menu-item:hover, .menu-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.menu-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-color);
}

.storage-info {
    margin-top: auto;
    padding-top: 24px;
    padding-bottom: 24px;
    border-top: 1px solid var(--border-color);
}

.storage-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: var(--accent-color);
    border-radius: 4px;
}

.storage-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

/* Header */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    width: 300px;
    max-width: 100%;
    transition: all 0.2s ease;
}

.search-box:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-box i {
    color: var(--text-secondary);
    margin-right: 12px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    font-family: inherit;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.25rem;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 20px 40px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.breadcrumb-item {
    cursor: pointer;
    transition: color 0.2s;
}

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

.breadcrumb-separator {
    font-size: 0.8rem;
    color: var(--border-color);
}

/* File Area */
.file-area {
    flex-grow: 1;
    padding: 20px 40px;
    overflow-y: auto;
    position: relative;
}

.drop-overlay {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    justify-content: center;
    align-items: center;
    border: 2px dashed var(--accent-color);
    border-radius: 12px;
    margin: 20px 40px;
}

.drop-overlay.dragover {
    display: flex;
}

.drop-msg {
    text-align: center;
    color: var(--accent-color);
}

.drop-msg i {
    font-size: 4rem;
    margin-bottom: 16px;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.file-table th:nth-child(1) { width: 45%; }
.file-table th:nth-child(2) { width: 25%; }
.file-table th:nth-child(3) { width: 15%; }
.file-table th:nth-child(4) { width: 15%; }

.file-table th {
    text-align: left;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.file-table td {
    padding: 6px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.file-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.file-name {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.file-name i {
    font-size: 1.25rem;
}

.file-name i.fa-folder {
    color: #facc15;
}

.file-name i.fa-file {
    color: var(--text-secondary);
}

.file-name i.fa-file-image {
    color: #10b981;
}

.file-thumbnail {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--card-bg);
    flex-shrink: 0;
}

.file-name span {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.file-name:hover span {
    color: var(--accent-color);
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.2s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 32px;
    border-radius: 16px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    transform: translateY(20px);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

.modal-content h3 {
    margin-bottom: 20px;
    font-weight: 600;
}

.modal-content input {
    width: 100%;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    margin-bottom: 24px;
    font-family: inherit;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; }
}

/* Responsive Table */
@media (max-width: 1024px) {
    .file-table th:nth-child(2),
    .file-table td:nth-child(2),
    .file-table th:nth-child(3),
    .file-table td:nth-child(3) {
        display: none;
    }
    .file-table th:nth-child(1) { width: 70%; }
    .file-table th:nth-child(4) { width: 30%; }
    
    .top-bar {
        padding: 16px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }
    .search-box {
        width: 100%;
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        height: 100%;
        z-index: 100;
        box-shadow: 4px 0 24px rgba(0,0,0,0.6);
    }
    
    .sidebar-overlay {
        display: none;
    }
    
    .sidebar:not(.collapsed) + .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 90;
        backdrop-filter: blur(2px);
    }
    
    .top-bar {
        padding: 12px 16px;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .btn-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
}
