@import url('../../vendor/fonts/inter.css');

:root {
    --brand-color: #0071e3;
    --bg-dark: #000000;
    --card-bg: #1c1c1e;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #0a0a0a;
    color: #f5f5f7;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.toolbar {
    background: linear-gradient(180deg, rgba(28, 28, 30, 0.95) 0%, rgba(20, 20, 22, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #f5f5f7;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

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

.server-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 51, 234, 0.2) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.server-icon svg {
    width: 20px;
    height: 20px;
    color: #3b82f6;
}

.server-name {
    font-weight: 600;
    font-size: 15px;
}

.server-host {
    font-size: 12px;
    color: #9ca3af;
    font-family: 'Monaco', 'Courier New', monospace;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.status-indicator.connecting {
    background: rgba(234, 179, 8, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.status-indicator.connected {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-indicator.disconnected {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-indicator.loading {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-dot.pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}

.ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f5f5f7;
}

.ctrl-btn.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.ctrl-btn.primary {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.ctrl-btn.primary:hover {
    background: rgba(59, 130, 246, 0.25);
}

.vnc-container {
    flex: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#vnc-screen {
    width: 100%;
    height: 100%;
    background: #000;
}

.state-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 10, 0.95);
    z-index: 50;
}

.state-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.state-icon.loading {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 51, 234, 0.2) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.state-icon.disconnected {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.state-icon.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.state-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.state-desc {
    font-size: 14px;
    color: #9ca3af;
    text-align: center;
    max-width: 400px;
    line-height: 1.6;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.retry-btn {
    margin-top: 24px;
    padding: 12px 28px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.retry-btn:hover {
    background: #2563eb;
    transform: scale(1.02);
}

.log-bar {
    background: rgba(20, 20, 22, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 12px;
}

.log-bar.hidden {
    display: none;
}

.log-label {
    color: #4b5563;
    font-weight: 500;
}

.log-message {
    color: #9ca3af;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fullscreen .toolbar,
.fullscreen .log-bar {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.fullscreen:hover .toolbar,
.fullscreen:hover .log-bar {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .toolbar {
        padding: 10px 12px;
    }
    
    .server-info .server-details {
        display: none;
    }
    
    .back-btn span {
        display: none;
    }
    
    .back-btn {
        padding: 8px;
    }
}
