* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
}

header {
    background: linear-gradient(to right, #4a00e0, #8e2de2);
    color: white;
    padding: 15px 30px;
    text-align: center;
    flex-shrink: 0;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 0;
}

.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.breadcrumb {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.breadcrumb-item {
    padding: 8px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.breadcrumb-item:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.breadcrumb-separator {
    color: #6c757d;
    margin: 0 5px;
    line-height: 35px;
    flex-shrink: 0;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.button-row {
    display: flex;
    gap: 10px;
}

.button-row .nav-btn {
    flex: 1;
}

.refresh-btn {
    width: 100%;
}

.nav-btn, .refresh-btn {
    padding: 12px;
    background: linear-gradient(to right, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 14px;
}

.nav-btn:hover:not(:disabled), .refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.nav-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.file-explorer {
    padding: 20px 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-explorer h2 {
    margin-bottom: 20px;
    color: #343a40;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    flex-shrink: 0;
}

.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    overflow-y: auto;
    flex: 1;
    padding-right: 10px;
    align-content: start;
}

.file-list::-webkit-scrollbar {
    width: 8px;
}

.file-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.folder-item, .file-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.folder-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
    border-color: #ffc107;
    background: #fff9e6;
}

.file-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
    border-color: #007bff;
    background: #f0f8ff;
}

.file-item.file-exists:hover {
    border-color: #28a745;
    background: #f0fff4;
}

.file-item.file-missing {
    opacity: 0.5;
    cursor: not-allowed;
}

.file-item.file-missing:hover {
    transform: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-color: #e9ecef;
    background: white;
}

.item-name {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    word-break: break-all;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.item-info {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

.file-status {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 8px;
}

.file-exists .file-status {
    background: #28a745;
    color: white;
}

.file-missing .file-status {
    background: #6c757d;
    color: white;
}

.file-viewer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    height: 80%;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.file-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
}

.file-viewer-header h3 {
    color: #495057;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #dc3545;
}

.file-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    border-radius: 0 0 10px 10px;
    line-height: 1.5;
}

.hidden {
    display: none;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    grid-column: 1 / -1;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        height: calc(100vh - 20px);
        border-radius: 10px;
    }
    
    header {
        padding: 12px 20px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding: 15px;
    }
    
    .content {
        min-height: 60vh;
    }
    
    .file-explorer {
        padding: 15px 20px;
    }
    
    .file-explorer h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }
    
    .file-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .file-viewer {
        width: 95%;
        height: 85%;
    }
    
    .breadcrumb {
        padding: 10px 0;
        margin-bottom: 15px;
    }
    
    .breadcrumb-item {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .folder-item, .file-item {
        height: 70px;
        padding: 12px 8px;
    }
    
    .item-name {
        font-size: 13px;
    }
    
    .item-info {
        font-size: 10px;
    }
    
    .nav-btn, .refresh-btn {
        padding: 14px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .file-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .folder-item, .file-item {
        height: 65px;
        padding: 10px 6px;
    }
    
    .item-name {
        font-size: 12px;
    }
    
    .breadcrumb {
        gap: 3px;
    }
    
    .breadcrumb-item {
        font-size: 11px;
        padding: 5px 8px;
    }
}