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

:root {
    --header-height: 60px;
    --header-bg: linear-gradient(90deg, #1e3c72, #102343);
    --header-border: #102343;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #102343;
    color: #eaeaea;
    overflow: hidden;
    min-height: 100vh;
}

/* STREAMING ONLY: turn header into white frosted glass */
body.streaming .header {
  background: rgba(255, 255, 255, 0.05);   /* was 0.16 */
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

body.streaming .header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.14),
    rgba(255,255,255,0.02)
  );
}

/* STREAMING ONLY: title becomes dark so it’s readable on a white glass header */
body.streaming .header .title {
  color: rgba(15, 23, 42, 0.92);
  text-shadow: none;
}

/* STREAMING ONLY: controls match the light header (optional but looks consistent) */
body.streaming #controls button {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.55);
  color: rgba(15, 23, 42, 0.92);
}

/* STREAMING ONLY: keep danger button “danger-y” on light background */
body.streaming #controls button.danger {
  background: rgba(255, 68, 68, 0.18);
  border-color: rgba(255, 68, 68, 0.35);
  color: rgba(125, 0, 0, 0.92);
}


/* body.streaming .header {
    background: rgba(255, 255, 255, 0.16);
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    box-shadow: 0 6px 20px rgba(7, 12, 24, 0.25);
}

body.streaming .header .title {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(5, 10, 20, 0.5);
}

body.streaming #controls button {
    background: rgba(12, 20, 34, 0.45);
    border-color: rgba(255, 255, 255, 0.22);
} */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 1000;
}

.header .title {
    margin-left: 0.5rem;
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffffff;
    text-transform: uppercase;
    pointer-events: none;
    font-family: 'Roboto', monospace;
    grid-column: 1;
}

#streamContainer {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: #102343;
}

body.streaming #streamContainer {
  top: 0;
}

#statusOverlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    max-width: 600px;
    width: 80%;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%);
        opacity: 1;
    }
}

#statusTitle {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #eaeaea;
}

#streamStatus {
    font-size: 0.95rem;
    color: #eaeaea;
    margin: 0;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

h4.error {
    color: #ff4444;
}

.error-message {
    color: #ffaaaa;
    margin: 1rem 0;
}

.retry-btn {
    margin-top: 1rem;
    padding: 0.75rem 2rem;
    background: #ff9900;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.retry-btn:hover {
    background: #cc7700;
}

#streamVideo {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#streamAudio {
    display: none;
}

#controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    grid-column: 2;
}

#controls button {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

#controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#controls button:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

#controls button.danger {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.3);
}

#controls button.danger:not(:disabled):hover {
    background: rgba(255, 68, 68, 0.3);
}

#controls button svg {
    width: 16px;
    height: 16px;
}

/* Fullscreen video styling */
#streamContainer:fullscreen video,
#streamContainer:-webkit-full-screen video,
#streamContainer:-moz-full-screen video,
#streamContainer:-ms-fullscreen video {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
}

/* Hide cursor in fullscreen */
#streamContainer:fullscreen {
    cursor: none;
}

/* Hide header in fullscreen */
body:has(#streamContainer:fullscreen) .header {
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

/* Show header on hover in fullscreen */
body:has(#streamContainer:fullscreen:hover) .header {
    opacity: 1;
    pointer-events: all;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #statusOverlay {
        min-width: 90%;
    }

    .header .title {
        font-size: 1.2rem;
    }

    #controls {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    #controls button {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    #controls button svg {
        width: 14px;
        height: 14px;
    }
}

/* Termination Screen Styles - matching custom_502.html */
.icon-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.session-ended-title {
    color: #eaeaea;
    font-size: 32px;
    margin-bottom: 20px;
    font-weight: 600;
}

.session-ended-message {
    color: #b0b0b0;
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 12px;
}

.session-ended-reasons {
    color: #b0b0b0;
    font-size: 16px;
    line-height: 1.7;
    margin: 0 0 40px;
    padding-left: 1.2rem;
    text-align: left;
}

.session-ended-reasons li {
    margin: 6px 0;
}

.info-box {
    background: rgba(134, 110, 241, 0.1);
    border: 1px solid rgba(134, 110, 241, 0.3);
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
    text-align: left;
}

.info-box-title {
    color: #866EF1;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(134, 110, 241, 0.2);
    color: #d0d0d0;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-list li:last-child {
    border-bottom: none;
}

.portal-button {
    margin-top: 30px;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.portal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.portal-button:active {
    transform: translateY(0);
}
