/* hidden attribute must win over any display rule below */
[hidden] {
    display: none !important;
}

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

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

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #333;
    margin-bottom: 24px;
}

header h1 {
    font-size: 1.5rem;
    color: #3498db;
}

.store-badge {
    background: #2ecc71;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#video-container {
    position: relative;
    width: 640px;
    max-width: 100%;
    min-height: 360px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

#remote-container {
    width: 100%;
    min-height: 360px;
}

#remote-container video.remote-video {
    display: block;
    width: 100%;
    height: 360px;
    object-fit: contain;
    background: #000;
}

#local-video {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 180px;
    max-width: 35%;
    border-radius: 8px;
    border: 2px solid #2ecc71;
    background: #000;
    z-index: 2;
}

/* --- Device login --- */

#login-section {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 24px;
    padding: 24px;
    background: #16213e;
    border: 1px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#login-section h2 {
    font-size: 1.25rem;
    color: #3498db;
    text-align: center;
}

#login-section p {
    font-size: 0.9rem;
    color: #bbb;
    text-align: center;
}

#login-section input {
    padding: 10px 12px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #1a1a2e;
    color: #eee;
    font-size: 1rem;
}

/* Must win over the display:flex rule above when the attribute is present
   (the top-of-file [hidden] rule already carries !important; this is an
   explicit backstop so the login form never renders for logged-in devices). */
#login-section[hidden] {
    display: none;
}

#btn-device-login {
    background: #3498db;
    color: #fff;
}

#btn-device-login:hover {
    background: #2980b9;
}

#status {
    font-size: 1rem;
    padding: 8px 16px;
    background: #16213e;
    border-radius: 4px;
}

#queue-status {
    font-size: 1.05rem;
    padding: 8px 16px;
    background: #16213e;
    border-radius: 4px;
    color: #f39c12;
}

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

button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

#btn-call {
    background: #e67e22;
    color: #fff;
}

#btn-call:hover {
    background: #d35400;
}

#btn-call:disabled {
    background: #555;
    cursor: not-allowed;
}

#btn-end {
    background: #e74c3c;
    color: #fff;
}

#btn-end:hover {
    background: #c0392b;
}

#btn-call-again {
    background: #3498db;
    color: #fff;
}

#btn-call-again:hover {
    background: #2980b9;
}
