/* File: /public/css/components/shared-chat.css */
/* Wryon's Games - Shared Chat Component Styles */
/* v1.1.0 - Fixed font inheritance - now uses var(--font-display) */
/*
 * CHANGES IN v1.1.0:
 * - Changed font-family from 'inherit' to 'var(--font-display)' on:
 *   - .shared-chat-suggestion
 *   - .shared-chat-input
 *   - .shared-chat-send
 *   - .shared-chat-overlay-suggestion
 *   - .shared-chat-overlay-input
 *   - .shared-chat-overlay-send
 * - This allows theme files (wryon.css, kapbots.css) to properly control fonts
 *
 * CHANGES IN v1.0.1:
 * - Added #sharedChatThoughtContainer styles to prevent click blocking
 * - Parent container now has pointer-events: none
 * - Empty container is hidden with display: none
 *
 * KEY NOTES:
 * - Universal chat component used across all pages
 * - Desktop: Collapsible sidebar panel
 * - Mobile: Floating button + full-screen overlay
 * - Trivia game controls included
 * - Thought bubble for Wryon comments
 * - All colors use CSS variables for white-label theming
 *
 * DEPENDENCIES:
 * - Requires css/core/variables.css loaded BEFORE this file
 * - Works with css/themes/[client].css for branding
 *
 * USAGE:
 * <link rel="stylesheet" href="css/core/variables.css">
 * <link rel="stylesheet" href="css/components/shared-chat.css">
 * <script src="js/shared-chat.js"></script>
 */

/* =================================================================
   DESKTOP CHAT PANEL
   Fixed position sidebar on right side
   ================================================================= */
.shared-chat-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 420px;
    max-width: calc(100vw - 40px);
    background: var(--gradient-card-angled);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-strong);
    box-shadow: 
        var(--shadow-lg),
        0 0 30px rgba(var(--brand-primary-rgb), 0.25),
        0 0 60px rgba(var(--brand-primary-rgb), 0.15);
    backdrop-filter: blur(20px);
    z-index: var(--z-fixed);
    overflow: hidden;
    transition: all var(--transition-slow);
    font-family: var(--font-display);
}

.shared-chat-panel.collapsed {
    height: auto;
}

.shared-chat-panel.expanded {
    max-height: calc(100vh - 100px);
}

/* Hide desktop panel on mobile */
@media (max-width: 768px) {
    .shared-chat-panel {
        display: none !important;
    }
}

/* =================================================================
   CHAT HEADER
   Clickable header with avatar, title, and controls
   ================================================================= */
.shared-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
}

.shared-chat-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: var(--brand-primary);
}

.shared-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    overflow: hidden;
    padding: 3px;
    border: 2px solid var(--brand-primary);
    box-shadow: var(--glow-primary-subtle);
    background: var(--bg-card);
}

.shared-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Online indicator */
.shared-chat-online {
    width: 8px;
    height: 8px;
    background: var(--brand-primary);
    border-radius: var(--radius-full);
    box-shadow: var(--glow-primary);
    animation: chatPulse 2s ease-in-out infinite;
}

@keyframes chatPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* =================================================================
   HEADER BUTTONS
   ================================================================= */
.shared-chat-header-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Trivia button (gold themed) */
.shared-chat-trivia-btn {
    background: var(--gradient-button-gold);
    border: 1px solid var(--border-secondary);
    color: var(--brand-secondary);
    padding: 6px var(--space-3);
    border-radius: var(--radius-2xl);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-slow);
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: triviaBtnPulse 2s ease-in-out infinite;
}

@keyframes triviaBtnPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(var(--brand-secondary-rgb), 0.3); }
    50% { box-shadow: 0 0 15px rgba(var(--brand-secondary-rgb), 0.6); }
}

.shared-chat-trivia-btn:hover {
    animation: none;
    background: linear-gradient(135deg, 
        rgba(var(--brand-secondary-rgb), 0.5), 
        rgba(var(--brand-secondary-rgb), 0.3));
    transform: scale(1.05);
}

