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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

h1 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* Header */
.header {
    background: white;
    border-radius: 12px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    margin: 0;
}

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

.user-info span {
    color: #666;
    font-weight: 500;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

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

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

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

.btn-danger:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.button-group .btn {
    flex: 1;
}

/* Status */
.status-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 600;
}

.status-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dc3545;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
    animation: pulse 2s infinite;
}

.status-dot.active {
    background: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

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

.status-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-item {
    color: #555;
}

.info-item strong {
    color: #333;
}

/* Restart Alert */
.restart-alert {
    background: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Messages */
.error-message {
    color: #dc3545;
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
}

.message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

/* Logs */
.logs-container {
    max-height: 300px;
    overflow-y: auto;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.logs-container .no-logs {
    color: #888;
    text-align: center;
}

.log-entry {
    margin-bottom: 8px;
    padding: 5px;
    border-left: 3px solid #667eea;
    padding-left: 10px;
}

.log-entry.error {
    border-left-color: #dc3545;
    color: #ff6b6b;
}

.log-entry.info {
    border-left-color: #17a2b8;
    color: #4fc3f7;
}

.log-time {
    color: #888;
    font-size: 11px;
}

/* VNC Viewer */
.vnc-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vnc-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.vnc-viewer-header h2 {
    margin: 0;
}

.vnc-viewer-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

#vnc-fullscreen-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

#vnc-fullscreen-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.vnc-viewer-container {
    width: 100%;
    height: 600px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

#vnc-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Modal VNC Fullscreen */
.vnc-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.vnc-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.vnc-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.vnc-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10001;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    transition: all 0.3s ease;
}

.vnc-modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.6);
}

#vnc-modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive */
@media (max-width: 600px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .status-info {
        grid-template-columns: 1fr;
    }
}
