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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f7f7f7;
    color: #1a1a1a;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #000000;
    color: #ffffff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    font-size: 0.9rem;
    opacity: 0.8;
    color: #b0b0b0;
}

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

.sidebar {
    width: 350px;
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.filter-box {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 0.5rem;
    background-color: #fafafa;
    position: relative;
}

.filter-box input {
    flex: 1;
    padding: 0.5rem;
    padding-right: 2.5rem;
    border: 1px solid #d0d0d0;
    border-radius: 2px;
    background-color: #ffffff;
    transition: all 0.2s;
}

.filter-box input:focus {
    outline: none;
    border-color: #666666;
    background-color: #ffffff;
}

.filter-box input:not(:placeholder-shown) {
    background-color: #f0f0f0;
    border-color: #999999;
}

#clearFilterBtn {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem 0.5rem;
    min-width: auto;
    font-size: 1.2rem;
    line-height: 1;
    background: transparent;
    border: none;
    color: #666666;
    cursor: pointer;
    transition: color 0.2s;
    display: none;
}

#clearFilterBtn:hover {
    color: #000000;
    background: transparent;
}

.breadcrumb {
    padding: 0.75rem 1rem;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
}

.breadcrumb-item {
    cursor: pointer;
    color: #404040;
    white-space: nowrap;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: #000000;
    text-decoration: underline;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: #999999;
}

.file-browser {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #fcfcfc;
}

.file-item, .folder-item {
    padding: 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.15s;
    border: 1px solid transparent;
}

.file-item:hover, .folder-item:hover {
    background-color: #f0f0f0;
}

.file-item.selected {
    background-color: #e8e8e8;
    border: 1px solid #cccccc;
}

.folder-item::before {
    content: '▸';
    font-size: 1.2rem;
    color: #666666;
}

.file-item::before {
    content: '◦';
    font-size: 1.2rem;
    color: #999999;
}

.file-info {
    flex: 1;
    overflow: hidden;
}

.file-name {
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #2a2a2a;
}

.file-size {
    font-size: 0.8rem;
    color: #808080;
}

.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

.editor-header {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fafafa;
}

#currentFile {
    font-weight: 400;
    color: #333333;
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
}

#fileEditor {
    flex: 1;
    padding: 1rem;
    border: none;
    resize: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    background-color: #fefefe;
    color: #1a1a1a;
}

/* Login page styles */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
}

.login-box {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 2px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
    border: 1px solid #e0e0e0;
}

.login-box h1 {
    text-align: center;
    color: #000000;
    margin-bottom: 0.5rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.login-box h2 {
    text-align: center;
    color: #666666;
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333333;
    font-weight: 400;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d0d0d0;
    border-radius: 2px;
    font-size: 1rem;
    background-color: #fafafa;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #666666;
    background-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.info-text {
    text-align: center;
    color: #808080;
    font-size: 0.9rem;
    margin-top: 1.5rem;
}

/* Button styles */
.btn {
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #000000;
    color: #ffffff;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #000000;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2a2a2a;
    border-color: #2a2a2a;
}

.btn-secondary {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #cccccc;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #f5f5f5;
    border-color: #999999;
}

.btn-success {
    background-color: #333333;
    color: #ffffff;
    border: 1px solid #333333;
}

.btn-success:hover:not(:disabled) {
    background-color: #555555;
    border-color: #555555;
}

.btn-danger {
    background-color: #ffffff;
    color: #1a1a1a;
    border: 1px solid #999999;
}

.btn-danger:hover:not(:disabled) {
    background-color: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}

/* Messages */
.error-message {
    background-color: #f5f5f5;
    color: #1a1a1a;
    padding: 0.75rem 1rem;
    border-radius: 2px;
    margin-bottom: 1rem;
    border: 1px solid #999999;
    border-left: 3px solid #1a1a1a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease-out;
}

.success-message {
    background-color: #f0f0f0;
    color: #1a1a1a;
    padding: 0.75rem 1rem;
    border-radius: 2px;
    margin-bottom: 1rem;
    border: 1px solid #cccccc;
    border-left: 3px solid #666666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease-out;
}

.loading-message {
    background-color: #fafafa;
    color: #333333;
    padding: 0.75rem 1rem;
    border-radius: 2px;
    margin-bottom: 1rem;
    border: 1px solid #d0d0d0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

.message-icon {
    font-size: 1.2rem;
    filter: grayscale(100%);
}

.loading {
    text-align: center;
    color: #666666;
    padding: 2rem;
}

.empty-state {
    text-align: center;
    color: #999999;
    padding: 2rem;
    font-style: italic;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #333333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.inline-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #666666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay-content {
    background: #ffffff;
    padding: 2rem;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.loading-overlay-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #333333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
    font-size: 0.85rem;
    background-color: #f5f5f5;
    border: 1px solid #d0d0d0;
    color: #333333;
}

.status-indicator.connecting {
    background-color: #f5f5f5;
    color: #666666;
}

.status-indicator.connected {
    background-color: #f0f0f0;
    color: #1a1a1a;
}

.status-indicator.error {
    background-color: #fafafa;
    color: #333333;
    border-color: #999999;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.connecting {
    background-color: #999999;
}

.status-dot.connected {
    background-color: #333333;
}

.status-dot.error {
    background-color: #666666;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
    }
}

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

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999999;
}

/* Focus styles */
*:focus-visible {
    outline: 2px solid #666666;
    outline-offset: 2px;
}

/* Toolbar */
.toolbar {
    padding: 0.75rem 1rem;
    background-color: #fafafa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 0.5rem;
}

.toolbar .btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: #ffffff;
    padding: 2rem;
    border-radius: 2px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    font-weight: 400;
    color: #1a1a1a;
}

.modal-content input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d0d0d0;
    border-radius: 2px;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    background-color: #fafafa;
}

.modal-content input:focus {
    outline: none;
    border-color: #666666;
    background-color: #ffffff;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.modal-actions .btn {
    min-width: 80px;
}

/* File item context menu */
.file-item {
    position: relative;
}

.file-item-actions {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    gap: 0.25rem;
}

.file-item:hover .file-item-actions {
    display: flex;
}

.file-action-btn {
    padding: 0.25rem 0.5rem;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 2px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.file-action-btn:hover {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}