/* Toggle expand/collapse button */
.shared-chat-toggle {
    background: rgba(var(--brand-primary-rgb), 0.15);
    border: 1px solid var(--border-default);
    color: var(--brand-primary);
    padding: 6px var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-slow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.shared-chat-toggle:hover {
    background: rgba(var(--brand-primary-rgb), 0.25);
}

/* New chat button */
.shared-chat-newchat-btn {
    background: rgba(100, 100, 100, 0.2);
    border: 1px solid var(--border-neutral-strong);
    color: var(--text-secondary);
    padding: 6px var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-slow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.shared-chat-newchat-btn:hover {
    background: rgba(var(--brand-primary-rgb), 0.15);
    border-color: var(--border-default);
    color: var(--brand-primary);
}

/* Overlay new chat button */
.shared-chat-overlay-newchat {
    background: rgba(100, 100, 100, 0.3);
    border: 1px solid var(--border-neutral-strong);
    color: var(--text-secondary);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all var(--transition-slow);
}

.shared-chat-overlay-newchat:hover {
    background: rgba(var(--brand-primary-rgb), 0.15);
    border-color: var(--border-default);
    color: var(--brand-primary);
}

/* =================================================================
   CHAT BODY
   Contains messages, trivia, suggestions, input
   ================================================================= */
.shared-chat-body {
    padding: var(--space-3) var(--space-4) var(--space-4);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
}

.shared-chat-messages {
    min-height: 80px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: var(--space-3);
    padding-right: 6px;
    flex: 1;
}

/* Custom scrollbar */
.shared-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.shared-chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.shared-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(var(--brand-primary-rgb), 0.3);
    border-radius: 3px;
}

/* =================================================================
   CHAT MESSAGES
   ================================================================= */
.shared-chat-message {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    animation: chatFadeIn 0.3s ease;
}

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

.shared-chat-msg-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
    padding: 3px;
    border: 2px solid var(--brand-primary);
    box-shadow: var(--glow-primary-subtle);
    background: var(--bg-card);
}

.shared-chat-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.shared-chat-msg-content {
    flex: 1;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    color: var(--text-primary);
    font-family: var(--font-body);
}

.shared-chat-msg-content strong {
    color: var(--brand-primary);
}

/* User messages */
.shared-chat-message.user {
    flex-direction: row-reverse;
}

.shared-chat-message.user .shared-chat-msg-avatar {
    display: none;
}

.shared-chat-message.user .shared-chat-msg-content {
    background: rgba(255, 255, 255, 0.08);
    text-align: right;
}

/* Assistant messages */
.shared-chat-message.assistant .shared-chat-msg-content {
    background: rgba(var(--brand-primary-rgb), 0.1);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.15);
}

/* =================================================================
   TYPING INDICATOR
   ================================================================= */
.shared-chat-typing {
    display: flex;
    gap: 4px;
    padding: var(--space-2);
}

.shared-chat-typing span {
    width: 8px;
    height: 8px;
    background: var(--brand-primary);
    border-radius: var(--radius-full);
    animation: chatTypingBounce 1.4s ease-in-out infinite;
}

.shared-chat-typing span:nth-child(1) { animation-delay: 0s; }
.shared-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.shared-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatTypingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* =================================================================
   SUGGESTIONS
   Quick reply chips
   ================================================================= */
.shared-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--space-3);
}

.shared-chat-suggestion {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 6px var(--space-3);
    border-radius: var(--radius-2xl);
    font-size: 0.65rem;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all var(--transition-slow);
}

.shared-chat-suggestion:hover {
    background: rgba(var(--brand-primary-rgb), 0.15);
    border-color: var(--border-default);
    color: var(--text-primary);
}

/* =================================================================
   INPUT ROW
   ================================================================= */
.shared-chat-input-row {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.shared-chat-input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-family: var(--font-display);
    transition: all var(--transition-slow);
}

.shared-chat-input:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.shared-chat-input::placeholder {
    color: var(--text-muted);
}

.shared-chat-send {
    background: var(--gradient-button-primary);
    border: none;
    color: var(--text-on-primary);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-slow);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: var(--text-xs);
    font-family: var(--font-display);
}

.shared-chat-send:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-primary);
}

.shared-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* =================================================================
   TRIVIA CONTROLS
   In-chat trivia game UI
   ================================================================= */
.shared-chat-trivia {
    padding: var(--space-3);
    background: rgba(var(--bg-page-rgb), 0.4);
    border-radius: var(--radius-lg);
    margin: var(--space-2) 0;
    border: 1px solid var(--border-default);
}

.shared-chat-trivia-score {
    text-align: center;
    color: var(--brand-secondary);
    font-size: var(--text-base);
    margin-bottom: var(--space-3);
    text-shadow: 0 0 10px rgba(var(--brand-secondary-rgb), 0.5);
}

.shared-chat-trivia-choices {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.shared-chat-trivia-choice {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(135deg, 
        rgba(var(--bg-page-rgb), 0.8), 
        rgba(var(--bg-page-rgb), 0.9));
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--text-sm);
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-normal);
}

.shared-chat-trivia-choice:hover:not(:disabled) {
    background: linear-gradient(135deg, 
        rgba(var(--brand-primary-rgb), 0.15), 
        rgba(var(--bg-page-rgb), 0.95));
    border-color: var(--brand-primary);
    transform: translateX(4px);
}

