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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    line-height: 1.6;
}

.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #fff, #ddd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: rgba(255, 255, 255, 0.8);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover:not(:disabled) {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #0da271;
    transform: translateY(-2px);
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #e6900a;
    transform: translateY(-2px);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none !important;
    background: inherit !important;
}

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

.sidebar {
    width: 250px;
    background: #2d3748;
    border-right: 1px solid #4a5568;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #4a5568;
}

.sidebar-header h2 {
    color: #667eea;
    font-size: 1.5em;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #cbd5e0;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #4a5568;
    color: #ffffff;
}

.nav-item.active {
    background: #667eea;
    color: #ffffff;
    border-left-color: #ffffff;
}

.nav-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1a202c;
}

.top-bar {
    background: #2d3748;
    padding: 15px 20px;
    border-bottom: 1px solid #4a5568;
    display: flex;
    justify-content: flex-end;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.page-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #4a5568;
}

.page-header h3 {
    color: #667eea;
    font-size: 1.5em;
}

.server-controls,
.file-controls {
    display: flex;
    gap: 10px;
}

.server-controls .btn {
    transition: all 0.3s ease;
}

.server-controls .btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.console-container {
    background: #000000;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #4a5568;
}

.console-output {
    height: 500px;
    overflow-y: auto;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
}

.console-line {
    margin-bottom: 2px;
    word-wrap: break-word;
}

.console-line.info { color: #ffffff; }
.console-line.warning { color: #f59e0b; }
.console-line.error { color: #ef4444; }
.console-line.success { color: #10b981; }
.console-line.command { color: #f59e0b; font-weight: bold; }

.timestamp {
    color: #718096;
    font-size: 0.8em;
    margin-right: 8px;
}

.console-input-container {
    display: flex;
    border-top: 1px solid #4a5568;
}

.console-input-container input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    background: #2d3748;
    color: #ffffff;
    font-family: 'Courier New', monospace;
}

.console-input-container input:focus {
    outline: none;
}

.breadcrumb {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #2d3748;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #4a5568;
}

.breadcrumb-item {
    color: #667eea;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.breadcrumb-item:hover {
    background: #4a5568;
}

.breadcrumb-separator {
    margin: 0 10px;
    color: #718096;
}

.files-list {
    background: #2d3748;
    border-radius: 0 0 8px 8px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #4a5568;
    cursor: pointer;
    transition: background 0.3s ease;
}

.file-item:hover {
    background: #4a5568;
}

.file-item:last-child {
    border-bottom: none;
}

/* Files loading overlay */
.files-loading-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.circular-loader svg { width: 48px; height: 48px; }
.circular-loader .circle { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 4; stroke-linecap: round; }

/* File operation progress overlay */
.file-progress-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
}

.progress-card {
    background: #2d3748;
    border: 1px solid #4a5568;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.circular-progress svg { width: 96px; height: 96px; }
.circular-progress .bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 4; }
.circular-progress .progress { fill: none; stroke: #667eea; stroke-width: 4; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.progress-text { position: relative; margin-top: -68px; font-weight: 700; color: #ffffff; }
.progress-label { color: #cbd5e0; font-size: 14px; }

.file-icon {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: #667eea;
}

.file-name {
    flex: 1;
    color: #ffffff;
}

.file-size {
    color: #718096;
    font-size: 12px;
    margin-right: 15px;
}

.file-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.file-action {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.file-action:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.users-container {
    background: #2d3748;
    border-radius: 8px;
    overflow: hidden;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #4a5568;
}

.users-table th {
    background: #4a5568;
    color: #667eea;
    font-weight: 600;
}

.users-table tr:hover {
    background: #4a5568;
}

.user-type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.user-type-badge.owner {
    background: #ef4444;
    color: white;
}

.user-type-badge.admin {
    background: #f59e0b;
    color: white;
}

.permissions-summary {
    font-size: 12px;
    color: #cbd5e0;
}

.user-actions {
    display: flex;
    gap: 5px;
}

/* Settings Page Styles */
.settings-section {
    background: #2d3748;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #4a5568;
}

.settings-section h4 {
    color: #667eea;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #4a5568;
}

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

.settings-section .btn {
    margin-top: 10px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #2d3748;
    margin: 5% auto;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid #4a5568;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #4a5568;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h4 {
    color: #667eea;
    flex: 1;
}

.close {
    color: #718096;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #4a5568;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.file-editor {
    width: 100%;
    height: 400px;
    background: #1a202c;
    color: #ffffff;
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
}

.permissions-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.permissions-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #4a5568;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.permissions-list label:hover {
    background: #667eea;
}

.message {
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
}

.file-info {
    color: #718096;
    font-size: 12px;
    margin-top: 10px;
    font-style: italic;
}

.message.success {
    background: #10b981;
    color: white;
}

.message.error {
    background: #ef4444;
    color: white;
}

.message.warning {
    background: #f59e0b;
    color: white;
}

.context-menu {
    position: absolute;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 5px 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.context-menu-item {
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.3s ease;
    color: #ffffff;
}

.context-menu-item:hover {
    background: #667eea;
}

.context-menu-item i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2d3748;
}

::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #667eea;
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
    }
    
    .nav-item {
        flex-shrink: 0;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .server-controls,
    .file-controls {
        width: 100%;
        justify-content: center;
    }
    
    .permissions-list {
        grid-template-columns: 1fr;
    }
    
    .settings-section {
        padding: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}