:root {
    --bg-deep: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-teal: #2dd4bf;
    --accent-blue: #38bdf8;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --hat-black: #64748b;
    --hat-white: #f1f5f9;
    --hat-red: #ef4444;
    --hat-yellow: #f59e0b;
    --hat-green: #10b981;
    --hat-blue: #3b82f6;
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5);
}

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

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
    background-image: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.1) 0%, transparent 40%);
}

#nexus-app {
    display: flex;
    height: 100vh;
    padding: 24px;
    gap: 24px;
}

.proctor-panel, .chat-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: var(--shadow-xl);
}

.proctor-panel {
    width: 320px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 20px;
}

.intel-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.intel-section h3 {
    font-size: 0.75rem;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

.intel-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    max-height: 250px;
    overflow-y: auto;
}

.policy-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-family: monospace;
    font-size: 0.75rem;
}
.policy-stat span { color: var(--text-secondary); }
.policy-stat strong { color: var(--accent-teal); }

.panel-header h2 { font-family: 'Outfit', sans-serif; font-size: 1.2rem; font-weight: 700; color: var(--text-primary); }
.panel-header h2 span { color: var(--accent-teal); }

.hat-deliberation { 
    flex: 1; 
    overflow-y: auto; 
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-entry { 
    padding: 12px; 
    background: rgba(255,255,255,0.03); 
    border-radius: 12px; 
    font-size: 0.82rem; 
    line-height: 1.4;
    border-left: 3px solid var(--accent-blue);
    animation: fadeIn 0.4s ease-out;
}

/* Dynamic Hat-Specific Borders */
.log-entry.black { border-left-color: var(--hat-black); }
.log-entry.white { border-left-color: var(--hat-white); }
.log-entry.red { border-left-color: var(--hat-red); }
.log-entry.yellow { border-left-color: var(--hat-yellow); }
.log-entry.green { border-left-color: var(--hat-green); }
.log-entry.blue { border-left-color: var(--hat-blue); }

/* Premium Deliberation Hat Badges */
.hat-tag {
    font-family: monospace;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 8px;
    display: inline-block;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.log-entry.black .hat-tag { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }
.log-entry.white .hat-tag { background: rgba(241, 245, 249, 0.1); color: #f1f5f9; border: 1px solid rgba(241, 245, 249, 0.2); }
.log-entry.red .hat-tag { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.log-entry.yellow .hat-tag { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.log-entry.green .hat-tag { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.log-entry.blue .hat-tag { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }

.agent-label {
    font-family: monospace;
    font-size: 0.72rem;
    color: var(--accent-blue);
    margin-bottom: 12px;
    letter-spacing: 0.15em;
    font-weight: 700;
}

@keyframes fadeIn { from { opacity: 0; transform: translateX(-5px); } to { opacity: 1; transform: translateX(0); } }

.chat-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }

.qa-stage-north, .status-hud, .input-zone {
    position: relative;
    z-index: 10;
}

.nexus-header { padding: 24px 32px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--glass-border); }

.brand { display: flex; align-items: center; gap: 14px; }
.logo-orb { width: 36px; height: 36px; background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal)); border-radius: 12px; box-shadow: 0 0 20px rgba(45, 212, 191, 0.3); }
/* North Zone (Inquiry) */
.qa-stage-north {
    display: flex;
    height: 45vh; /* Controlled height for the top half */
    border-bottom: 1px solid var(--glass-border);
    animation: fadeIn 0.6s ease-out;
}

.question-slot {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.agent-label {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--accent-blue);
    margin-bottom: 16px;
    letter-spacing: 0.2em;
    font-weight: 700;
}

/* Question Reveal Animation */
.question-slot .incoming-query-label,
.question-slot .incoming-query-text {
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), transform 1.2s cubic-bezier(0.4, 0, 0.2, 1), filter 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-slot.question-hidden .incoming-query-label,
.question-slot.question-hidden .incoming-query-text {
    opacity: 0;
    transform: translateY(15px);
    filter: blur(8px);
}

.question-slot.question-revealed .incoming-query-label,
.question-slot.question-revealed .incoming-query-text {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.candidate-response-preview {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px dashed var(--glass-border);
    opacity: 0.7;
    filter: saturate(0.5);
    font-size: 1.05rem;
}

/* Status HUD */
.status-hud {
    padding: 12px 32px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
}

.timer-group {
    display: flex;
    gap: 32px;
}

.timer-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timer-item .label {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

.timer-item .value {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--accent-teal);
    font-variant-numeric: tabular-nums;
}

/* South Zone (Response Canvas) */
.input-zone.expanded {
    flex: 1; /* Takes the remaining 50% */
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.input-zone.expanded .input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    gap: 20px;
}

.input-zone.expanded textarea {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.8;
}

.input-actions {
    display: flex;
    justify-content: flex-end;
}

.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#send-btn { 
    background: var(--accent-teal); 
    border: none; 
    padding: 0 32px;
    height: 54px; 
    border-radius: 16px; 
    display: flex; 
    align-items: center; 
    gap: 14px;
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    color: var(--bg-deep);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#send-btn:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 10px 20px rgba(45, 212, 191, 0.2);
}

/* Deliberation Overlay */
#deliberation-overlay {
    position: absolute;
    inset: 32px; /* Matches padding of input-zone */
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    gap: 20px;
    border-radius: 24px;
}

.pulse-ring {
    width: 60px;
    height: 60px;
    border: 3px solid var(--accent-teal);
    border-radius: 50%;
    animation: ringPulse 1.5s infinite;
}

.retry-link-btn {
    background: transparent;
    border: 1px solid var(--accent-teal);
    color: var(--accent-teal);
    padding: 12px 24px;
    border-radius: 12px;
    font-family: monospace;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    z-index: 101;
}

.retry-link-btn:hover {
    background: var(--accent-teal);
    color: var(--bg-deep);
    box-shadow: 0 0 15px rgba(45, 212, 191, 0.4);
}

.retry-link-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

@keyframes ringPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.nexus-status-text {
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--accent-teal);
}