.shared-chat-trivia-choice:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Choice letter badge */
.shared-chat-choice-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--gradient-button-secondary);
    color: var(--text-on-secondary);
    border-radius: var(--radius-full);
    font-weight: bold;
    font-size: var(--text-sm);
    flex-shrink: 0;
}

/* Trivia action buttons */
.shared-chat-trivia-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

.shared-chat-hint-btn,
.shared-chat-exit-btn {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
}

/* Hint button (gold) */
.shared-chat-hint-btn {
    background: linear-gradient(135deg, 
        rgba(var(--brand-secondary-rgb), 0.4), 
        rgba(var(--brand-secondary-rgb), 0.2));
    border: 1px solid var(--border-secondary);
    color: var(--brand-secondary);
}

.shared-chat-hint-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, 
        rgba(var(--brand-secondary-rgb), 0.5), 
        rgba(var(--brand-secondary-rgb), 0.3));
    box-shadow: var(--glow-secondary-subtle);
}

/* Exit button (red) */
.shared-chat-exit-btn {
    background: linear-gradient(135deg, 
        rgba(139, 0, 0, 0.8), 
        rgba(80, 0, 0, 0.9));
    border: 1px solid rgba(255, 100, 100, 0.5);
    color: #ff6b6b;
}

.shared-chat-exit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, 
        rgba(180, 0, 0, 0.9), 
        rgba(100, 0, 0, 0.95));
    box-shadow: var(--glow-error);
}

/* =================================================================
   THOUGHT BUBBLE
   Wryon's comments that appear when chat is collapsed
   ================================================================= */

/* Parent container - must never block clicks when empty */
#sharedChatThoughtContainer {
    pointer-events: none;
}

#sharedChatThoughtContainer:empty {
    display: none;
}

.shared-chat-thought-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-max);
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-overlay-light);
    animation: thoughtOverlayAppear 0.3s ease-out;
    pointer-events: auto;
}

/* Desktop: Position bubble near the chat panel */
@media (min-width: 769px) {
    .shared-chat-thought-container {
        justify-content: flex-end;
        align-items: flex-end;
        padding: 0 460px 100px 0;
        background: transparent;
        pointer-events: none;
    }
    
    .shared-chat-thought-container > * {
        pointer-events: auto;
    }
}

@keyframes thoughtOverlayAppear {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.shared-chat-thought {
    background: var(--gradient-card-angled);
    border: 2px solid var(--brand-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-5) var(--space-6);
    max-width: 320px;
    min-width: 200px;
    text-align: center;
    box-shadow: 
        0 0 30px rgba(var(--brand-primary-rgb), 0.4), 
        var(--shadow-lg);
    position: relative;
    cursor: pointer;
    transition: all var(--transition-slow);
    animation: thoughtBubbleAppear 0.4s var(--ease-bounce);
    font-family: var(--font-display);
}

.shared-chat-thought.expanded {
    max-width: 90vw;
    max-height: 70vh;
    overflow-y: auto;
    cursor: default;
    padding: var(--space-6) var(--space-8);
}

/* Bubble tail - pointing down on mobile */
.shared-chat-thought::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 20px solid var(--brand-primary);
}

.shared-chat-thought::before {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 16px solid var(--bg-card-solid);
    z-index: 1;
}

/* Desktop: tail points right toward chat panel */
@media (min-width: 769px) {
    .shared-chat-thought::after {
        bottom: auto;
        left: auto;
        right: -20px;
        top: 50%;
        transform: translateY(-50%);
        border-left: 20px solid var(--brand-primary);
        border-top: 15px solid transparent;
        border-bottom: 15px solid transparent;
        border-right: none;
    }

    .shared-chat-thought::before {
        bottom: auto;
        left: auto;
        right: -16px;
        top: 50%;
        transform: translateY(-50%);
        border-left: 16px solid var(--bg-card-solid);
        border-top: 12px solid transparent;
        border-bottom: 12px solid transparent;
        border-right: none;
    }
}

.shared-chat-thought.expanded::after,
.shared-chat-thought.expanded::before {
    display: none;
}

@keyframes thoughtBubbleAppear {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* Thought bubble content */
.shared-chat-thought-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-3);
    border: 2px solid var(--brand-primary);
    box-shadow: var(--glow-primary);
}

.shared-chat-thought.expanded .shared-chat-thought-avatar {
    width: 60px;
    height: 60px;
}

.shared-chat-thought-text {
    color: var(--text-primary);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
}

.shared-chat-thought.expanded .shared-chat-thought-text {
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
    text-align: left;
}

.shared-chat-thought-text strong {
    color: var(--brand-primary);
}

.shared-chat-thought-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-3);
    font-style: italic;
}

/* Thought bubble actions */
.shared-chat-thought-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-4);
    justify-content: center;
}

