/* =============================================================================
   AYNA AI Chat Panel - Rovo-Style Command Interface
   ============================================================================= */

/* =============================================================================
   LAYOUT FOUNDATION - Fixed Viewport
   ============================================================================= */

html, body {
    height: 100%;
    overflow: hidden;
}

/* Override content-wrapper for fixed viewport layout */
.content-wrapper {
    display: flex;
    height: calc(100vh - 57px); /* Subtract header height */
    overflow: hidden;
}

/* Sidebar - Fixed, scrolls internally */
.sidebar-inline {
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Page Content - Scrolls independently */
.page-content {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}

/* =============================================================================
   ASK AYNA BUTTON - Header CTA
   ============================================================================= */

.ask-ayna-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #0EA5E9 0%, #06B6D4 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
    white-space: nowrap;
}

.ask-ayna-btn:hover {
    background: linear-gradient(135deg, #0284C7 0%, #0891B2 100%);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
    transform: translateY(-1px);
}

.ask-ayna-btn.active {
    background: linear-gradient(135deg, #0284C7 0%, #0891B2 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: none;
}

.ask-ayna-btn .material-symbols-outlined {
    font-size: 18px;
}

.ask-ayna-btn .btn-label {
    font-weight: 600;
}

/* Keyboard shortcut hint */
.ask-ayna-btn .shortcut {
    font-size: 0.7rem;
    opacity: 0.8;
    font-weight: 500;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    margin-left: 0.25rem;
}

/* =============================================================================
   CHAT PANEL - Integrated Column
   ============================================================================= */

.chat-panel {
    width: 0;
    min-width: 0;
    height: 100%;
    background: #FAFBFC;
    border-left: 1px solid #E1E4E8;
    display: flex;
    flex-direction: column;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    overflow: hidden;
}

.chat-panel.open {
    width: 400px;
    min-width: 400px;
}

.chat-panel.no-transition {
    transition: none !important;
}

/* =============================================================================
   PANEL HEADER
   ============================================================================= */

.chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #E1E4E8;
    flex-shrink: 0;
}

/* Agent Dropdown */
.agent-selector {
    position: relative;
}

.agent-selector-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 160px;
}

.agent-selector-btn:hover {
    border-color: #0EA5E9;
    background: #F8FAFC;
}

.agent-selector-btn .agent-selector-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.agent-selector-btn .agent-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1F2937;
    flex: 1;
    text-align: left;
}

.agent-selector-btn .material-symbols-outlined {
    font-size: 18px;
    color: #6B7280;
    transition: transform 0.2s;
}

.agent-selector-btn.open .material-symbols-outlined {
    transform: rotate(180deg);
}

/* Agent Dropdown Menu */
.agent-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 320px;  /* Fixed width - wider than button */
    width: max-content;
    max-width: calc(100vw - 32px);
    background: white;
    border: 1px solid #E1E4E8;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.agent-dropdown.open {
    display: block;
}

.agent-dropdown-header {
    padding: 8px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #F9FAFB;
    border-bottom: 1px solid #E1E4E8;
}

/* Agent Search */
.agent-dropdown-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #E1E4E8;
}

.agent-dropdown-search .material-symbols-outlined {
    font-size: 18px;
    color: #9CA3AF;
}

.agent-dropdown-search input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.875rem;
    color: #1F2937;
}

.agent-dropdown-search input::placeholder {
    color: #9CA3AF;
}

.agent-dropdown-list {
    max-height: 280px;
    overflow-y: auto;
}

.agent-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.1s;
}

.agent-dropdown-item:hover {
    background: #F3F4F6;
}

.agent-dropdown-item:not(:last-child) {
    border-bottom: 1px solid #F3F4F6;
}

.agent-dropdown-item.active {
    background: #EFF6FF;
}

.agent-dropdown-item .agent-icon-small {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.agent-dropdown-item .agent-icon-small .material-symbols-outlined {
    font-size: 20px;
}

.agent-dropdown-item .agent-info {
    flex: 1;
    min-width: 0;
}

.agent-dropdown-item .agent-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1F2937;
    display: flex;
    align-items: center;
    gap: 6px;
}

