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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
}

header h1 {
    margin-bottom: 20px;
    font-size: 28px;
}

.stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
}

.stat-item.online .stat-value {
    color: #4CAF50;
}

.stat-item.offline .stat-value {
    color: #f44336;
}

.stat-item.unknown .stat-value {
    color: #ff9800;
}

.controls {
    padding: 20px 30px;
    background: #f5f5f5;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-danger:hover {
    background: #c82333;
}

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

.connection-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.online {
    background: #4CAF50;
    box-shadow: 0 0 10px #4CAF50;
}

.status-indicator.offline {
    background: #f44336;
}

.status-indicator.unknown {
    background: #ff9800;
}

.table-container {
    padding: 30px;
    overflow-x: auto;
}

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

thead {
    background: #f8f9fa;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
}

tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.online {
    background: #d4edda;
    color: #155724;
}

.status-badge.offline {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.unknown {
    background: #fff3cd;
    color: #856404;
}

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

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.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;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-large {
    max-width: 1200px;
    max-height: 95vh;
}

.modal-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 22px;
}

.close-btn {
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#vnc-container {
    min-height: 200px;
}

.info-text {
    margin-bottom: 15px;
    line-height: 1.6;
}

.vnc-instructions {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.vnc-instructions h3 {
    margin-bottom: 10px;
}

.vnc-instructions code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

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

.status-indicator.unknown {
    animation: pulse 2s infinite;
}

/* VNC styles */
.vnc-status {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
}

.vnc-status-info {
    background: #d1ecf1;
    color: #0c5460;
}

.vnc-status-success {
    background: #d4edda;
    color: #155724;
}

.vnc-status-error {
    background: #f8d7da;
    color: #721c24;
}

.vnc-status-warning {
    background: #fff3cd;
    color: #856404;
}

#vnc-screen-container {
    position: relative;
    min-height: 400px;
    background: #000;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#vnc-canvas {
    max-width: 100%;
    max-height: 700px;
}

#vnc-password-prompt {
    padding: 20px;
    text-align: center;
}

#vnc-password-prompt p {
    margin-bottom: 15px;
    font-size: 16px;
}

#vnc-password {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    width: 250px;
    margin-right: 10px;
}

#vnc-password:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
