/* 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 18px;
    border-radius: 14px;
    word-wrap: break-word;
}

.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;
}

.inf-chat-author {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #6b7280;
}

.inf-chat-content {
    font-size: 14px;
    line-height: 1.6;
    color: inherit;
}

.inf-chat-received .inf-chat-content {
    color: #000000;
}

.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-footer-text-actions {
    margin-right: 2px;
}

.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;
}

/* 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: #10b981;
    cursor: pointer;
    padding: 6px 10px;
    font-size: 12px;
    transition: color 0.2s;
}

.inf-chat-code-btn:hover {
    color: #34d399;
}

.inf-chat-copy-btn {
    color: #60a5fa;
}

.inf-chat-copy-btn:hover {
    color: #3b82f6;
}

.inf-chat-code-content {
    margin: 0;
    padding: 12px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    color: #1e1e1e;
    line-height: 1.6;
}

.inf-chat-code-content code {
    font-family: inherit;
}

/* 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: space-between;
    align-items: center;
    margin-top: 12px;
}

.inf-chat-actions-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 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;
}

/* Provider Select */
.inf-chat-provider-select {
    min-width: 120px;
    padding: 10px 14px;
    font-size: 14px;
    color: #374151;
    background-color: #f3f4f6;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    outline: none;
}

.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 {
    color: #374151;
    background-color: #f3f4f6;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    padding: 14px 16px;
    width: 100%;
    cursor: pointer;
    outline: none;
}

.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;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    transition: color 0.2s;
}

.inf-chat-send-btn:hover {
    color: #033a52;
}

.inf-chat-send-btn:disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

/* Mode Toggle */
.inf-chat-mode-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: #f3f4f6;
    border-radius: 20px;
    padding: 4px;
    margin: 0 16px;
}

.inf-chat-mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inf-chat-mode-btn:hover {
    color: #374151;
    background-color: rgba(0, 0, 0, 0.05);
}

.inf-chat-mode-btn.inf-chat-mode-active {
    background-color: #ffffff;
    color: #045474;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.inf-chat-mode-btn i {
    font-size: 14px;
}

/* Mode Toggle Bar */
.inf-chat-mode-toggle-bar {
    display: flex;
    justify-content: center;
    padding: 8px 16px;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

/* Settings Panel */
.inf-chat-settings-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 24px;
    background-color: #f9fafb;
}

.inf-chat-settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.inf-chat-settings-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inf-chat-settings-field-grow {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.inf-chat-settings-field-half {
    flex: 1;
}

.inf-chat-settings-row {
    display: flex;
    gap: 16px;
}

.inf-chat-settings-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.inf-chat-settings-input,
.inf-chat-settings-select {
    padding: 12px 16px;
    font-size: 14px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #1f2937;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.inf-chat-settings-input:focus,
.inf-chat-settings-select:focus {
    border-color: #045474;
    box-shadow: 0 0 0 3px rgba(4, 84, 116, 0.1);
}

.inf-chat-settings-input::placeholder {
    color: #9ca3af;
}

.inf-chat-settings-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.inf-chat-settings-textarea {
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #1f2937;
    outline: none;
    resize: vertical;
    min-height: 120px;
    flex: 1;
    line-height: 1.6;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.inf-chat-settings-textarea:focus {
    border-color: #045474;
    box-shadow: 0 0 0 3px rgba(4, 84, 116, 0.1);
}

.inf-chat-settings-textarea::placeholder {
    color: #9ca3af;
}

/* Settings Actions */
.inf-chat-settings-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 16px;
    margin-top: auto;
}

.inf-chat-settings-save-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background-color: #045474;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.inf-chat-settings-save-btn:hover:not(:disabled) {
    background-color: #033d55;
}

.inf-chat-settings-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
