* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #4CAF50;
    --danger: #f44336;
    --warning: #ff9800;
    --dark: #424242;
    --info: #2196F3;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    padding: 15px 25px;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 5px;
    padding: 0 15px;
}

.nav-links a {
    padding: 15px 20px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-header h1 {
    color: #333;
    font-size: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badges {
    display: flex;
    gap: 10px;
}

.status-badge {
    background: #f5f5f5;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.status-badge i {
    font-size: 10px;
}

.status-badge.online i {
    color: var(--success);
    animation: pulse 2s infinite;
}

.status-badge.offline i {
    color: var(--danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Cards */
.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-dark { background: var(--dark); color: white; }
.btn-info { background: var(--info); color: white; }
.btn-secondary { background: #757575; color: white; }

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Control Buttons */
.control-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Server Info */
.server-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.server-info p {
    margin: 8px 0;
    color: #555;
}

.state-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.state-badge.running { background: var(--success); color: white; }
.state-badge.offline { background: var(--danger); color: white; }
.state-badge.starting { background: var(--warning); color: white; }
.state-badge.stopping { background: var(--warning); color: white; }

/* Progress Bars */
.progress-bar, .progress-bar-large {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar-large {
    height: 30px;
}

.progress-fill {
    height: 100%;
    background: var(--bg-gradient);
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* Info List */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
}

.info-label {
    color: #666;
    font-weight: 600;
}

.info-value {
    color: #333;
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
}

.login-header h1 {
    color: #333;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
}

.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #555;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.error-message {
    background: #ffebee;
    color: var(--danger);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.login-footer {
    text-align: center;
    color: #888;
    font-size: 13px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.stats-grid {
    display: grid;
    gap: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

.stat-icon {
    font-size: 32px;
    color: var(--primary);
}

.stat-info {
    flex: 1;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.stat-value {
    color: #333;
    font-size: 20px;
    font-weight: bold;
}

.quick-actions {
    display: grid;
    gap: 10px;
}

.action-btn {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateX(5px);
}

.action-btn i {
    font-size: 24px;
}

/* Console */
.console-page {
    height: calc(100vh - 200px);
}

.console-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.console-toolbar {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.console-info {
    margin-left: auto;
    color: #666;
    font-size: 13px;
}

.console-container {
    flex: 1;
    background: #1e1e1e;
    overflow: hidden;
}

.console-output {
    height: 100%;
    overflow-y: auto;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #d4d4d4;
}

.console-line {
    margin: 4px 0;
    line-height: 1.5;
}

.console-line.info { color: #4FC3F7; }
.console-line.warning { color: #FFB74D; }
.console-line.error { color: #E57373; }
.console-line.success { color: #81C784; }

.console-input-container {
    display: flex;
    padding: 15px 20px;
    background: #252526;
    border-top: 1px solid #3e3e3e;
}

.console-input {
    flex: 1;
    background: #1e1e1e;
    border: 1px solid #3e3e3e;
    color: #d4d4d4;
    padding: 10px;
    font-family: 'Courier New', monospace;
    border-radius: 4px;
    margin-right: 10px;
}

.console-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* File Manager */
.file-manager {
    min-height: 500px;
}

.file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.file-path {
    background: #f9f9f9;
    padding: 10px 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #555;
    flex: 1;
    min-width: 200px;
}

.file-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.file-list {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    max-height: 600px;
    overflow-y: auto;
}

.file-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.2s;
}

.file-item:hover {
    background: #f9f9f9;
}

.file-item:last-child {
    border-bottom: none;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.file-icon {
    width: 24px;
    text-align: center;
    color: var(--primary);
}

.file-name {
    font-weight: 500;
    color: #333;
}

.file-size {
    color: #888;
    font-size: 12px;
    margin-left: 10px;
}

.file-actions-btn {
    display: flex;
    gap: 8px;
}

.file-loading {
    padding: 40px;
    text-align: center;
    color: #888;
}

.file-editor {
    width: 100%;
    min-height: 400px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
}

/* Monitoring */
.monitoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.monitor-display {
    padding: 10px 0;
}

.monitor-value-large {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.monitor-percentage {
    text-align: right;
    color: #666;
    font-size: 14px;
    margin-top: 8px;
}

.network-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.network-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    font-size: 16px;
}

.network-stat strong {
    margin-left: auto;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        flex-wrap: wrap;
        padding: 0 10px;
    }
    
    .nav-links a {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .dashboard-grid,
    .monitoring-grid {
        grid-template-columns: 1fr;
    }
    
    .control-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .file-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .file-actions {
        width: 100%;
    }
}
