/* =============================================================================
   CUSTOM STYLES - RoleplayED - Compliance & Legal
   ============================================================================= */

/* -----------------------------------------------------------------------------
   CLIENT HIDDEN ELEMENTS (TEMPORARY)
   Remove the 'client-hidden' class from elements to unhide features.
   See HIDDEN.md in the project root for instructions.
   ----------------------------------------------------------------------------- */
.client-hidden {
    display: none !important;
}

/* -----------------------------------------------------------------------------
   Error Messages
   ----------------------------------------------------------------------------- */
.chat-error {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 10px 0;
    color: #991b1b;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease-out;
}

.chat-error .error-icon {
    font-size: 18px;
    color: #dc2626;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -----------------------------------------------------------------------------
   Disabled Button States
   ----------------------------------------------------------------------------- */
#sendQuestion.disabled,
#sendQuestion:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

#sendQuestion {
    transition: opacity 0.2s ease;
}

/* -----------------------------------------------------------------------------
   Character Card Loading States
   ----------------------------------------------------------------------------- */
.characterCard.loading {
    position: relative;
    pointer-events: none;
}

.characterCard.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

.characterCard.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #e0e0e0;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.characterCard.load-error {
    opacity: 0.6;
    border-color: #ef4444;
}

.characterCard.load-error::after {
    content: 'Failed to load';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* -----------------------------------------------------------------------------
   Character Load Error
   ----------------------------------------------------------------------------- */
.character-load-error {
    text-align: center;
    padding: 40px;
    color: #991b1b;
}

.character-load-error p {
    margin-bottom: 20px;
}

/* -----------------------------------------------------------------------------
   Screen Reader Only (Accessibility)
   ----------------------------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* -----------------------------------------------------------------------------
   Focus States (Accessibility)
   ----------------------------------------------------------------------------- */
.btn:focus,
button:focus,
textarea:focus,
input:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Remove default focus outline since we're adding our own */
.btn:focus-visible,
button:focus-visible,
textarea:focus-visible,
input:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* -----------------------------------------------------------------------------
   Export Button
   ----------------------------------------------------------------------------- */
#exportInterview {
    background-color: #059669;
}

#exportInterview:hover {
    background-color: #047857;
}

/* -----------------------------------------------------------------------------
   Skip to Content Link (Accessibility)
   ----------------------------------------------------------------------------- */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* -----------------------------------------------------------------------------
   Character Card Focus States
   ----------------------------------------------------------------------------- */
.characterCard:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.3);
}

.characterCard:focus-visible {
    outline: 3px solid #3498db;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.3);
}

/* -----------------------------------------------------------------------------
   High Contrast Mode Support
   ----------------------------------------------------------------------------- */
@media (prefers-contrast: high) {
    .chat-error {
        border-width: 2px;
    }

    .btn:focus,
    button:focus {
        outline-width: 3px;
    }
}

/* -----------------------------------------------------------------------------
   Reduced Motion Support
   ----------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .chat-error,
    .characterCard.loading::before {
        animation: none;
    }

    .characterCard.loading::before {
        border-top-color: #3498db;
        border-right-color: #3498db;
    }
}

/* =============================================================================
   GROUP CHAT SELECTION MODE STYLES
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Character Selection Header
   ----------------------------------------------------------------------------- */
.characterSelectionHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 10px;
}

.characterSelectionHeader .labelTitle {
    margin: 0;
}

#groupInterviewBtn {
    background-color: #e2e8f0;
    color: #1e293b;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 400;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

#groupInterviewBtn:hover {
    background-color: #cbd5e1;
    transform: translateY(-1px);
}

#groupInterviewBtn:active {
    transform: translateY(0);
}

/* -----------------------------------------------------------------------------
   Selection Mode Body State
   ----------------------------------------------------------------------------- */
.group-selection-mode #charactersContainer {
    position: relative;
}

.group-selection-mode .characterCard {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.group-selection-mode .characterCard:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* -----------------------------------------------------------------------------
   Selected Character Card Styles
   ----------------------------------------------------------------------------- */
.characterCard.group-selected {
    border: 3px solid #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
    position: relative;
}

.characterCard.group-selected::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background-color: #22c55e;
    border-radius: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.characterCard.group-selected::after {
    content: '';
    position: absolute;
    top: 16px;
    right: 18px;
    width: 8px;
    height: 14px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    z-index: 11;
}

/* Ensure loading overlay doesn't interfere with selection checkmark */
.characterCard.group-selected.loading::after {
    content: '';
    background: rgba(255, 255, 255, 0.7);
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border: none;
    transform: none;
}

/* -----------------------------------------------------------------------------
   Group Selection UI Panel
   ----------------------------------------------------------------------------- */
#groupSelectionUI {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 10px auto 0 auto;
    max-width: 420px;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.group-selection-mode #groupSelectionUI {
    display: block;
}