.agent-dropdown-item .agent-role-tag {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.03em;
}

.agent-dropdown-item .agent-title {
    font-size: 0.75rem;
    color: #6B7280;
    margin-top: 2px;
}

.agent-dropdown-item .agent-check {
    color: #0EA5E9;
    font-size: 18px;
}

/* Header Actions */
.chat-panel-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-panel-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    text-decoration: none;
}

.chat-panel-btn:hover {
    background: #F3F4F6;
    color: #1F2937;
}

.chat-panel-btn .material-symbols-outlined {
    font-size: 20px;
}

/* =============================================================================
   CONTEXT BADGE (above input, like Rovo)
   ============================================================================= */

.chat-context-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #475569;
    margin-bottom: 8px;
    max-width: fit-content;
}

.chat-context-badge.hidden {
    display: none;
}

.chat-context-badge .material-symbols-outlined {
    font-size: 14px;
    color: #0EA5E9;
}

/* =============================================================================
   MESSAGES AREA
   ============================================================================= */

.chat-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Welcome State */
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 24px;
}

.chat-welcome-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #0EA5E9 0%, #8B5CF6 50%, #EC4899 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

.chat-welcome-icon .material-symbols-outlined {
    font-size: 32px;
    color: white;
}

.chat-welcome-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.chat-welcome-icon .material-symbols-outlined {
    font-size: 36px;
}

.agent-role-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.chat-welcome h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 8px 0;
}

.chat-welcome .agent-description {
    font-size: 0.85rem;
    color: #6B7280;
    line-height: 1.6;
    max-width: 300px;
    margin: 0 0 20px 0;
    text-align: center;
}

/* Suggested Prompts */
.suggested-prompts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 320px;
}

.suggested-prompt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    --agent-color: #0EA5E9;
}

.suggested-prompt:hover {
    border-color: var(--agent-color);
    background: #FAFBFC;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.suggested-prompt:hover .material-symbols-outlined {
    color: var(--agent-color);
}

.suggested-prompt .material-symbols-outlined {
    font-size: 18px;
    color: #9CA3AF;
    flex-shrink: 0;
    transition: color 0.15s;
}

.suggested-prompt span:last-child {
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.4;
}

/* =============================================================================
   MESSAGES - Chat Bubble Style
   ============================================================================= */

.message {
    max-width: 85%;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* User Messages - Blue bubble aligned right */
.message-self {
    align-self: flex-end;
    background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
    max-width: 75%;
    position: relative;
}

.message-self .message-content {
    color: white;
    font-size: 0.9rem;
}

.message-self .message-time {
    display: block;
    text-align: right;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 6px;
}

/* AI Messages - Plain text, no bubble */
.message-ai {
    align-self: flex-start;
    background: transparent;
    border: none;
    color: #374151;
    padding: 8px 0;
    max-width: 100%;
    box-shadow: none;
    animation: messageAppear 0.3s ease-out;
}

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

.message-ai .message-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.message-ai .message-sender {
    font-size: 0.8rem;
    font-weight: 600;
}

.message-ai .message-time {
    font-size: 0.65rem;
    color: #9CA3AF;
}

.message-ai .message-content {
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Other human messages */
.message-other {
    align-self: flex-start;
    background: #F3F4F6;
    color: #1F2937;
    padding: 10px 14px;
    border-radius: 4px 16px 16px 16px;
}

.message-other .message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

/* System messages */
.message-system {
    align-self: center;
    background: none;
    color: #9CA3AF;
    font-size: 0.8rem;
    font-style: italic;
    max-width: 100%;
    padding: 8px 0;
    text-align: center;
}

.message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6B7280;
}

.message-time {
    font-size: 0.65rem;
    color: #9CA3AF;
    margin-left: auto;
}

.message-content {
    word-break: break-word;
}

.message-content code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'SF Mono', Monaco, monospace;
}

.message-ai .message-content code {
    background: #F3F4F6;
}

/* Markdown formatting in AI responses (rendered by markdown-it) */
.message-ai .message-content p {
    margin: 0 0 8px;
}
.message-ai .message-content p:last-child {
    margin-bottom: 0;
}