.shared-chat-thought-chat-btn {
    background: var(--gradient-button-primary);
    border: none;
    color: var(--text-on-primary);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: bold;
    font-size: var(--text-base);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.shared-chat-thought-chat-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--glow-primary);
}

.shared-chat-thought-close-btn {
    background: rgba(100, 100, 100, 0.3);
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--text-base);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.shared-chat-thought-close-btn:hover {
    background: rgba(150, 150, 150, 0.3);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.shared-chat-thought-container.fading {
    animation: thoughtFadeOut 0.3s ease-out forwards;
}

@keyframes thoughtFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* =================================================================
   MOBILE FLOATING CHAT BUTTON
   ================================================================= */
.shared-chat-mobile-btns {
    display: none;
}

@media (max-width: 768px) {
    .shared-chat-mobile-btns {
        display: flex;
        position: fixed;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        z-index: var(--z-toast);
        flex-direction: column;
        align-items: center;
        gap: var(--space-1);
    }
    
    /* Hide trivia button on mobile */
    .shared-chat-mobile-trivia {
        display: none !important;
    }
    
    /* Floating chat button */
    .shared-chat-mobile-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--space-1);
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
    }
    
    .shared-chat-mobile-btn .chat-btn-icon {
        width: 56px;
        height: 56px;
        border-radius: var(--radius-full);
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, 
            rgba(var(--brand-primary-rgb), 0.2), 
            var(--bg-glass));
        border: 2px solid var(--border-strong);
        box-shadow: 
            var(--shadow-lg),
            0 0 20px rgba(var(--brand-primary-rgb), 0.3);
        transition: all var(--transition-slow);
        overflow: hidden;
        animation: chatBtnPulse 3s ease-in-out infinite;
    }
    
    .shared-chat-mobile-btn .chat-btn-icon img {
        width: 90%;
        height: 90%;
        border-radius: var(--radius-full);
        object-fit: cover;
    }
    
    .shared-chat-mobile-btn .chat-btn-label {
        font-family: var(--font-display);
        font-size: var(--text-xs);
        color: var(--brand-primary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    }
    
    .shared-chat-mobile-btn:active .chat-btn-icon {
        transform: scale(0.95);
        border-color: var(--brand-primary);
        box-shadow: 
            var(--shadow-md),
            var(--glow-primary);
    }
    
    @keyframes chatBtnPulse {
        0%, 100% { 
            box-shadow: var(--shadow-lg), 
                        0 0 20px rgba(var(--brand-primary-rgb), 0.3); 
        }
        50% { 
            box-shadow: var(--shadow-lg), 
                        0 0 30px rgba(var(--brand-primary-rgb), 0.5); 
        }
    }
}

/* =================================================================
   MOBILE OVERLAY
   Full-screen chat on mobile
   ================================================================= */
.shared-chat-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(5, 15, 5, 0.99) 0%, 
        rgba(var(--bg-page-rgb), 0.99) 100%);
    z-index: calc(var(--z-max) + 1);
    flex-direction: column;
    font-family: var(--font-display);
}

.shared-chat-overlay.visible {
    display: flex;
}

.shared-chat-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-subtle);
}

.shared-chat-overlay-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.shared-chat-overlay-avatar {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--brand-primary);
    box-shadow: var(--glow-primary);
}

.shared-chat-overlay-name {
    color: var(--brand-primary);
    font-size: var(--text-md);
    font-weight: 500;
}

.shared-chat-overlay-close {
    background: rgba(139, 0, 0, 0.6);
    border: 1px solid rgba(255, 100, 100, 0.5);
    color: #ff6b6b;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-slow);
}

.shared-chat-overlay-close:hover {
    background: rgba(180, 0, 0, 0.7);
}

.shared-chat-overlay-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-4);
    overflow: hidden;
}

.shared-chat-overlay-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: var(--space-3);
    padding-right: var(--space-2);
}

.shared-chat-overlay-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.shared-chat-overlay-suggestion {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-2xl);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all var(--transition-slow);
    font-family: var(--font-display);
}

.shared-chat-overlay-suggestion:hover {
    background: rgba(var(--brand-primary-rgb), 0.15);
    border-color: var(--border-default);
    color: var(--text-primary);
}

.shared-chat-overlay-input-row {
    display: flex;
    gap: var(--space-3);
}

.shared-chat-overlay-input {
    flex: 1;
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: var(--text-md);
    font-family: var(--font-display);
}

.shared-chat-overlay-input:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.shared-chat-overlay-send {
    background: var(--gradient-button-primary);
    border: none;
    color: var(--text-on-primary);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    font-size: var(--text-sm);
    font-family: var(--font-display);
}

.shared-chat-overlay-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}