/* Top row: counter and toggle */
#groupSelectionTopRow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#groupSelectionCounter {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
}

#groupSelectionButtons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

#startGroupChatBtn {
    background-color: #dcfce7;
    color: #1e293b;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 400;
    border-radius: 6px;
    border: 1px solid #86efac;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

#startGroupChatBtn:hover:not(:disabled) {
    background-color: #bbf7d0;
}

#startGroupChatBtn:disabled {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
}

#cancelGroupSelectBtn {
    background-color: #f1f5f9;
    color: #1e293b;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 400;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    transition: background-color 0.2s ease;
}

#cancelGroupSelectBtn:hover {
    background-color: #e2e8f0;
}

/* -----------------------------------------------------------------------------
   Toggle Switch for Aware/Unaware Mode
   ----------------------------------------------------------------------------- */
#groupModeSelector {
    display: none;
}

.modeToggleContainer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modeToggleLabel {
    font-size: 12px;
    color: #64748b;
    transition: color 0.2s ease;
}

.modeToggleLabel.active {
    color: #1e293b;
    font-weight: 500;
}

.modeToggleSwitch {
    position: relative;
    width: 44px;
    height: 22px;
    background-color: #6366f1;
    border-radius: 11px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modeToggleSwitch.unaware {
    background-color: #f59e0b;
}

.modeToggleSwitch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.modeToggleSwitch.unaware::after {
    transform: translateX(22px);
}

/* -----------------------------------------------------------------------------
   Group Chat Active State
   ----------------------------------------------------------------------------- */
.group-chat-active #characterInfo {
    /* Styles for when group chat is active */
}

/* Hide the single character display when in group chat */
.group-chat-active #charPictureNoUnity {
    display: none;
}

/* -----------------------------------------------------------------------------
   Secondary Button Style
   ----------------------------------------------------------------------------- */
.btn.btnSecondary {
    background-color: #64748b;
}

.btn.btnSecondary:hover {
    background-color: #475569;
}

/* =============================================================================
   GROUP INTERVIEW PANEL STYLES
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Participants Sidebar
   ----------------------------------------------------------------------------- */
#groupParticipantsSidebar {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    max-height: 450px;
    overflow-y: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#groupParticipantsSidebar .sidebarTitle {
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #cbd5e1;
}

.participantItem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #e2e8f0;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.participantItem:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: #94a3b8;
}

.participantItem:last-child {
    margin-bottom: 0;
}

.participantImage {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    border: 2px solid #94a3b8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.participantInfo {
    flex: 1;
    min-width: 0;
}

.participantName {
    color: #1e293b;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.participantRapport {
    display: flex;
    align-items: center;
    gap: 8px;
}

.miniRapportBar {
    flex: 1;
    height: 6px;
    background: #cbd5e1;
    border-radius: 3px;
    overflow: hidden;
}

.miniRapportFill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #22c55e 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.rapportText {
    color: #475569;
    font-size: 11px;
    font-weight: 500;
    min-width: 32px;
    text-align: right;
}

/* -----------------------------------------------------------------------------
   Group Messages
   ----------------------------------------------------------------------------- */
.groupMessage {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 10px;
    position: relative;
}

.groupMessage.systemMessage {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    color: #0369a1;
    text-align: center;
    font-style: italic;
    font-size: 14px;
}

.groupMessage.userMessage {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    margin-left: 20px;
}

.groupMessage.assistantMessage {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fde047;
    margin-right: 20px;
}

