/* Infinity Chat Component Styles */

.inf-chat-wrapper {
    display: block;
    height: 100%;
    width: 100%;
    font-size: 14px;
}

.inf-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background-color: #ffffff;
    border-radius: 14px;
    position: relative;
    overflow: visible;
}

/* Loading Overlay */
.inf-chat-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.inf-chat-spinner {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 16px;
    color: #374151;
}

.inf-chat-spinner-circle {
    width: 36px;
    height: 36px;
    border: 4px solid #e5e7eb;
    border-top-color: #045474;
    border-radius: 50%;
    animation: inf-chat-spin 1s linear infinite;
}

@keyframes inf-chat-spin {
    to { transform: rotate(360deg); }
}

/* Header */
.inf-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    color: #045474;
    padding: 18px 22px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid #ECECEC;
}

.inf-chat-title {
    flex: 1;
}

.inf-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.inf-chat-header-btn {
    background: none;
    border: none;
    color: #045474;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: opacity 0.2s;
}

.inf-chat-header-btn:hover {
    opacity: 0.7;
}

.inf-chat-header-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Message List */
.inf-chat-message-list {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.inf-chat-message-list::-webkit-scrollbar {
    width: 10px;
}

.inf-chat-message-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 5px;
}

/* Message Container */
.inf-chat-message-container {
    display: flex;
    margin-bottom: 14px;
}

.inf-chat-sent {
    justify-content: flex-end;
}

.inf-chat-received {
    justify-content: flex-start;
}

/* Message Bubble */
.inf-chat-message-bubble {
    max-width: 80%;
    padding: 14px 42px 14px 18px;
    border-radius: 14px;
    position: relative;
    word-wrap: break-word;
}

.inf-chat-message-has-code .inf-chat-message-bubble {
    max-width: 95%;
}

.inf-chat-sent .inf-chat-message-bubble {
    background-color: #045474;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.inf-chat-received .inf-chat-message-bubble {
    background-color: #f3f4f6;
    color: #111827;
    border-bottom-left-radius: 4px;
    width: 95%;
}

.inf-chat-author {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
    color: #6b7280;
}

.inf-chat-content {
    font-size: 14px;
    line-height: 1.6;
    color: inherit;
}

.inf-chat-received .inf-chat-content {
    color: #000000;
}

.inf-chat-author + .inf-chat-content {
    margin-top: 0;
}

.inf-chat-text-block {
    white-space: pre-wrap;
}

.inf-chat-text-block-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inf-chat-text-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.inf-chat-text-block-title {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.85;
}

.inf-chat-text-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}


.inf-chat-canceled-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.inf-chat-footer-text-actions {
    margin-right: 2px;
}

.inf-chat-timestamp-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.inf-chat-retry-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.15s, background 0.15s;
}

.inf-chat-retry-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.08);
}

.inf-chat-retry-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    white-space: nowrap;
    background: rgba(30, 30, 30, 0.88);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.inf-chat-retry-btn:hover::after {
    opacity: 1;
}

.inf-chat-text-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 13px;
}

.inf-chat-sent .inf-chat-text-btn {
    color: #045474;
    background-color: #ffffff;
}

.inf-chat-received .inf-chat-text-btn {
    color: #374151;
    background-color: #e5e7eb;
}

.inf-chat-message-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.65;
}

.inf-chat-message-copy-btn:hover {
    opacity: 1;
}

.inf-chat-sent .inf-chat-message-copy-btn {
    color: #ffffff;
}

.inf-chat-received .inf-chat-message-copy-btn {
    color: #6b7280;
}

/* Code Block */
.inf-chat-code-block {
    margin: 12px 0;
    border-radius: 10px;
    overflow: hidden;
    background-color: #1e1e1e;
}

.inf-chat-code-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background-color: #2d2d2d;
    font-size: 12px;
}

.inf-chat-code-lang {
    color: #9ca3af;
    text-transform: uppercase;
}

.inf-chat-code-filename {
    color: #6b7280;
    flex: 1;
}

.inf-chat-code-btn {
    background: none;
    border: none;
    color: #60a5fa;
    cursor: pointer;
    padding: 6px 10px;
    font-size: 12px;
    transition: color 0.2s;
}

.inf-chat-code-btn:hover {
    color: #3b82f6;
}

.inf-chat-copy-btn {
    color: #60a5fa;
}

.inf-chat-copy-btn:hover {
    color: #3b82f6;
}

.inf-chat-code-content {
    margin: 0;
    padding: 12px;
    overflow: hidden;
}