.message-ai .message-content ul,
.message-ai .message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-ai .message-content li {
    margin: 4px 0;
}

.message-ai .message-content h1 {
    font-size: 1.15em;
    font-weight: 700;
    margin: 16px 0 8px;
    color: #0F172A;
}

.message-ai .message-content h2 {
    font-size: 1.1em;
    font-weight: 700;
    margin: 16px 0 8px;
    color: #0F172A;
}

.message-ai .message-content h3 {
    font-size: 1em;
    font-weight: 700;
    margin: 14px 0 6px;
    color: #0F172A;
}

.message-ai .message-content h4,
.message-ai .message-content h5 {
    font-size: 0.92em;
    font-weight: 600;
    margin: 12px 0 4px;
    color: #1E293B;
}

.message-ai .message-content pre {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 8px 0;
    overflow-x: auto;
    font-size: 0.82em;
    line-height: 1.5;
}

.message-ai .message-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

.message-ai .message-content hr {
    border: none;
    border-top: 1px solid #E2E8F0;
    margin: 12px 0;
}

.message-ai .message-content table {
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 0.88em;
    width: 100%;
}

.message-ai .message-content th,
.message-ai .message-content td {
    border: 1px solid #E2E8F0;
    padding: 6px 10px;
    text-align: left;
}

.message-ai .message-content th {
    background: #F8FAFC;
    font-weight: 600;
}

.message-ai .message-content blockquote {
    border-left: 3px solid #CBD5E1;
    margin: 8px 0;
    padding: 4px 12px;
    color: #475569;
}

.message-ai .message-content a {
    color: #3B82F6;
    text-decoration: none;
}

.message-ai .message-content a:hover {
    text-decoration: underline;
}

/* Attachments */
.attachment {
    margin-top: 8px;
}

.attachment-image img {
    max-width: 240px;
    max-height: 180px;
    border-radius: 8px;
    display: block;
}

.attachment-meta {
    font-size: 0.7rem;
    color: #9CA3AF;
    margin-top: 4px;
}

.attachment-file .attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #F3F4F6;
    border-radius: 6px;
    text-decoration: none;
    color: #0EA5E9;
    font-size: 0.8rem;
    transition: background 0.15s;
}

.attachment-file .attachment-link:hover {
    background: #E5E7EB;
}

/* =============================================================================
   ACTION CARDS - Human-in-the-Loop Write Approval
   ============================================================================= */

.message-action-card {
    align-self: flex-start;
    max-width: 100%;
    padding: 8px 0;
}

.message-action-card .message-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.action-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.action-card[data-status="executed"] {
    border-color: #A7F3D0;
    background: #F0FDF4;
}

.action-card[data-status="rejected"] {
    border-color: #E5E7EB;
    background: #F9FAFB;
    opacity: 0.8;
}

.action-card[data-status="failed"] {
    border-color: #FECACA;
    background: #FFF5F5;
}

.action-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.action-card-icon {
    font-size: 16px;
    color: #6B7280;
}

.action-card-entity {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    text-transform: capitalize;
}

.action-card-dot {
    color: #9CA3AF;
    font-size: 0.75rem;
}

.action-card-action {
    font-size: 0.75rem;
    color: #6B7280;
    text-transform: capitalize;
}

.action-card-summary {
    font-size: 0.875rem;
    color: #1F2937;
    line-height: 1.5;
    margin-bottom: 12px;
}

.action-card-buttons {
    display: flex;
    gap: 8px;
}

.action-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.action-card-btn .material-symbols-outlined {
    font-size: 18px;
}

.action-card-btn.approve {
    background: #ECFDF5;
    border-color: #10B981;
    color: #065F46;
}

.action-card-btn.approve:hover {
    background: #D1FAE5;
}

.action-card-btn.reject {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #6B7280;
}

.action-card-btn.reject:hover {
    background: #F3F4F6;
    border-color: #9CA3AF;
}

.action-card-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.action-card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.action-card-status .material-symbols-outlined {
    font-size: 16px;
}

.action-card-status.executed {
    background: #ECFDF5;
    color: #065F46;
}

