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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    text-align: center;
}

.header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 1.1em;
}

.view-toggle {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.view-toggle a {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.view-toggle a:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

.view-toggle a.active {
    background: #764ba2;
}

.content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.tree-controls {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.tree-controls button {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tree-controls button:hover {
    background: #764ba2;
}

.btn-bulk-mode {
    background: #667eea !important;
}

.bulk-actions {
    display: none;
    gap: 10px;
    align-items: center;
    padding-left: 10px;
    border-left: 2px solid #ddd;
}

.bulk-counter {
    font-weight: bold;
    color: #667eea;
}

.tree-view {
    font-family: 'Courier New', monospace;
}

.tree-folder {
    margin: 5px 0;
}

.folder-header {
    padding: 8px;
    background: #f0f0f0;
    border-left: 3px solid #667eea;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease;
}

.folder-header:hover {
    background: #e8e8e8;
}

.folder-icon {
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.folder-icon.expanded {
    transform: rotate(90deg);
}

.folder-name {
    font-weight: bold;
    color: #667eea;
}

.folder-count {
    color: #999;
    font-size: 0.9em;
}

.folder-contents {
    margin-left: 20px;
    display: none;
    border-left: 2px solid #e0e0e0;
    padding-left: 10px;
}

.folder-contents.expanded {
    display: block;
}

.tree-file {
    padding: 8px;
    margin: 3px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.tree-file:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.file-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.file-icon {
    color: #999;
}

.file-name {
    color: #333;
    font-weight: 500;
}

.file-meta {
    color: #999;
    font-size: 0.85em;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.file-actions a, .file-actions button {
    padding: 5px 10px;
    text-decoration: none;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.btn-preview {
    background: #4CAF50;
    color: white;
}

.btn-preview:hover {
    background: #45a049;
}

.btn-download {
    background: #2196F3;
    color: white;
}

.btn-download:hover {
    background: #0b7dda;
}

.btn-move {
    background: #FF9800;
    color: white;
}

.btn-move:hover {
    background: #e68900;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #da190b;
}

.no-files {
    text-align: center;
    padding: 40px;
    color: #999;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: #999;
    color: white;
}

.btn-cancel:hover {
    background: #777;
}

.btn-submit {
    background: #667eea;
    color: white;
}

.btn-submit:hover {
    background: #764ba2;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 768px) {
    .file-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-actions {
        width: 100%;
        justify-content: space-between;
    }

    .tree-file {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tree-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bulk-actions {
        border-left: none;
        border-top: 2px solid #ddd;
        padding-left: 0;
        padding-top: 10px;
    }
}