.risk-gauges { margin-top: auto; display: flex; flex-direction: column; gap: 16px; }
.gauge-label { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; }
.progress-bar { height: 6px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; }
.fill { height: 100%; background: var(--accent-teal); transition: width 0.5s ease; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.diagnostic-monitor {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
    font-family: monospace;
    font-size: 0.75rem;
}
.diag-header { color: var(--accent-teal); margin-bottom: 8px; font-weight: bold; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 4px; }
.diag-item { margin-bottom: 4px; color: #84cc16; }

.hidden { display: none !important; }

#integrity-warning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: monospace;
    font-weight: 700;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translate(-50%, -50%); }
    25% { transform: translate(-52%, -50%); }
    75% { transform: translate(-48%, -50%); }
}

.error-pulse {
    border-color: #ef4444 !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2) !important;
}

/* Nexus Voice Avatar - Center Glow */
#nexus-voice-avatar {
    position: absolute;
    width: 250px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 1s ease-out;
    pointer-events: none;
    z-index: 0; /* Behind the text */
    opacity: 0.25; /* Subtle background presence */
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}

/* 9 Grid Positions */
#nexus-voice-avatar.pos-top-left { top: 15%; left: 15%; transform: translate(-50%, -50%); }
#nexus-voice-avatar.pos-top-mid { top: 15%; left: 50%; transform: translate(-50%, -50%); }
#nexus-voice-avatar.pos-top-right { top: 15%; left: 85%; transform: translate(-50%, -50%); }

#nexus-voice-avatar.pos-mid-left { top: 50%; left: 15%; transform: translate(-50%, -50%); }
#nexus-voice-avatar.pos-center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
#nexus-voice-avatar.pos-mid-right { top: 50%; left: 85%; transform: translate(-50%, -50%); }