.action-card-status.executed .material-symbols-outlined {
    color: #10B981;
}

.action-card-status.rejected {
    background: #F3F4F6;
    color: #6B7280;
}

.action-card-status.rejected .material-symbols-outlined {
    color: #9CA3AF;
}

.action-card-status.failed {
    background: #FEF2F2;
    color: #991B1B;
}

.action-card-status.failed .material-symbols-outlined {
    color: #EF4444;
}

/* Typing Indicator */
.chat-panel-typing {
    padding: 8px 16px;
    font-size: 0.8rem;
    color: #6B7280;
    font-style: italic;
    background: #FAFBFC;
    border-top: 1px solid #E1E4E8;
    flex-shrink: 0;
}

/* Error Display */
.chat-panel-error {
    margin: 0 16px 8px;
    font-size: 0.8rem;
    color: #DC2626;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 6px;
    padding: 8px 12px;
}

/* =============================================================================
   INPUT AREA
   ============================================================================= */

.chat-panel-input {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #E1E4E8;
    flex-shrink: 0;
    position: relative;
}

.chat-panel-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #F9FAFB;
    border: 1px solid #E1E4E8;
    border-radius: 12px;
    padding: 10px 12px;
    transition: all 0.15s;
}

.chat-panel-input-wrapper:focus-within {
    border-color: #0EA5E9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    background: white;
}

.chat-panel-textarea {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    resize: none;
    font-size: 0.875rem;
    line-height: 1.5;
    min-height: 48px; /* 2 lines minimum */
    max-height: 120px;
    font-family: inherit;
    color: #1F2937;
}

.chat-panel-textarea::placeholder {
    color: #9CA3AF;
}

.chat-panel-input-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-input-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.chat-input-btn:hover {
    background: #E5E7EB;
    color: #6B7280;
}

.chat-input-btn .material-symbols-outlined {
    font-size: 20px;
}

.chat-panel-send {
    background: #0EA5E9;
    color: white;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.chat-panel-send:hover {
    background: #0284C7;
}

.chat-panel-send:disabled {
    background: #D1D5DB;
    cursor: not-allowed;
}

.chat-panel-send .material-symbols-outlined {
    font-size: 18px;
}

/* =============================================================================
   FEEDBACK SECTION
   ============================================================================= */

.chat-panel-feedback {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 0;
    margin-top: 8px;
    border-top: 1px solid #E5E7EB;
}

.feedback-label {
    font-size: 0.75rem;
    color: #6B7280;
}

.feedback-label #feedback-agent-name {
    font-weight: 600;
    color: #374151;
}

.feedback-buttons {
    display: flex;
    gap: 4px;
}

.feedback-btn {
    background: none;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.feedback-btn:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
    color: #6B7280;
}

.feedback-btn[data-rating="up"]:hover {
    color: #10B981;
    border-color: #10B981;
    background: #ECFDF5;
}

.feedback-btn[data-rating="down"]:hover {
    color: #EF4444;
    border-color: #EF4444;
    background: #FEF2F2;
}

.feedback-btn.selected[data-rating="up"] {
    color: #10B981;
    border-color: #10B981;
    background: #ECFDF5;
}

.feedback-btn.selected[data-rating="down"] {
    color: #EF4444;
    border-color: #EF4444;
    background: #FEF2F2;
}

.feedback-btn .material-symbols-outlined {
    font-size: 16px;
}

/* =============================================================================
   AI DISCLAIMER
   ============================================================================= */

.chat-panel-disclaimer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #F9FAFB;
    border-top: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.disclaimer-icon {
    font-size: 14px;
    color: #9CA3AF;
    cursor: help;
}

.disclaimer-text {
    font-size: 0.7rem;
    color: #9CA3AF;
    line-height: 1.4;
}

.disclaimer-detail {
    color: #6B7280;
    cursor: help;
    border-bottom: 1px dotted #9CA3AF;
}

.disclaimer-detail:hover,
.disclaimer-icon:hover {
    color: #374151;
}

/* =============================================================================
   @-MENTION PICKER
   ============================================================================= */

