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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

#status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

#status {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

#status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

#status.connected::before {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

#status.connecting::before {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
    animation: pulse 2s infinite;
}

#status.disconnected::before {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

#status.connected {
    color: #10b981;
}

#status.connecting {
    color: #f59e0b;
}

#status.disconnected {
    color: #ef4444;
}

#controls {
    display: flex;
    gap: 12px;
}

button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

button:hover:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

button:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

button:disabled {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

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

#remote-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000000;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
}

.spinner {
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

#loading p {
    color: #9ca3af;
    font-size: 16px;
    font-weight: 500;
}

#error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(239, 68, 68, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 24px 32px;
    border-radius: 12px;
    text-align: center;
    z-index: 200;
    max-width: 80%;
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hidden {
    display: none !important;
}

#info-panel {
    position: absolute;
    top: 70px;
    right: 20px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    font-size: 12px;
    max-width: 320px;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

#info-panel h3 {
    margin-bottom: 16px;
    font-size: 14px;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#connection-stats {
    line-height: 1.8;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 4px 0;
}

.stat-label {
    color: #9ca3af;
}

.stat-value {
    color: #ffffff;
    font-weight: 600;
}

/* Terminal Panel */
#terminal-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40vh;
    background: rgba(15, 15, 35, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 12px;
}

#terminal-panel.hidden {
    display: none;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(26, 26, 46, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-header h3 {
    color: #9ca3af;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.terminal-close-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.terminal-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

#terminal-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    color: #10b981;
    line-height: 1.6;
}

#terminal-content::-webkit-scrollbar {
    width: 8px;
}

#terminal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

#terminal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#terminal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.terminal-line {
    margin-bottom: 4px;
    word-wrap: break-word;
}

.terminal-line.info {
    color: #3b82f6;
}

.terminal-line.success {
    color: #10b981;
}

.terminal-line.warning {
    color: #f59e0b;
}

.terminal-line.error {
    color: #ef4444;
}

.terminal-line.debug {
    color: #9ca3af;
}

.terminal-timestamp {
    color: #6b7280;
    margin-right: 8px;
}

/* Fullscreen styles */
body:fullscreen #status-bar,
body:-webkit-full-screen #status-bar,
body:-moz-full-screen #status-bar {
    display: none;
}

body:fullscreen #video-container,
body:-webkit-full-screen #video-container,
body:-moz-full-screen #video-container {
    height: 100vh;
    cursor: none !important; /* Hide cursor in fullscreen */
}

body:fullscreen #terminal-panel,
body:-webkit-full-screen #terminal-panel,
body:-moz-full-screen #terminal-panel {
    display: none;
}

/* Hide cursor when pointer is locked (like GeForce Now) */
body:fullscreen #remote-video,
body:-webkit-full-screen #remote-video,
body:-moz-full-screen #remote-video {
    cursor: none !important;
}

/* Ensure video container hides cursor in fullscreen */
#video-container:fullscreen,
#video-container:-webkit-full-screen,
#video-container:-moz-full-screen {
    cursor: none !important;
}