.groupMessage .messageHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.groupMessage .messageLabel {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.groupMessage.userMessage .messageLabel {
    color: #475569;
}

.groupMessage .messageContent {
    color: #1e293b;
    line-height: 1.5;
}

/* -----------------------------------------------------------------------------
   Group Chat Emotion Indicators
   ----------------------------------------------------------------------------- */
.emotionIndicator {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.emotionIndicator.emotion-good {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #86efac;
}

.emotionIndicator.emotion-sad {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.emotionIndicator.emotion-angry {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.emotionIndicator.emotion-annoyed {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.emotionIndicator.emotion-neutral {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid #cbd5e1;
}

/* -----------------------------------------------------------------------------
   Single Chat Emotion Indicators
   ----------------------------------------------------------------------------- */
.answerHeader {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.answerEmotionIndicator {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.answerEmotionIndicator.emotion-good {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #86efac;
}

.answerEmotionIndicator.emotion-sad {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.answerEmotionIndicator.emotion-angry {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.answerEmotionIndicator.emotion-annoyed {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.answerEmotionIndicator.emotion-neutral {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid #cbd5e1;
}

.answerContent {
    /* Container for the answer text with typewriter effect */
}

/* -----------------------------------------------------------------------------
   Hide Single Character Elements in Group Mode
   ----------------------------------------------------------------------------- */
.group-chat-active #rapportBarContainer {
    display: none;
}

.group-chat-active #unityContainer {
    display: none;
}

/* Show the sidebar in group mode */
.group-chat-active #groupParticipantsSidebar {
    display: block;
}

/* Hide sidebar in normal mode */
#groupParticipantsSidebar {
    display: none;
}

.group-chat-active #groupParticipantsSidebar {
    display: block;
}

/* -----------------------------------------------------------------------------
   Speaking Indicator (for current speaker)
   ----------------------------------------------------------------------------- */
.participantItem.speaking {
    background: rgba(34, 197, 94, 0.15) !important;
    border: 1px solid #22c55e !important;
}

.participantItem.speaking .participantImage {
    border-color: #22c55e !important;
    animation: speakingPulse 1.5s ease-in-out infinite;
}

.participantItem.speaking .participantName {
    color: #166534;
}

@keyframes speakingPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
}

/* -----------------------------------------------------------------------------
   Ask All Button and Participant Selection
   ----------------------------------------------------------------------------- */
.askAllBtn {
    background: rgba(59, 130, 246, 0.1);
    color: #475569;
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #cbd5e1;
}

.askAllBtn:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #1e293b;
    border-color: #94a3b8;
}

.askAllBtn.selected {
    background: rgba(59, 130, 246, 0.2);
    color: #2563eb;
    border-color: #3b82f6;
}

.participantItem {
    cursor: pointer;
}

.participantItem.selected {
    background: rgba(139, 92, 246, 0.15) !important;
    border: 1px solid #8b5cf6 !important;
    border-radius: 8px;
}

.participantItem.selected .participantName {
    color: #6d28d9;
}

/* -----------------------------------------------------------------------------
   Group Interview Header
   ----------------------------------------------------------------------------- */
.group-chat-active #characterInfoFullName {
    font-size: 16px;
}

/* -----------------------------------------------------------------------------
   Responsive Adjustments
   ----------------------------------------------------------------------------- */
@media (max-width: 768px) {
    #groupParticipantsSidebar {
        max-height: 200px;
    }

    .participantItem {
        padding: 6px;
        gap: 6px;
        margin-bottom: 4px;
    }

    .participantImage {
        width: 28px;
        height: 28px;
    }

    .participantName {
        font-size: 11px;
    }

    .emotionIndicator {
        padding: 2px 6px;
        font-size: 10px;
    }

    .groupMessage .messageHeader {
        flex-wrap: wrap;
        gap: 6px;
    }

    .answerEmotionIndicator {
        padding: 2px 6px;
        font-size: 10px;
    }
}

/* -----------------------------------------------------------------------------
   Group Chat Error Text
   ----------------------------------------------------------------------------- */
.error-text {
    color: #dc2626;
    font-style: italic;
}

/* -----------------------------------------------------------------------------
   Group Chat Export Styles
   ----------------------------------------------------------------------------- */
.group-chat-active #exportInterview {
    /* Export still works in group chat */
}

/* -----------------------------------------------------------------------------
   Mode Tooltips
   ----------------------------------------------------------------------------- */
#groupModeSelector label[title] {
    cursor: help;
}

/* Aware mode - default tooltip style */
#groupModeSelector label:first-child::after {
    content: '';
}

/* -----------------------------------------------------------------------------
   Max Participants Warning Toast
   ----------------------------------------------------------------------------- */
.max-participants-warning {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* =============================================================================
   GROUP BIO POPUP - Tabbed Navigation
   ============================================================================= */

#groupBioTabs {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    margin-bottom: 10px;
    overflow-x: auto;
    flex-wrap: wrap;
}

