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

html, body {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background: #f0f2f5;
    color: #334155;
}

/* Main App Container */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Container & Title */
.sidebar-container {
    display: flex;
    flex-direction: column;
    width: 260px;
    height: 100%;
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.app-title {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #000;
    color: white;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
}

.app-title i {
    margin-right: 10px;
    font-size: 20px;
}

#sidebar {
    flex: 1;
    overflow-y: auto;
    padding: 10px 5px;
}

#folderTree {
    padding: 5px 0;
}

#folderTree ul {
    list-style: none;
}

#folderTree li {
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    cursor: pointer;
}

.folder-toggle {
    user-select: none;
    font-weight: 500;
    color: #4b5563;
    display: flex;
    align-items: center;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.folder-toggle:before {
    content: "\1F4C1";
    margin-right: 8px;
    font-size: 16px;
}

li.open > .folder-toggle:before {
    content: '\1F4C2'; /* open folder icon */
}
li.open > ul {
    display: block;
    animation: fadeIn 0.3s ease;
}

li > ul {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
.file-item {
    color: #4b5563;
    cursor: pointer;
    font-weight: 400;
    transition: all 0.2s ease;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.file-item:before {
    content: "\2B55";
    margin-right: 8px;
    color: #6b7280;
    font-size: 16px;
}

.file-item:hover, .file-item:focus {
    color: #3b82f6;
    background: #f0f7ff;
    outline: none;
    text-decoration: none;
}

.file-item.active {
    color: #3b82f6;
    background: #f0f7ff;
    font-weight: 500;
}

.file-item.active:before {
    color: #3b82f6;
}

.empty-folder {
    font-size: 12px;
    color: #94a3b8;
    margin-left: 8px;
    font-style: italic;
}
#viewerPane {
    flex: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.03);
}
#fileViewer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-align: center;
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 18px;
    font-weight: 500;
}

/* Loading indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    height: 100%;
}

.loading-indicator i {
    font-size: 40px;
    margin-bottom: 16px;
    color: #3b82f6;
}

.loading-indicator p {
    font-size: 16px;
    font-weight: 500;
}

/* File preview components */
.file-preview {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.file-preview-header {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.file-preview-header i {
    font-size: 20px;
    margin-right: 12px;
    color: #3b82f6;
}

.file-preview-header span {
    font-size: 16px;
    font-weight: 500;
    color: #334155;
}

.file-preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.pdf-container {
    width: 100%;
    height: 100%;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
}

.pdf-container embed,
.pdf-container object,
.pdf-container iframe {
    width: 100%;
    height: 100%;
    min-height: 85vh;
    border: none;
}

.unsupported-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #94a3b8;
    text-align: center;
}

.unsupported-file i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #f97316;
}

.unsupported-file p {
    font-size: 16px;
    font-weight: 500;
}
embed, img {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: #fff;
    max-width: 90%;
    max-height: 85vh;
    margin: 0 auto;
    display: block;
    transition: transform 0.2s ease;
}

img:hover {
    transform: scale(1.01);
}
::-webkit-scrollbar {
    width: 8px;
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.15);
}

/* Menu toggle button */
.menu-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1000;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 5px;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: #2563eb;
}

.menu-toggle i {
    font-size: 18px;
}

.close-menu {
    display: none;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .app-container {
        position: relative;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .close-menu {
        display: block;
    }
    
    .sidebar-container {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 260px;
        z-index: 1001;
        transition: left 0.3s ease;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.2);
    }
    
    .sidebar-container.active {
        left: 0;
    }
    
    #viewerPane {
        width: 100%;
        margin-left: 0;
    }
    
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .overlay.active {
        display: block;
        opacity: 1;
    }
}

