/* Gabut Remote — Web Client Styles */

:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: rgba(20, 20, 45, 0.85);
    --bg-card-border: rgba(100, 100, 255, 0.12);
    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --text-muted: #5a5a7a;
    --accent: #4ade80;
    --accent-hover: #22c55e;
    --accent-glow: rgba(74, 222, 128, 0.25);
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== LOGIN PAGE ===== */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(80px);
    pointer-events: none;
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    animation: cardIn 0.5s ease-out;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.logo-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.input-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 45px;
}

.toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toggle-pass:hover {
    opacity: 1;
}

.btn-connect {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.btn-connect:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-connect:active {
    transform: translateY(0);
}

.btn-connect:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-msg {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 13px;
    text-align: center;
}

.login-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.login-footer .separator {
    margin: 0 8px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--accent);
}

/* ===== SESSION PAGE ===== */

.session-body {
    margin: 0;
    background: #000;
    overflow: hidden;
    height: 100vh;
}

.session-video {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    display: none;
}

/* Status Bar */
.status-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 16px;
    display: none;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    font-size: 13px;
    transition: opacity 0.3s;
}

.status-bar:hover {
    opacity: 1;
}

.status-bar .brand {
    font-weight: 600;
    color: var(--accent);
    font-size: 14px;
}

.stats-overlay {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
}

.stats-overlay .stat-value {
    color: var(--accent);
    font-weight: 500;
}

.status-text {
    color: var(--text-secondary);
}

.toolbar {
    display: flex;
    gap: 6px;
}

.toolbar button {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    transition: var(--transition);
    white-space: nowrap;
}

.toolbar button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.15);
}

.toolbar .btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ff6b6b;
}

.toolbar .btn-danger:hover {
    background: rgba(239, 68, 68, 0.35);
}

.toolbar .btn-active {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(255, 0, 0, 0.5);
    color: #ff4444;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
}

/* Connect Overlay */
.connect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a1a, #12122a);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.connect-overlay .icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.connect-overlay h2 {
    font-weight: 400;
    margin-bottom: 8px;
}

.connect-overlay .desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.connect-overlay .debug-log {
    width: 400px;
    max-width: 90vw;
    height: 120px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    color: var(--accent);
}

.debug-log div {
    padding: 1px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* File Panel */
.file-panel {
    position: fixed;
    top: 46px;
    left: 12px;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    padding: 12px;
    display: none;
    max-height: 75vh;
    min-width: 320px;
    overflow-y: auto;
    z-index: 900;
    box-shadow: var(--shadow-lg);
}

.file-panel .file-header {
    font-weight: 600;
    font-size: 13px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
    color: var(--accent);
}

.file-item {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Upload Overlay */
.upload-overlay {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    padding: 16px;
    width: 320px;
    z-index: 2000;
    display: none;
    box-shadow: var(--shadow-lg);
}

.upload-overlay .upload-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.upload-overlay .upload-filename {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 200px;
}

.upload-overlay .upload-percent {
    color: var(--accent);
    font-weight: 600;
}

.progress-bar-bg {
    background: rgba(255, 255, 255, 0.08);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    height: 100%;
    width: 0%;
    transition: width 0.2s;
}

.upload-overlay .btn-cancel {
    margin-top: 10px;
    width: 100%;
    padding: 8px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ff6b6b;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 9999;
    display: none;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg);
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
    }

    .connect-overlay .debug-log {
        width: 90vw;
    }

    .toolbar button {
        padding: 6px 8px;
        font-size: 11px;
    }

    .stats-overlay {
        display: none;
    }
}

/* Version badge */
.version {
    font-family: monospace;
    font-size: 11px;
}

/* ===== Shell Terminal Panel ===== */
.shell-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40vh;
    background: rgba(13, 17, 23, 0.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--bg-card-border);
    z-index: 950;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.shell-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

.shell-close {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ff6b6b;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 8px;
    font-family: inherit;
}

.shell-close:hover {
    background: rgba(239, 68, 68, 0.4);
}

#shell-terminal {
    flex: 1;
    padding: 4px;
    overflow: hidden;
}

/* ===== QoS / Monitor Dropdowns ===== */
.qos-dropdown,
.monitor-dropdown {
    position: fixed;
    top: 46px;
    right: 100px;
    background: rgba(10, 10, 26, 0.97);
    backdrop-filter: blur(12px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    padding: 8px;
    z-index: 1100;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    animation: fadeIn 0.15s ease-out;
}

.monitor-dropdown {
    right: 160px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qos-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    padding: 4px 8px 8px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
}

.qos-option {
    display: block;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.qos-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ===== Trusted Devices Panel ===== */
.trust-panel {
    position: fixed;
    top: 46px;
    right: 12px;
    background: rgba(10, 10, 26, 0.97);
    backdrop-filter: blur(12px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    z-index: 950;
    box-shadow: var(--shadow-lg);
    min-width: 340px;
    max-height: 60vh;
    overflow-y: auto;
    animation: fadeIn 0.15s ease-out;
}

.trust-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

.trust-list {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.trust-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.trust-item:last-child {
    border-bottom: none;
}

.trust-info {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}

.trust-info small {
    color: var(--text-secondary);
}

/* ===== Download Progress Bar ===== */
.download-progress {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 26, 0.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--bg-card-border);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    z-index: 1000;
    font-size: 12px;
}

.download-name {
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.download-percent {
    color: var(--accent);
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

/* ===== Generic btn-danger outside toolbar ===== */
.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ff6b6b;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    padding: 8px;
    transition: var(--transition);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.35);
}