.bioTab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

.bioTab:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #94a3b8;
    color: #1e293b;
}

.bioTab.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: #4f46e5;
    color: white;
}

.bioTab .tabImage {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.bioTab .tabName {
    white-space: nowrap;
}

/* Hide Start Interview button in group mode */
#popupCharacterBio.groupMode #bioStartInterview {
    display: none !important;
}

/* =============================================================================
   GROUP NOTES POPUP - Tabbed Layout
   ============================================================================= */

#groupNotesTabs {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    margin-bottom: 10px;
    overflow-x: auto;
    flex-wrap: wrap;
}

.notesTab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

.notesTab:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #94a3b8;
    color: #1e293b;
}

.notesTab.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: #4f46e5;
    color: white;
}

.notesTab .tabImage {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.notesTab .tabName {
    white-space: nowrap;
}

/* Adjust notes popup for group mode */
#popupCharacterNotes.groupMode #notesData {
    display: none;
}

#popupCharacterNotes.groupMode #notesList {
    margin-top: 0;
}

/* =============================================================================
   SUGGESTED PROMPTS - AI-powered follow-up questions
   ============================================================================= */

#suggestedPrompts {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
    max-height: 180px;
    overflow-y: auto;
}

#suggestedPrompts:empty {
    display: none;
}

.prompts-header {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.prompts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggested-prompt {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 14px;
    color: #334155;
}

.suggested-prompt:hover {
    background: #f8fafc;
    border-color: #0066cc;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
    transform: translateX(4px);
}

.suggested-prompt:active {
    transform: translateX(2px);
    box-shadow: 0 1px 4px rgba(0, 102, 204, 0.1);
}

.prompt-category {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    letter-spacing: 0.3px;
}

.prompt-text {
    flex: 1;
    line-height: 1.4;
}

/* Animation when prompt is inserted */
#questionTextArea.prompt-inserted {
    background-color: #f0f9ff;
    border-color: #0066cc;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* =============================================================================
   INTERVIEW STAGE INDICATOR
   ============================================================================= */

/* Template Selector */
#templateSelectorContainer {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

#templateSelector {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #334155;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#templateSelector:hover {
    border-color: #94a3b8;
}

#templateSelector:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

#stageIndicatorContainer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    margin-right: 10px;
}

.stage-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

/* Stage-specific colors */
.stage-badge[data-stage="opening"],
.stage-badge.stage-opening {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.stage-badge[data-stage="background"],
.stage-badge.stage-background {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.stage-badge[data-stage="core_topic"],
.stage-badge.stage-core_topic {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.stage-badge[data-stage="deep_dive"],
.stage-badge.stage-deep_dive {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.stage-badge[data-stage="facilitators"],
.stage-badge.stage-facilitators {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: white;
}

.stage-badge[data-stage="closing"],
.stage-badge.stage-closing {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

#stageOverride {
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: white;
    color: #334155;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

#stageOverride:hover {
    border-color: #94a3b8;
}

#stageOverride:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #templateSelectorContainer {
        margin-right: 6px;
    }

    #templateSelector {
        font-size: 11px;
        padding: 4px 8px;
    }

    #stageIndicatorContainer {
        padding: 3px 8px;
        gap: 6px;
        margin-right: 6px;
    }

    .stage-label {
        display: none;
    }

    .stage-badge {
        font-size: 10px;
        padding: 2px 8px;
    }

    #stageOverride {
        font-size: 10px;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    #templateSelectorContainer {
        display: none;
    }

    #stageIndicatorContainer {
        display: none;
    }
}

/* Responsive adjustments for suggested prompts */
@media (max-width: 768px) {
    #suggestedPrompts {
        padding: 10px 12px;
        max-height: 150px;
    }

    .prompts-header {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .suggested-prompt {
        padding: 8px 12px;
        font-size: 13px;
        gap: 8px;
    }

    .prompt-category {
        font-size: 9px;
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    .suggested-prompt {
        flex-direction: column;
        gap: 6px;
    }

    .prompt-category {
        align-self: flex-start;
    }
}

/* =============================================================================
   CHAT SETTINGS BAR — Unified Toggle & Button System
   ============================================================================= */

/* --- Settings bar layout --- */
#chatSettings {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 5px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f8fa 0%, #f0f2f4 100%);
    border-bottom: 1px solid rgba(29, 170, 226, 0.25);
    border-radius: 4px 4px 0 0;
}

