/*body {
   
}*/


.go-button {
    background-color: red;
    color: white;
    width: 140px;
    height: 42px;
}

.go-button:hover {
    background-color: darkred;
    color: white;
}

select[multiple] {
    height: 300px;
}

:root {
    --bg: #f0f4f8;
    --surface: #ffffff;
    --border: #dce3ea;
    --accent: #1a6eb5;
    --accent-light: #e8f1fb;
    --text: #1c2b3a;
    --muted: #7a8fa0;
    --danger: #c0392b;
    --danger-light: #fdf2f1;
    --green: #1e8c5a;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: rgb(144, 213, 225);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── LOADING SCREEN ── */
#loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    padding: 52px 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
    max-width: 400px;
    width: 90%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 4px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#loading-container h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

#loading-container p {
    font-size: 0.85rem;
    color: var(--muted);
}

#status-msg {
    font-size: 0.8rem;
    color: var(--accent);
    min-height: 1.2em;
}

/* ── AVATAR CONTAINER ── */
#avatar-container {
    /* At most 80% of the window height. Larger media seems to affect avatar playback */
    width: min(75vw, calc((80vh - 120px) * 16 / 9));
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    animation: fadeUp 0.35s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* Header */
.session-header {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.session-title {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-dot {
    width: 10px;
    height: 10px;
    background: var(--green);
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

/* Conversation state indicator (set by setConversationState() in loading.html) */
.live-dot.state-listening {
    background: #22c55e;
    animation: blink 2s ease-in-out infinite;
}

.live-dot.state-speaking {
    background: #dc3545;
    animation: blink 1s ease-in-out infinite;
}

.live-dot.state-processing {
    background: #dc3545;
    animation: none;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.35
    }
}

.header-status {
    font-size: 0.75rem;
    color: var(--muted);
}

/* Video */
#mediaElement {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    background: #1a1a1a;
}

/* Controls */
.controls-bar {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--bg);
}

#speak {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 14px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#speak::placeholder {
    color: var(--muted);
}

#speak:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

button {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 9px 18px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

#send {
    background: var(--accent);
    color: #fff;
}

#send:hover {
    background: #155fa0;
}

#end-session {
    background: var(--danger-light);
    border-color: #e8c5c2;
    color: var(--danger);
}

#end-session:hover {
    background: #fae5e3;
}

/* -- Kiosk Screen -- */

label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--label);
    letter-spacing: 0.01em;
}

select,
input[type="text"] {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a8fa0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select:focus,
input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* Submit */
.submit-wrap {
    text-align: center;
    margin-top: 8px;
}

button[type="submit"] {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 48px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background 0.15s, box-shadow 0.15s;
}

button[type="submit"]:hover {
    background: #155fa0;
    box-shadow: 0 4px 12px rgba(26, 110, 181, 0.25);
}