.inf-chat-code-content .inf-basic-code-editor {
    margin-top: 0;
}

/* Footer (Timestamp + Tokens) */
.inf-chat-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.inf-chat-timestamp {
    font-size: 12px;

    opacity: 0.7;
}

.inf-chat-token-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #6b7280;
    background-color: #f3f4f6;
    padding: 3px 10px;
    border-radius: 10px;
}

.inf-chat-token-badge i {
    font-size: 12px;
}

/* Attachments */
.inf-chat-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.inf-chat-attachment-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    font-size: 14px;
}

.inf-chat-attachment-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Typing Indicator */
.inf-chat-typing-container {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 16px;
}

.inf-chat-typing-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background-color: #f3f4f6;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}

.inf-chat-typing-dot {
    width: 12px;
    height: 12px;
    background-color: #9ca3af;
    border-radius: 50%;
    animation: inf-chat-typing 1.4s infinite ease-in-out both;
}

.inf-chat-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.inf-chat-typing-dot:nth-child(2) { animation-delay: -0.16s; }
.inf-chat-typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes inf-chat-typing {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input Form */
.inf-chat-input-form {
    padding: 12px;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    position: relative;
    overflow: visible;
    z-index: 2;
}

.inf-chat-textarea {
    width: 100%;
    box-sizing: border-box;
    border: none;
    background-color: transparent;
    padding: 14px 10px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: none;
    overflow-y: auto;
    max-height: 160px;
    min-height: 50px;
    color: #1f2937;
}

.inf-chat-textarea::placeholder {
    color: #9ca3af;
    font-size: 14px;
}

.inf-chat-textarea:focus {
    outline: none;
}

/* Attachment Preview */
.inf-chat-attachment-preview {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    padding: 0 10px;
    flex-wrap: wrap;
}

.inf-chat-file-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #e5e7eb;
    padding: 2px 2px 2px 4px;
    border-radius: 12px;
    font-size: 12px;
    color: #374151;
}

.inf-chat-file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.inf-chat-remove-file-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border-radius: 50%;
    transition: color 0.2s;
}

.inf-chat-remove-file-btn:hover {
    color: #374151;
}

/* Input Actions */
.inf-chat-input-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    min-width: 0;
    width: 100%;
}

.inf-chat-actions-left {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    gap: 10px;
    min-width: 0;
}

/* Menu Wrapper */
.inf-chat-menu-wrapper {
    position: relative;
}

/* Context Button */
.inf-chat-context-btn {
    background-color: #DBDADA;
    color: #374151;
    border: none;
    border-radius: 20px;
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background-color 0.2s;
}

.inf-chat-context-btn:hover {
    background-color: #c9c9c9;
}

/* Context Menu */
.inf-chat-context-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 10px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
}

.inf-chat-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: background-color 0.2s;
}

.inf-chat-menu-item:hover {
    background-color: #f3f4f6;
}

.inf-chat-menu-item i {
    width: 24px;
    text-align: center;
    color: #6b7280;
    font-size: 19px;
}
.inf-chat-menu-caret {
    margin-left: auto;
    width: auto !important;
    font-size: 14px !important;
}

.inf-chat-context-filter-panel {
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
    padding: 10px;
    width: 280px;
}

.inf-chat-context-filter-search {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    color: #374151;
    background-color: #ffffff;
    outline: none;
}

.inf-chat-context-filter-search:focus {
    border-color: #0ea5e9;
}

.inf-chat-context-filter-list {
    margin-top: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.inf-chat-context-filter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    border: none;
    border-radius: 6px;
    padding: 9px 10px;
    background-color: transparent;
    color: #374151;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.inf-chat-context-filter-item:hover {
    background-color: #eef2f7;
}

.inf-chat-context-filter-item:disabled {
    cursor: wait;
    opacity: 0.7;
}

.inf-chat-context-filter-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inf-chat-context-filter-item small {
    color: #6b7280;
    font-size: 11px;
}

.inf-chat-context-filter-status {
    padding: 10px;
    color: #6b7280;
    font-size: 13px;
}

.inf-chat-context-filter-error {
    color: #b91c1c;
}

/* Provider Select */
.inf-chat-provider-select {
    width: 120px;
    min-width: 120px;
}

.inf-chat-provider-select:focus {
    box-shadow: 0 0 0 2px rgba(4, 84, 116, 0.2);
}

