/* ShadowDesk — Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    overflow: hidden;
    height: 100vh;
}

/* ===== Login Page ===== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 48px 40px;
    width: 380px;
    text-align: center;
}

.login-title {
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #4a9eff;
}

.form-group input::placeholder {
    color: #666;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #4a9eff;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #3a8eef;
}

.error-text {
    color: #ff6b6b;
    font-size: 13px;
    margin-top: 12px;
}

/* ===== App Page ===== */
.app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #000;
}

/* Toolbar */
.toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 13px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
    gap: 12px;
}

.toolbar:hover, .toolbar.visible {
    opacity: 1;
}

/* Show toolbar on mouse near top */
.app-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    z-index: 99;
}

.app-container:hover .toolbar {
    opacity: 1;
}

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

.status-dot.online { background: #4caf50; }
.status-dot.offline { background: #f44336; }

.toolbar-divider { color: #444; }
.toolbar-spacer { flex: 1; }

.toolbar-btn {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #ddd;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.toolbar-btn:hover { background: rgba(255, 255, 255, 0.2); }
.toolbar-btn.danger { border-color: #f44336; color: #f44336; }
.toolbar-btn.danger:hover { background: rgba(244, 67, 54, 0.2); }

/* Device Panel */
.device-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px;
    min-width: 320px;
    z-index: 50;
}

.device-panel h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #fff;
}

.device-list {
    list-style: none;
}

.device-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.device-name { font-weight: 500; flex: 1; }
.device-id { font-size: 12px; color: #666; }

.btn-connect {
    padding: 6px 16px;
    background: #4a9eff;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.btn-connect:hover { background: #3a8eef; }

/* Remote Video */
.remote-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.overlay-content {
    text-align: center;
    color: #fff;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #4a9eff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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