#nexus-voice-avatar.pos-bottom-left { top: 85%; left: 15%; transform: translate(-50%, -50%); }
#nexus-voice-avatar.pos-bottom-mid { top: 85%; left: 50%; transform: translate(-50%, -50%); }
#nexus-voice-avatar.pos-bottom-right { top: 85%; left: 85%; transform: translate(-50%, -50%); }

.logo-orb.large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    z-index: 5;
    box-shadow: 0 0 50px rgba(45, 212, 191, 0.5);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
    transition: all 0.3s ease;
}

#nexus-voice-avatar.speaking {
    opacity: 0.7; /* Glows brightly when speaking */
}

#nexus-voice-avatar.speaking .logo-orb.large {
    transform: scale(1.15);
    box-shadow: 0 0 80px rgba(56, 189, 248, 0.9), inset 0 0 30px rgba(255, 255, 255, 0.6);
    background: linear-gradient(135deg, var(--accent-blue), #fff, var(--accent-teal));
}

.avatar-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--accent-teal);
    opacity: 0;
}

.avatar-ring.outer {
    width: 100%;
    height: 100%;
}

.avatar-ring.middle {
    width: 75%;
    height: 75%;
}

#nexus-voice-avatar.speaking .avatar-ring.outer {
    animation: voicePulse 1.5s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
}

#nexus-voice-avatar.speaking .avatar-ring.middle {
    animation: voicePulse 1.5s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
    animation-delay: 0.3s;
}

@keyframes voicePulse {
    0% { transform: scale(0.5); opacity: 0.8; border-color: var(--accent-blue); }
    100% { transform: scale(1.2); opacity: 0; border-color: var(--accent-teal); }
}

/* ==========================================================================
   B2B BRANDING STRIP & CANDIDATE ENTRY OVERLAY REDESIGN
   ========================================================================== */

#join-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #030712;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(45, 212, 191, 0.15) 0%, transparent 40%);
}

#join-overlay::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 0);
    background-size: 24px 24px;
    opacity: 0.8;
    pointer-events: none;
}

.glass-hero {
    background: rgba(17, 24, 39, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 28px !important;
    padding: 50px 40px !important;
    width: 100%;
    max-width: 480px;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 50px rgba(56, 189, 248, 0.05);
    animation: scaleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    z-index: 10;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.hero-content {
    text-align: center;
}

.hero-content .badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 9999px;
    color: var(--accent-blue);
    font-size: 0.75rem;
    font-family: monospace;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.05);
}

.hero-content h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.hero-content h1 span {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 36px;
}

.join-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.join-form input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
    padding: 18px 24px !important;
    font-size: 1.1rem !important;
    color: #fff !important;
    font-family: inherit;
    text-align: center;
    letter-spacing: 0.05em;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.join-form input::placeholder {
    color: rgba(255, 255, 255, 0.25) !important;
    font-weight: 400;
    letter-spacing: normal;
}

.join-form input:focus {
    outline: none !important;
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.15), inset 0 0 5px rgba(0, 0, 0, 0.5) !important;
    background: rgba(0, 0, 0, 0.45) !important;
}

.join-form button {
    width: 100%;
    padding: 18px !important;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal)) !important;
    border: none !important;
    border-radius: 14px !important;
    color: #fff !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(56, 189, 248, 0.2);
    position: relative;
    overflow: hidden;
}

.join-form button::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0) 45%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0) 55%
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
    animation: shinePulse 4s infinite ease-in-out;
}

@keyframes shinePulse {
    0% { transform: translate(-30%, -30%) rotate(45deg); }
    10% { transform: translate(30%, 30%) rotate(45deg); }
    100% { transform: translate(30%, 30%) rotate(45deg); }
}

.join-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(56, 189, 248, 0.35);
}

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

/* Host Organization Branding Strip Styles */
.org-branding-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 24px;
    background: rgba(15, 23, 42, 0.3);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 0.85rem;
    animation: fadeIn 0.5s ease-out;
}

.branding-prefix {
    font-family: monospace;
    font-size: 0.68rem;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
    font-weight: 700;
    opacity: 0.6;
}

.org-brand-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.org-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.org-logo-fallback {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    color: #fff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.org-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}