/* Model Dots Button */
.inf-chat-model-dots-btn {
    background: none;
    border: none;
    color: #374151;
    cursor: pointer;
    padding: 10px;
    font-size: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.inf-chat-model-dots-btn:hover {
    color: #1f2937;
}

/* Model Menu */
.inf-chat-model-menu {
    position: absolute;
    bottom: 100%;
    left: -50px;
    margin-bottom: 10px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    z-index: 100;
    padding: 18px;
}

.inf-chat-model-menu-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inf-chat-model-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

.inf-chat-label-disabled {
    opacity: 0.6;
    color: #9ca3af;
}

.inf-chat-model-select {
    width: 170px;
    min-width: 170px;
}

.inf-chat-model-select:disabled {
    opacity: 0.6;
    pointer-events: none;
    background-color: #e5e7eb;
}

.inf-chat-model-select:focus {
    border-color: #045474;
}

.inf-chat-model-input {
    padding: 14px 16px;
    font-size: 14px;
    background-color: #f3f4f6;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-sizing: border-box;
    width: 100%;
    outline: none;
    color: #2d2d2d;
}

.inf-chat-model-input:focus {
    border-color: #045474;
}

/* Send Button */
.inf-chat-send-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #045474;
    flex: 0 0 42px;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 8px;
    transition: color 0.2s;
}

.inf-chat-send-btn:hover {
    color: #033a52;
}

.inf-chat-send-btn:disabled {
    color: #d1d5db;
    cursor: not-allowed;
}
/* Inline provider/model selector overrides */
.inf-chat-model-controls {
    display: flex;
    align-items: flex-end;
    flex: 0 1 auto;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
}

.inf-chat-select-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
/*    min-width: 112px;*/
}

.inf-chat-select-field span {
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.inf-chat-provider-select,
.inf-chat-deployment-select,
.inf-chat-model-select {
    height: 38px;
    box-sizing: border-box;
    color: #374151;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.2;
    outline: none;
    padding: 8px 10px;
}

.inf-chat-provider-select {
    width: 120px;
    min-width: 120px;
}

.inf-chat-deployment-select {
    width: 88px;
    min-width: 88px;
}

.inf-chat-model-field {
    flex: 0 0 170px;
    min-width: 170px;
}

.inf-chat-model-select {
    width: 170px;
    min-width: 170px;
}

.inf-chat-provider-select:focus,
.inf-chat-deployment-select:focus,
.inf-chat-model-select:focus {
    border-color: #045474;
    box-shadow: 0 0 0 2px rgba(4, 84, 116, 0.14);
}

.inf-chat-filter-override-panel {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}

.inf-chat-filter-override-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    min-width: 145px;
}

.inf-chat-filter-override-field span {
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.inf-chat-filter-override-operator {
    color: #9ca3af !important;
    font-size: 10px !important;
    font-style: italic !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
}

.inf-chat-filter-paging-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-right: 4px;
}

.inf-chat-filter-paging-field {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    justify-content: space-between;
    min-width: 112px;
}

.inf-chat-filter-paging-input {
    flex: 0 0 42px;
    padding-left: 4px !important;
    padding-right: 4px !important;
    text-align: center;
    width: 42px !important;
}

.inf-chat-filter-override-input {
    height: 30px;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #ffffff;
    color: #374151;
    font-size: 12px;
    outline: none;
    padding: 5px 8px;
    width: 145px;
}

.inf-chat-filter-override-input:focus {
    border-color: #045474;
    box-shadow: 0 0 0 2px rgba(4, 84, 116, 0.12);
}

.inf-chat-filter-override-checkbox {
    width: 18px;
    height: 18px;
    margin: 6px 0;
}

.inf-chat-filter-ref-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.inf-chat-filter-ref-wrap .inf-chat-file-pill {
    flex: 0 1 auto;
    max-width: 100%;
}

.inf-chat-edit-filter-btn {
    border: none;
    background: transparent;
    color: #045474;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 2px;
    white-space: nowrap;
}

.inf-chat-edit-filter-btn:hover {
    text-decoration: underline;
}

.ia-chat-panel.ia-chat-panel--expanded .inf-chat-input-actions {
    justify-content: space-between;
}

.ia-chat-panel.ia-chat-panel--expanded .inf-chat-actions-left {
    flex: 1 1 auto;
}

.ia-chat-panel.ia-chat-panel--expanded .inf-chat-model-controls {
    flex: 0 1 auto;
}

.ia-chat-panel.ia-chat-panel--expanded .inf-chat-model-field {
    flex: 0 0 170px;
}