/* --- Toggle group container --- */
.settings-toggle-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* --- Toggle label text --- */
.settings-toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: #5a5e6d;
    user-select: none;
    letter-spacing: 0.02em;
}

/* --- Hidden checkbox (drives :checked state) --- */
.settings-toggle-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* --- Toggle track (the pill) --- */
.settings-toggle-track {
    display: inline-block;
    width: 36px;
    height: 20px;
    background: #c4c8d0;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0;
    vertical-align: middle;
}

/* --- Toggle knob (the sliding dot) --- */
.settings-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* --- Checked state (ON) --- */
.settings-toggle-checkbox:checked + .settings-toggle-track {
    background: #4CAF50;
}

.settings-toggle-checkbox:checked + .settings-toggle-track::after {
    transform: translateX(16px);
}

/* --- Hover feedback --- */
.settings-toggle-track:hover {
    box-shadow: 0 0 0 2px rgba(29, 170, 226, 0.3);
}

/* --- Focus ring for accessibility --- */
.settings-toggle-checkbox:focus-visible + .settings-toggle-track {
    box-shadow: 0 0 0 2px #1daae2;
}

/* --- Live Mode Toggle (Aware/Unaware — special two-label variant) --- */
#liveModeToggle .mode-aware-label,
#liveModeToggle .mode-unaware-label {
    font-size: 11px;
    color: #99a2aa;
    transition: color 0.3s, font-weight 0.3s;
}

#liveModeToggle .mode-label.active {
    color: #3a4a5d;
    font-weight: 700;
}

/* Live mode track — aware (green) by default */
#liveModeToggleSwitch.mode-track {
    background: #4CAF50;
}

/* Live mode track — unaware (orange) */
#liveModeToggleSwitch.unaware {
    background: #FF9800;
}

#liveModeToggleSwitch.unaware::after {
    transform: translateX(16px);
}

/* --- Divider --- */
.settings-divider {
    width: 1px;
    height: 24px;
    background: rgba(29, 170, 226, 0.35);
    margin: 0 2px;
    flex-shrink: 0;
}

/* --- Action buttons (Reset / Export) --- */
.settings-action-btn {
    font-family: 'Microsoft New Tai Lue', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #5a5e6d;
    background: white;
    border: 1px solid rgba(29, 170, 226, 0.5);
    border-radius: 4px;
    padding: 5px 14px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.settings-action-btn:hover {
    background: linear-gradient(135deg, #e8f0f7 0%, #f0f2f7 100%);
    border-color: #1daae2;
    color: #3a4a5d;
}

.settings-action-btn:active {
    transform: translateY(1px);
}

/* --- Text size button group --- */
.settings-text-size {
    display: inline-flex;
    border: 1px solid rgba(29, 170, 226, 0.5);
    border-radius: 4px;
    overflow: hidden;
}

.settings-size-btn {
    font-family: 'Georgia', serif;
    color: #5a5e6d;
    background: white;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    width: 30px;
    text-align: center;
    transition: all 0.2s ease;
    border-right: 1px solid rgba(29, 170, 226, 0.3);
}

.settings-size-btn:last-child {
    border-right: none;
}

.settings-size-btn[data-size="littleSize"] {
    font-size: 11px;
}

.settings-size-btn[data-size="mediumSize"] {
    font-size: 14px;
}

.settings-size-btn[data-size="bigSize"] {
    font-size: 17px;
}

.settings-size-btn:hover {
    background: linear-gradient(135deg, #e8f0f7 0%, #f0f2f7 100%);
    color: #3a4a5d;
}

.settings-size-btn.selected {
    background: linear-gradient(135deg, #1daae2 0%, #a9b3d0 100%);
    color: white;
}

/* -----------------------------------------------------------------------------
   Participant Reorder Arrows (Sidebar)
   Note: .participantItem already has display:flex from line ~531
   ----------------------------------------------------------------------------- */
.participantReorder {
    display: flex;
    flex-direction: column;
    margin-left: auto;
    gap: 2px;
}

.reorderBtn {
    background: none;
    border: 1px solid #cbd5e1;
    color: #64748b;
    cursor: pointer;
    padding: 1px 6px;
    font-size: 10px;
    line-height: 1;
    border-radius: 3px;
}

.reorderBtn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Hide reorder arrows when random order is active */
.random-order-active .participantReorder {
    display: none;
}