.chat-panel-mention-picker {
    position: absolute;
    bottom: 100%;
    left: 16px;
    right: 16px;
    background: white;
    border: 1px solid #E1E4E8;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.chat-panel-mention-picker.visible {
    display: block;
}

.chat-panel-mention-header {
    padding: 8px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #E1E4E8;
    background: #F9FAFB;
}

.chat-panel-mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.chat-panel-mention-item:hover {
    background: #F3F4F6;
}

.chat-panel-mention-item .mention-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-panel-mention-item .mention-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1F2937;
}

.chat-panel-mention-item .mention-title {
    font-size: 0.75rem;
    color: #6B7280;
    margin-left: auto;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 1400px) {
    .chat-panel.open {
        width: 360px;
        min-width: 360px;
    }
}

@media (max-width: 1200px) {
    .chat-panel.open {
        width: 340px;
        min-width: 340px;
    }

    .ask-ayna-btn .btn-label {
        display: none;
    }

    .ask-ayna-btn .shortcut {
        display: none;
    }
}

@media (max-width: 992px) {
    /* On tablets, use overlay mode */
    .chat-panel {
        position: fixed;
        top: 57px;
        right: 0;
        bottom: 0;
        z-index: 800;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        width: 380px !important;
        min-width: 380px !important;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .chat-panel.open {
        transform: translateX(0);
    }

    .chat-panel.no-transition {
        transition: none !important;
    }
}

@media (max-width: 480px) {
    .chat-panel {
        width: 100vw !important;
        min-width: 100vw !important;
    }

    .ask-ayna-btn {
        padding: 0.5rem;
    }

    .ask-ayna-btn .btn-label,
    .ask-ayna-btn .shortcut {
        display: none;
    }
}

/* =============================================================================
   LOADING STATES
   ============================================================================= */

.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: #9CA3AF;
    font-size: 0.875rem;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: #9CA3AF;
    border-radius: 50%;
    animation: loadingDot 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingDot {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* =============================================================================
   LOCKED AGENTS (Tier Enforcement)
   ============================================================================= */

/* Dropdown divider before locked agents */
.agent-dropdown-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 8px 0;
}

/* Locked agents section header */
.agent-dropdown-locked-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agent-dropdown-locked-header .material-symbols-outlined {
    font-size: 14px;
}

/* Locked agent item in dropdown */
.agent-dropdown-item.locked {
    cursor: not-allowed;
    opacity: 0.7;
}

.agent-dropdown-item.locked:hover {
    background: transparent;
}

/* Tier badge for locked agents */
.agent-lock-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    background: var(--gray-100, #F3F4F6);
    color: var(--gray-500, #6B7280);
    border-radius: 4px;
    margin-left: auto;
    white-space: nowrap;
}

/* Locked mention items */
.chat-panel-mention-item.locked {
    cursor: not-allowed;
    opacity: 0.6;
}

.chat-panel-mention-item.locked:hover {
    background: transparent;
}

.chat-panel-mention-item .mention-tier {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    background: #F3F4F6;
    color: #6B7280;
    border-radius: 4px;
    margin-left: auto;
}

/* =============================================================================
   UPGRADE PROMPT
   ============================================================================= */

.upgrade-prompt {
    margin-bottom: 12px;
    animation: slideDown 0.2s ease-out;
}

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

.upgrade-prompt-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 1px solid #F59E0B;
    border-radius: 12px;
}

.upgrade-prompt-content > .material-symbols-outlined {
    font-size: 20px;
    color: #B45309;
    flex-shrink: 0;
}

.upgrade-prompt-text {
    flex: 1;
    font-size: 0.85rem;
    color: #78350F;
    line-height: 1.4;
}

.upgrade-prompt-text strong {
    font-weight: 600;
}

.upgrade-link {
    color: #B45309;
    font-weight: 600;
    text-decoration: underline;
    margin-left: 4px;
}

.upgrade-link:hover {
    color: #92400E;
}

.upgrade-prompt-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #B45309;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.15s;
}

.upgrade-prompt-close:hover {
    background: rgba(180, 83, 9, 0.15);
}

.upgrade-prompt-close .material-symbols-outlined {
    font-size: 18px;
}
