/* Go Live page — extends watch.css with broadcast-setup styles */

#view-golive .view-scroll { max-width: 760px; }

.gl-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
}
.gl-card h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 14px; }

.gl-card input[type="text"],
.gl-card textarea,
.gl-key-row input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.95rem;
}
.gl-card textarea { resize: vertical; }
.gl-card input:focus, .gl-card textarea:focus { outline: none; border-color: var(--primary-color); }

.gl-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    color: var(--text-gray);
    cursor: pointer;
    margin-bottom: 6px;
}
.gl-check input { accent-color: var(--primary-color); width: 16px; height: 16px; }

.gl-hint { font-size: 0.9rem; color: var(--text-gray); line-height: 1.5; margin-bottom: 14px; }
.gl-hint strong { color: var(--text-light); }

/* Mode tabs */
.gl-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.gl-tab {
    flex: 1;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: var(--text-gray);
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.gl-tab:hover { color: var(--text-light); }
.gl-tab.active {
    color: var(--text-light);
    border-color: var(--primary-color);
    background: rgba(0, 168, 255, 0.12);
}

/* Device pickers */
.gl-device-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.gl-device-row label {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 600;
}
.gl-device-row select {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--dark-bg);
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.9rem;
}

/* Input level meter */
.gl-meter {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin: 10px 0 6px;
}
.gl-meter-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    background: linear-gradient(90deg, #2ecc71 0%, #f1c40f 70%, #ff4d6d 95%);
    transition: width 0.05s linear;
}
.gl-channels { font-size: 0.8rem; color: var(--text-gray); margin-bottom: 10px; }

#glPreview {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    background: #000;
    display: block;
}

/* Setup preview with vertical-crop guides: for a 16:9 camera in a 9:16 frame,
   the visible center slice is (9/16)/(16/9) ≈ 31.6% of the width. */
.gl-preview-wrap { position: relative; }
.gl-crop-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 34.2%;
    background: rgba(5, 8, 20, 0.65);
    pointer-events: none;
}
.gl-crop-left { left: 0; border-radius: var(--radius) 0 0 var(--radius); border-right: 1px dashed rgba(255, 255, 255, 0.5); }
.gl-crop-right { right: 0; border-radius: 0 var(--radius) var(--radius) 0; border-left: 1px dashed rgba(255, 255, 255, 0.5); }

/* Live broadcast preview is the actual 9:16 output canvas */
#glCanvas {
    aspect-ratio: 9 / 16;
    width: auto;
    max-width: 100%;
    max-height: 68vh;
    margin: 0 auto;
    border-radius: var(--radius);
    background: #000;
    display: block;
}

/* Live header */
.gl-live-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.gl-live-title { font-weight: 700; font-size: 1.05rem; }
.gl-status {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.gl-status.is-waiting { background: rgba(255, 255, 255, 0.1); color: var(--text-gray); }
.gl-status.is-live {
    background: #ff4d6d;
    color: #fff;
    animation: pulse 1.8s ease-out infinite;
}

.gl-live-actions { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }

.btn-danger {
    background: #ff4d6d;
    color: #fff;
    border: none;
}
.btn-danger:hover { background: #e63c5b; }

/* Server / stream key rows */
.gl-key-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.gl-key-row label { width: 90px; flex-shrink: 0; font-size: 0.85rem; font-weight: 700; color: var(--text-gray); }
.gl-key-row input { flex: 1; margin-bottom: 0; font-size: 0.85rem; }
.gl-key-warning { margin-top: 4px; margin-bottom: 0; color: #f1c40f; }

.gl-settings-list { list-style: disc; padding-left: 20px; color: var(--text-gray); font-size: 0.9rem; line-height: 1.7; }

#glStartBtn { margin-top: 4px; }
#glError { margin-top: 12px; }
