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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 20px;
}

header h1 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 10px;
}

header p {
    color: #a0a0a0;
    font-size: 1.1rem;
}

.header-controls {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.header-controls .search-box {
    width: 100%;
    max-width: 500px;
    margin-bottom: 0;
    position: relative;
}

.header-controls .filter-options {
    margin-bottom: 0;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 35px 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.search-box input::placeholder {
    color: #888;
}

.clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s;
}

.clear-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.status-bar {
    width: 100%;
    text-align: center;
    margin-top: 15px;
    padding: 6px 15px;
    font-size: 13px;
    display: inline-block;
    vertical-align: bottom;
}

.status-bar.status-ok {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-left: none;
    border-right: none;
}

.status-bar.status-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffd54f;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-bar.status-error {
    background: rgba(244, 67, 54, 0.2);
    color: #e57373;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary.btn-disabled,
.btn-primary:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-icon {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-icon:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    min-height: calc(100vh - 450px);
    padding-bottom: 50px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h2 {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.panel-header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.breadcrumb-path {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: #667eea;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.breadcrumb-item:hover {
    background: rgba(102, 126, 234, 0.2);
}

.breadcrumb-separator {
    color: #666;
    margin: 0 2px;
}

.breadcrumb-current {
    color: #fff;
    font-weight: 500;
    padding: 2px 6px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.panel h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #fff;
    padding-bottom: 10px;
}

.filter-options {
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #a0a0a0;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.repo-list {
    max-height: calc(100vh - 350px);
    overflow-y: auto;
    min-height: 200px;
}

.repo-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: grab;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.repo-item:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.repo-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.repo-item .repo-icon {
    margin-right: 12px;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.repo-item .repo-icon.github-icon {
    width: 20px;
    height: 20px;
    filter: invert(1);
}

.repo-item .repo-info {
    flex: 1;
    min-width: 0;
}

.repo-item .repo-name {
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.repo-name-link {
    color: #7eb8ff;
    text-decoration: none;
    transition: color 0.2s;
}

.repo-name-link:hover {
    color: #a8d4ff;
    text-decoration: underline;
}

.repo-item .repo-description {
    font-size: 12px;
    color: #a0a0a0;
    margin-top: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.repo-item .repo-meta {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

.archived-badge {
    font-size: 11px;
    color: #ffa726;
}

.tree-container {
    min-height: 300px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    border: 2px dashed transparent;
    border-radius: 8px;
    transition: border-color 0.2s, background 0.2s;
    padding-bottom: 60px;
}

.tree-container.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

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

.folder-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.folder-header:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.folder-header.drag-over {
    background: rgba(102, 126, 234, 0.4);
    border-color: #667eea;
}

.folder-header.drag-invalid {
    background: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
    cursor: not-allowed;
}

.folder-toggle {
    margin-right: 8px;
    font-size: 12px;
    width: 20px;
    text-align: center;
    transition: transform 0.2s;
}

.folder-toggle.collapsed {
    transform: rotate(-90deg);
}

.folder-icon {
    margin-right: 8px;
    font-size: 18px;
}

.folder-name {
    flex: 1;
    font-weight: 500;
    color: #fff;
}

.folder-count {
    font-size: 12px;
    color: #888;
    margin-left: 10px;
}

.folder-menu {
    margin-left: auto;
    padding: 4px 8px;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
    border-radius: 4px;
}

.folder-menu:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.folder-header.dragging {
    opacity: 0.5;
    border: 2px dashed #667eea;
}

.folder-content {
    margin-left: 28px;
    padding-left: 15px;
    border-left: 1px dashed rgba(255, 255, 255, 0.1);
    margin-top: 5px;
}

.folder-content.collapsed {
    display: none;
}

.folder-content .repo-item {
    margin-left: 0;
}

.empty-message, .loading {
    text-align: center;
    color: #888;
    padding: 40px 20px;
    font-style: italic;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: #2a2a4a;
    border-radius: 8px;
    padding: 5px 0;
    min-width: 150px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.context-menu.visible {
    display: block;
}

.menu-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item:hover {
    background: rgba(102, 126, 234, 0.3);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.modal.visible {
    display: flex;
}

.modal-content {
    background: #2a2a4a;
    padding: 25px;
    border-radius: 12px;
    min-width: 350px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #fff;
}

.modal-content input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-content input:focus {
    outline: none;
    border-color: #667eea;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* Drag and Drop Visual Feedback */
.drop-zone {
    border: 2px dashed rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    min-height: 100px;
}

.repo-item[draggable="true"]:active {
    cursor: grabbing;
}

/* Language Colors */
.lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

/* Private/Public Badge */
.visibility-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.visibility-badge.private {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.visibility-badge.public {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 20px;
    background: rgba(20, 20, 40, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 12px;
    color: #888;
    z-index: 100;
}

.footer #connectionStatus {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer #connectionStatus::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #888;
}

.footer #connectionStatus.connected::before {
    background: #4caf50;
}

.footer #connectionStatus.error::before {
    background: #f44336;
}