/* Invisible-RD Web Client Styles */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #14141f;
    --bg-tertiary: #1e1e2e;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --border: #27272a;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

#app {
    width: 100vw;
    height: 100vh;
}

.screen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* Connect Screen */
.connect-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.connect-form h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.capabilities {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.capability {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.capability.supported {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.capability.unsupported {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

button[type="submit"] {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 500;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

button[type="submit"]:hover {
    background: var(--accent-hover);
}

button[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.error {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: var(--error);
    font-size: 0.875rem;
}

/* Desktop Screen */
#desktop-screen {
    flex-direction: column;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    height: 48px;
    flex-shrink: 0;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.connection-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.connection-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    background: var(--warning);
}

.connection-status.connected::before {
    background: var(--success);
}

.connection-status.disconnected::before {
    background: var(--error);
}

.toolbar button {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.toolbar button:hover {
    background: var(--border);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.volume-control input[type="range"] {
    width: 80px;
    height: 4px;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    cursor: pointer;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
}

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

#remote-canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#remote-canvas:focus {
    outline: none;
}

.stats-overlay {
    position: fixed;
    top: 60px;
    left: 10px;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stats-overlay div {
    margin-bottom: 0.25rem;
}

.stats-overlay div:last-child {
    margin-bottom: 0;
}

/* Fullscreen mode */
:fullscreen .toolbar {
    display: none;
}

:fullscreen .canvas-container {
    width: 100vw;
    height: 100vh;
}

/* Loading state */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
    .connect-form {
        margin: 1rem;
        padding: 1.5rem;
    }

    .toolbar {
        flex-wrap: wrap;
        height: auto;
        padding: 0.5rem;
    }

    .toolbar-center {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
}

/* Auth + signed-in additions */
.connect-form {
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.auth-tabs {
    display: flex;
    gap: 0.25rem;
    margin: 1rem 0 1.25rem;
    padding: 0.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.auth-tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: var(--text-secondary);
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.auth-tab:hover { color: var(--text-primary); }
.auth-tab.active {
    background: var(--accent);
    color: white;
}

.form-hint {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.auth-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}
.auth-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}
.auth-footer a:hover { color: var(--accent-hover); }

.link-button {
    background: transparent;
    color: var(--text-secondary);
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 0.8125rem;
    padding: 0;
}
.link-button:hover { color: var(--accent-hover); }

.card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-top: 1rem;
}
.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.card-body {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.meeting-result {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.6;
}
.meeting-result .muted {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}
.meeting-result code {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-hover);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.8125rem;
}
