/* Dental Interview — LiveKit interview scene styles v1.3 */

#di-livekit-app {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    max-width: 100%;
    margin: 0 auto 2rem;
}

/* --- Stage: full-bleed interviewer view + PiP self view --- */

.di-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0f172a;
    border-radius: 16px;
    overflow: hidden;
}

.di-tile {
    position: absolute;
    inset: 0;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.di-tile--ai {
    background:
        radial-gradient(ellipse at 50% 30%, rgba(13, 148, 136, 0.18) 0%, transparent 60%),
        linear-gradient(135deg, #134e4a 0%, #1e293b 55%, #0f172a 100%);
}

.di-tile__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: rgba(15, 23, 42, 0.7);
    color: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

.di-tile__badge--ai {
    background: rgba(13, 148, 136, 0.85);
    color: #042f2e;
}

/* --- AI interviewer presence (centered in full-bleed view) --- */

.di-ai-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 1rem;
}

.di-avatar {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    overflow: hidden;
    background: #1e293b;
    box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.45);
    transition: box-shadow 0.2s ease;
}

/* The avatar hosts an inline SVG face (see interview-app.js) */
.di-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
}

.di-avatar--speaking {
    animation: diPulse 1.1s ease-out infinite;
}

@keyframes diPulse {
    0%   { box-shadow: 0 0 0 0 var(--ac, rgba(20, 184, 166, 0.55)); }
    70%  { box-shadow: 0 0 0 26px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.di-avatar--thinking {
    animation: diThink 1.6s ease-in-out infinite;
}

@keyframes diThink {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(0.96); }
}

.di-ai-name {
    color: #f1f5f9;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.di-chip {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.55);
    color: #cbd5e1;
}

.di-chip--online { background: rgba(20, 184, 166, 0.2); color: #5eead4; }
.di-chip--offline { background: rgba(100, 116, 139, 0.25); color: #94a3b8; }

/* --- Captions over the interviewer view --- */

.di-tile__caption {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    background: rgba(15, 23, 42, 0.78);
    color: #e2e8f0;
    font-size: 13px;
    line-height: 1.45;
    padding: 8px 12px;
    border-radius: 10px;
    display: none;
}

.di-tile__caption:empty { display: none; }
.di-tile__caption:not(:empty) { display: block; }

/* --- Picture-in-picture self view (bottom-right) --- */

.di-pip {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 3;
    width: 24%;
    min-width: 130px;
    max-width: 240px;
    aspect-ratio: 3 / 4;
    background: #1e293b;
    border-radius: 12px;
    border: 2px solid rgba(248, 250, 252, 0.85);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.di-pip__badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    background: rgba(15, 23, 42, 0.72);
    color: #f8fafc;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
}

.di-pip__ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 11px;
    text-align: center;
    padding: 0 0.5rem;
}

.di-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none; /* shown when a track attaches */
}

@media (max-width: 768px) {
    .di-stage { aspect-ratio: 3 / 4; }
    .di-pip { width: 32%; min-width: 96px; }
    .di-avatar { width: 110px; height: 110px; }
    .di-ai-name { font-size: 15px; }
}

/* --- Persona picker --- */

.di-personas {
    margin-top: 16px;
}

.di-personas__title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 10px;
}

.di-personas__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.di-persona {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.di-persona:hover { border-color: #cbd5e1; transform: translateY(-1px); }

.di-persona.is-selected {
    border-color: var(--pc);
    background: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 18%, transparent);
}

.di-persona__photo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex: none;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.di-persona__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.di-persona__avatar {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.di-persona__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.di-persona__name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.di-persona__tag {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Controls --- */

.di-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.di-btn {
    background: #0d9488;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.di-btn:hover { background: #0f766e; }
.di-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.di-btn--ghost {
    background: transparent;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.di-btn--ghost:hover { background: #f1f5f9; }

.di-btn--small { padding: 10px 16px; font-size: 14px; }

.di-mode {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #475569;
}

.di-mode select {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    background: #fff;
    color: #334155;
}

.di-status {
    font-size: 13px;
    color: #64748b;
}

/* --- Transcript --- */

.di-transcript {
    margin-top: 16px;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    background: #f8fafc;
}

.di-tr {
    font-size: 13.5px;
    line-height: 1.55;
    margin-bottom: 8px;
    color: #334155;
}

.di-tr--ai { color: #0f766e; font-weight: 500; }
.di-tr--user { color: #1e293b; }
.di-tr--sys { color: #94a3b8; font-style: italic; font-size: 12px; }

/* --- Typing fallback --- */

.di-fallback {
    display: none;
    gap: 10px;
    margin-top: 12px;
}

.di-fallback input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
}

.di-fallback input:focus { outline: 2px solid #0d948833; border-color: #0d9488; }

/* Persona card: category chip */
.di-persona__cat {
  display: inline-block;
  margin: 3px 0 1px;
  padding: 1px 9px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  color: #fff;
  background: var(--pc, #0d9488);
  opacity: 0.88;
}
