


:root {

    --ai-primary: #4361ee;
    --ai-secondary: #3f8efc;
    --ai-accent: #4cc9f0;
    --ai-light: #f8f9fa;
    --ai-dark: #212529;
    --ai-gray: #6c757d;
    --ai-light-gray: #e9ecef;
    --ai-border-radius: 12px;
    --ai-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --ai-transition: all 0.3s ease;

}


/* Sidebar Styles */
.ai-sidebar {
    width: 280px;
    background-color: white;
    border-right: 1px solid var(--ai-light-gray);
    display: flex;
    flex-direction: column;
    transition: var(--ai-transition);
    z-index: 10;
}

.ai-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--ai-light-gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-sidebar-title i {
    color: var(--ai-primary);
}

.ai-new-chat-btn {
    background-color: var(--ai-primary);
    color: white;
    border: none;
    border-radius: var(--ai-border-radius);
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 16px;
    transition: var(--ai-transition);
}

.ai-new-chat-btn:hover {
    background-color: var(--ai-secondary);
    transform: translateY(-1px);
}

.ai-conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.ai-conversation-item {
    padding: 12px 16px;
    border-radius: var(--ai-border-radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--ai-transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-conversation-item:hover {
    background-color: var(--ai-light-gray);
}

.ai-conversation-item.ai-active {
    background-color: rgba(67, 97, 238, 0.1);
    border-left: 3px solid var(--ai-primary);
}

.ai-conversation-icon {
    color: var(--ai-gray);
    width: 20px;
}

.ai-conversation-title {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.ai-conversation-time {
    font-size: 0.7rem;
    color: var(--ai-gray);
}

.ai-sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--ai-light-gray);
}

.ai-user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--ai-light-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ai-gray);
    font-size: 1rem;
}

.ai-user-info {
    flex: 1;
}

.ai-user-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.ai-user-status {
    font-size: 0.8rem;
    color: var(--ai-gray);
}

.ai-settings-btn {
    background: none;
    border: none;
    color: var(--ai-gray);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--ai-transition);
}

.ai-settings-btn:hover {
    color: var(--ai-dark);
}

/* Main Content Area */
.ai-main {
    flex: 1;
    display: flex;
    position: relative;
    background-color: var(--ai-light);
}

.ai-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.ai-chat-header {
    padding: 16px 24px;
    background-color: white;
    border-bottom: 1px solid var(--ai-light-gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 5;
    position: sticky;
    top: 0;
}

.ai-chat-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.ai-chat-actions {
    display: flex;
    gap: 12px;
}

.ai-action-btn {
    background: none;
    border: none;
    color: var(--ai-gray);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ai-transition);
}

.ai-action-btn:hover {
    background-color: var(--ai-light-gray);
    color: var(--ai-dark);
}

.ai-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ai-message {
    display: flex;
    gap: 16px;
    max-width: 80%;
    animation: ai-fade-in 0.3s ease;
}

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

.ai-message.ai-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--ai-light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-message.ai-assistant .ai-message-avatar {
    background-color: var(--ai-primary);
    color: white;
}

.ai-message-bubble {
    background-color: white;
    padding: 14px 18px;
    border-radius: var(--ai-border-radius);
    border-top-left-radius: 0;
    box-shadow: var(--ai-shadow);
    line-height: 1.5;
}

.ai-message.ai-user .ai-message-bubble {
    background-color: var(--ai-primary);
    color: white;
    border-top-left-radius: var(--ai-border-radius);
    border-top-right-radius: 0;
}

.ai-message-time {
    font-size: 0.7rem;
    color: var(--ai-gray);
    margin-top: 6px;
    align-self: flex-end;
}

.ai-message.ai-user .ai-message-time {
    color: rgba(255, 255, 255, 0.8);
}

.ai-input-area {
    padding: 14px 14px;
    border-radius: 16px;
    background-color: white;
    display: flex;
    align-items: center;
    position: sticky;
    bottom: 0;
    z-index: 10;
    width: 100%;
}

.ai-attachment-btn {
    background: none;
    border: none;
    color: var(--ai-gray);
    cursor: pointer;
    font-size: 1.1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ai-transition);
}

.ai-attachment-btn:hover {
    background-color: var(--ai-light-gray);
    color: var(--ai-dark);
}

.ai-input-field {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.ai-input-field textarea {
    width: 100%;
    border: 1px solid var(--ai-light-gray);
    border-radius: var(--ai-border-radius);
    padding: 12px 16px;
    padding-right: 50px;
    min-height: 50px;
    max-height: 120px;
    resize: none;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: var(--ai-transition);
}

.ai-input-field textarea:focus {
    outline: none;
    border-color: var(--ai-secondary);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.ai-voice-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--ai-gray);
    cursor: pointer;
    font-size: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ai-transition);
}

.ai-voice-btn:hover {
    background-color: var(--ai-light-gray);
    color: var(--ai-primary);
}

.ai-send-btn {
    background-color: var(--ai-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--ai-transition);
}

.ai-send-btn:hover {
    background-color: var(--ai-secondary);
    transform: scale(1.05);
}

.ai-send-btn:disabled {
    background-color: var(--ai-light-gray);
    color: var(--ai-gray);
    cursor: not-allowed;
    transform: none;
}

/* Responsive styles */
@media (max-width: 768px) {
    .ai-sidebar {
        position: absolute;
        left: -280px;
        height: 100%;
    }

    .ai-sidebar.ai-show {
        left: 0;
    }

    .ai-message {
        max-width: 90%;
    }
}

/* Toggle button for mobile */
.ai-toggle-sidebar {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--ai-primary);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--ai-shadow);
    z-index: 100;
    transition: var(--ai-transition);
}

.ai-toggle-sidebar:hover {
    background-color: var(--ai-secondary);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .ai-toggle-sidebar {
        display: flex;
    }
}

/* Right panel (collapsible chat window) */
.ai-panel {
    width: 350px;
    background-color: white;
    border-left: 1px solid var(--ai-light-gray);
    display: flex;
    flex-direction: column;
    transition: var(--ai-transition);
    transform: translateX(100%);
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 20;
}

.ai-panel.ai-show {
    transform: translateX(0);
}

.ai-panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--ai-light-gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-panel-title {
    font-size: 1rem;
    font-weight: 600;
}

.ai-panel-close {
    background: none;
    border: none;
    color: var(--ai-gray);
    cursor: pointer;
    font-size: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ai-transition);
}

.ai-panel-close:hover {
    background-color: var(--ai-light-gray);
    color: var(--ai-dark);
}

.ai-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.ai-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 5;
}

.ai-overlay.ai-show {
    display: block;
}

/* File attachment preview */
.ai-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: var(--ai-light);
    border-radius: var(--ai-border-radius);
    margin-bottom: 10px;
    animation: ai-fade-in 0.3s ease;
}

.ai-file-icon {
    color: var(--ai-primary);
    font-size: 1.2rem;
}

.ai-file-name {
    font-size: 0.85rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-file-remove {
    background: none;
    border: none;
    color: var(--ai-gray);
    cursor: pointer;
    font-size: 0.9rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-file-remove:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--ai-dark);
}

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

.ai-welcome-icon {
    font-size: 3rem;
    color: var(--ai-primary);
    margin-bottom: 24px;
}

.ai-welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.ai-welcome-subtitle {
    font-size: 1rem;
    color: var(--ai-gray);
    max-width: 500px;
    margin-bottom: 32px;
}

.ai-suggestions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 600px;
    width: 100%;
}

.ai-suggestion {
    padding: 16px;
    background-color: white;
    border-radius: var(--ai-border-radius);
    border: 1px solid var(--ai-light-gray);
    text-align: left;
    cursor: pointer;
    transition: var(--ai-transition);
}

.ai-suggestion:hover {
    border-color: var(--ai-primary);
    transform: translateY(-2px);
    box-shadow: var(--ai-shadow);
}

.ai-suggestion-icon {
    color: var(--ai-primary);
    margin-bottom: 8px;
}

.ai-suggestion-text {
    font-size: 0.9rem;
}

/* Typing indicator */
.ai-typing {
    display: flex;
    gap: 4px;
    padding: 6px 10px;
    background-color: var(--ai-light-gray);
    border-radius: 12px;
    width: fit-content;
    margin-top: 10px;
}

.ai-typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--ai-gray);
    border-radius: 50%;
    animation: ai-typing 1.2s infinite ease-in-out;
}

.ai-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ai-typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

.small-loading-spinner {
    width: 25px;
    height: 25px;
    border: 4px solid #e3f2fd;
    border-top: 4px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}


.ai-textarea {
    width: 100%;
    min-height: 40px;
    max-height: 120px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    background-color: white;
    position: relative;
}

/* Placeholder con ::before */
.ai-textarea[contenteditable]:empty::before {
    content: attr(data-placeholder);
    color: #6c757d;
    position: absolute;
    pointer-events: none;
    opacity: 1;
}

.ai-textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Scrollbar */
.ai-textarea::-webkit-scrollbar {
    width: 6px;
}

.ai-textarea::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.ai-placeholder {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #6c757d;
    pointer-events: none;
    display: none;
}

.ai-textarea:empty + .ai-placeholder {
    display: block;
}

.disabledbox {
    background-color: #f5f5f5;     /* Fondo gris claro */
    color: #6c757d;                /* Texto gris */
    cursor: not-allowed;           /* Cursor de "no permitido" */
    opacity: 0.6;                  /* Transparencia para efecto deshabilitado */
    pointer-events: none;          /* Deshabilita todos los eventos del mouse */
    user-select: none;             /* Evita selección de texto */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Opcional: Efecto de desenfoque sutil */
.disabledbox {
    filter: grayscale(20%);        /* Un poco de escala de grises */
}

/* Opcional: Border diferente cuando está deshabilitado */
.disabledbox {
    border-color: #dee2e6 !important;
    box-shadow: none !important;
}


.icon-circle img {
    animation: robotFloat 3s ease-in-out infinite;
}

@keyframes robotFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}


/* ========================================
   AI Action Button Component
   ======================================== */

.ai-action-wrapper {
    position: relative;
    display: inline-block;
}

/* Trigger Button */
.ai-action-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    font-family: inherit;
}

.ai-action-trigger::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.ai-action-trigger:hover::before {
    left: 100%;
}

/* Gradient variant (default) */
.ai-action-btn-gradient {
    background: linear-gradient(135deg, var(--ai-primary) 0%, #7c3aed 50%, var(--ai-accent) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.4);
}

.ai-action-btn-gradient:hover {
    box-shadow: 0 6px 25px rgba(67, 97, 238, 0.55);
    transform: translateY(-2px);
}

/* Outline variant */
.ai-action-btn-outline {
    background: transparent;
    color: var(--ai-primary);
    border: 2px solid var(--ai-primary);
    box-shadow: none;
}

.ai-action-btn-outline:hover {
    background: rgba(67, 97, 238, 0.08);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
    transform: translateY(-1px);
}

/* Subtle variant */
.ai-action-btn-subtle {
    background: rgba(67, 97, 238, 0.1);
    color: var(--ai-primary);
    box-shadow: none;
}

.ai-action-btn-subtle:hover {
    background: rgba(67, 97, 238, 0.18);
    transform: translateY(-1px);
}

/* Sizes */
.ai-action-btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
    gap: 6px;
}

.ai-action-btn-md {
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 12px;
}

.ai-action-btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: 14px;
    gap: 10px;
}

/* Trigger icon */
.ai-action-trigger-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.ai-sparkle-icon {
    width: 18px;
    height: 18px;
    animation: ai-sparkle-pulse 2s ease-in-out infinite;
}

.ai-action-btn-sm .ai-sparkle-icon {
    width: 14px;
    height: 14px;
}

.ai-action-btn-lg .ai-sparkle-icon {
    width: 22px;
    height: 22px;
}

@keyframes ai-sparkle-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.15) rotate(15deg); opacity: 0.85; }
}

/* Trigger chevron */
.ai-action-trigger-chevron {
    display: flex;
    align-items: center;
    font-size: 0.7em;
    transition: transform 0.3s ease;
}

.ai-action-trigger-active .ai-action-trigger-chevron {
    transform: rotate(180deg);
}

/* Loading state */
.ai-action-trigger-loading {
    pointer-events: none;
    opacity: 0.85;
}

.ai-action-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.ai-action-btn-outline .ai-action-spinner,
.ai-action-btn-subtle .ai-action-spinner {
    border-color: rgba(67, 97, 238, 0.3);
    border-top-color: var(--ai-primary);
}

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

/* Success state */
.ai-action-trigger-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4) !important;
}

/* Error state */
.ai-action-trigger-error {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4) !important;
}

/* Dropdown */
.ai-action-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.ai-action-dropdown-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Dropdown header */
.ai-action-dropdown-header {
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--ai-light-gray);
}

.ai-action-dropdown-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ai-gray);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-sparkle-icon-sm {
    width: 14px;
    height: 14px;
    color: var(--ai-primary);
}

/* Dropdown list */
.ai-action-dropdown-list {
    padding: 8px;
    max-height: 320px;
    overflow-y: auto;
}

/* Action item */
.ai-action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: inherit;
}

.ai-action-item:hover {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.08), rgba(124, 58, 237, 0.06));
}

.ai-action-item:active {
    transform: scale(0.98);
}

.ai-action-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.12), rgba(124, 58, 237, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ai-primary);
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.ai-action-item:hover .ai-action-item-icon {
    background: linear-gradient(135deg, var(--ai-primary), #7c3aed);
    color: white;
    transform: scale(1.05);
}

.ai-action-item-content {
    flex: 1;
    min-width: 0;
}

.ai-action-item-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ai-dark);
    line-height: 1.3;
}

.ai-action-item-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--ai-gray);
    line-height: 1.3;
}

.ai-action-item-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--ai-primary), #7c3aed);
    color: white;
    padding: 1px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
}

.ai-action-item-arrow {
    color: transparent;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ai-action-item:hover .ai-action-item-arrow {
    color: var(--ai-primary);
    transform: translateX(3px);
}

/* Scrollbar for dropdown */
.ai-action-dropdown-list::-webkit-scrollbar {
    width: 4px;
}

.ai-action-dropdown-list::-webkit-scrollbar-thumb {
    background: var(--ai-light-gray);
    border-radius: 2px;
}

.ai-action-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: var(--ai-gray);
}


/* ========================================
   AI Context Card
   ======================================== */

.ai-context-card {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.06), rgba(124, 58, 237, 0.04));
    border: 1px solid rgba(67, 97, 238, 0.2);
    border-radius: 12px;
    margin: 8px 12px;
    transition: all 0.3s ease;
    animation: ai-fade-in 0.3s ease;
}

.ai-context-card:hover {
    border-color: rgba(67, 97, 238, 0.35);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.1);
}

.ai-context-card-inactive {
    opacity: 0.5;
    border-color: var(--ai-light-gray);
    background: var(--ai-light);
}

.ai-context-card-inactive .ai-context-card-icon {
    background: var(--ai-light-gray);
    color: var(--ai-gray);
}

.ai-context-card-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
}

.ai-context-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--ai-primary), #7c3aed);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.ai-context-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ai-context-card-type {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ai-primary);
    line-height: 1;
}

.ai-context-card-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ai-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    cursor: pointer;
}

.ai-context-card-toggle {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: rgba(67, 97, 238, 0.1);
    color: var(--ai-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ai-context-card-toggle:hover {
    background: var(--ai-primary);
    color: white;
    transform: scale(1.08);
}

.ai-context-card-inactive .ai-context-card-toggle {
    color: var(--ai-gray);
    background: var(--ai-light-gray);
}

.ai-context-card-inactive .ai-context-card-toggle i::before {
    content: "\f127";
}

.ai-context-card-remove {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--ai-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ai-context-card-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}


/* ─── AiManagerChatDrawer ───────────────────────────────────────────────── */

.amc-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 9998;
}
.amc-overlay.amc-open { opacity: 1; visibility: visible; }

.amc-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 460px;
    max-width: 100vw;
    background: var(--surface, #fff);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    border-left: 1px solid var(--outline, #dadce0);
}
.amc-drawer.amc-open { transform: translateX(0); }

.amc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--outline, #dadce0);
    background: var(--surface, #fff);
    flex-shrink: 0;
}
.amc-header-left { display: flex; align-items: center; gap: 12px; }
.amc-avatar {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: var(--primary-surface, #e8f0fe);
    color: var(--primary, #1a73e8);
    display: flex; align-items: center; justify-content: center;
}
.amc-title {
    font-family: 'Google Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--on-surface, #202124);
}
.amc-subtitle {
    font-size: 11px;
    color: var(--on-surface-variant, #5f6368);
}
.amc-header-actions { display: flex; gap: 4px; }

.amc-icon-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--on-surface-variant, #5f6368);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease;
}
.amc-icon-btn:hover { background: var(--surface-container, #f1f3f4); }
.amc-icon-btn .material-symbols-outlined { font-size: 20px; }

.amc-history-panel {
    border-bottom: 1px solid var(--outline, #dadce0);
    background: var(--surface-dim, #f8f9fa);
    max-height: 280px;
    overflow-y: auto;
}
.amc-history-header {
    padding: 10px 18px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--on-surface-variant, #5f6368);
}
.amc-history-list { padding: 0 8px 8px 8px; }
.amc-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--on-surface, #202124);
    transition: background 0.15s ease;
}
.amc-history-item:hover { background: var(--primary-hover, #d2e3fc); }
.amc-history-item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}
.amc-history-item-del {
    border: none;
    background: transparent;
    color: var(--on-surface-variant, #5f6368);
    cursor: pointer;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.amc-history-item-del:hover { background: rgba(234, 67, 53, 0.1); color: var(--error, #ea4335); }
.amc-history-empty,
.amc-history-loading {
    padding: 16px;
    font-size: 12px;
    color: var(--on-surface-variant, #5f6368);
    text-align: center;
}

.amc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--surface-dim, #f8f9fa);
}

.amc-empty {
    margin: auto;
    text-align: center;
    max-width: 320px;
    padding: 24px 12px;
}
.amc-empty-icon {
    color: var(--primary, #1a73e8);
    margin-bottom: 12px;
}
.amc-empty-title {
    font-family: 'Google Sans', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--on-surface, #202124);
    margin-bottom: 6px;
}
.amc-empty-sub {
    font-size: 13px;
    color: var(--on-surface-variant, #5f6368);
    margin-bottom: 18px;
}
.amc-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.amc-suggestion {
    border: 1px solid var(--outline, #dadce0);
    background: var(--surface, #fff);
    padding: 10px 14px;
    border-radius: 9999px;
    font-size: 13px;
    color: var(--on-surface, #202124);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}
.amc-suggestion:hover {
    background: var(--primary-surface, #e8f0fe);
    border-color: var(--primary, #1a73e8);
    color: var(--primary, #1a73e8);
}

.amc-message {
    display: flex;
    max-width: 100%;
}
.amc-message.amc-user { justify-content: flex-end; }
.amc-message.amc-assistant { justify-content: flex-start; }
.amc-bubble {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
}
.amc-message.amc-user .amc-bubble {
    background: var(--primary, #1a73e8);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.amc-message.amc-assistant .amc-bubble {
    background: var(--surface, #fff);
    color: var(--on-surface, #202124);
    border: 1px solid var(--outline, #dadce0);
    border-bottom-left-radius: 4px;
}
.amc-bubble pre {
    background: rgba(0,0,0,0.05);
    padding: 8px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 12px;
}
.amc-bubble code {
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
    font-family: ui-monospace, monospace;
}
.amc-message.amc-user .amc-bubble code,
.amc-message.amc-user .amc-bubble pre {
    background: rgba(255,255,255,0.18);
}

.amc-typing .amc-bubble { display: flex; gap: 4px; align-items: center; }
.amc-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--on-surface-variant, #5f6368);
    animation: amc-blink 1.2s infinite ease-in-out;
}
.amc-dot:nth-child(2) { animation-delay: 0.2s; }
.amc-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes amc-blink {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

.amc-loading {
    text-align: center;
    color: var(--on-surface-variant, #5f6368);
    font-size: 12px;
    padding: 20px;
}

.amc-input-area {
    padding: 12px 14px;
    border-top: 1px solid var(--outline, #dadce0);
    background: var(--surface, #fff);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
    transition: background 0.15s ease;
}
.amc-input {
    flex: 1;
    border: 1px solid var(--outline, #dadce0);
    border-radius: 20px;
    padding: 10px 14px;
    font-size: 13.5px;
    font-family: 'Inter', sans-serif;
    resize: none;
    outline: none;
    max-height: 160px;
    line-height: 1.4;
    background: var(--surface-dim, #f8f9fa);
    color: var(--on-surface, #202124);
    transition: border-color 0.15s ease;
}
.amc-input:focus {
    border-color: var(--primary, #1a73e8);
    background: var(--surface, #fff);
}
.amc-send-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary, #1a73e8);
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease;
    flex-shrink: 0;
}
.amc-send-btn:hover { background: var(--primary-dark, #1557b0); }
.amc-send-btn .material-symbols-outlined { font-size: 20px; }

@media (max-width: 600px) {
    .amc-drawer { width: 100vw; }
}

/* ─── AiManagerChatDrawer · Enhancements (animations + color accents) ───── */

/* Header con gradiente sutil corporativo (permitido por design system en headers) */
.amc-drawer .amc-header {
    background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
    position: relative;
    overflow: hidden;
}
.amc-drawer .amc-header::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--primary, #1a73e8) 20%,
        #4cc9f0 50%,
        var(--primary, #1a73e8) 80%,
        transparent 100%);
    background-size: 200% 100%;
    animation: amc-shimmer-line 4s linear infinite;
    opacity: 0.6;
}
@keyframes amc-shimmer-line {
    0%   { background-position: -100% 0; }
    100% { background-position:  100% 0; }
}

/* Avatar con halo pulsante */
.amc-drawer .amc-avatar {
    background: linear-gradient(135deg, var(--primary, #1a73e8) 0%, #4cc9f0 100%);
    color: #fff;
    position: relative;
    box-shadow: 0 4px 14px rgba(26, 115, 232, 0.35);
    animation: amc-avatar-float 4s ease-in-out infinite;
}
.amc-drawer .amc-avatar::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary, #1a73e8), #4cc9f0);
    opacity: 0.35;
    z-index: -1;
    filter: blur(8px);
    animation: amc-pulse-glow 2.4s ease-in-out infinite;
}
@keyframes amc-avatar-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-2px); }
}
@keyframes amc-pulse-glow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50%      { opacity: 0.55; transform: scale(1.08); }
}
.amc-drawer .amc-avatar .material-symbols-outlined {
    animation: amc-icon-spin 6s ease-in-out infinite;
}
@keyframes amc-icon-spin {
    0%, 100% { transform: rotate(0deg); }
    50%      { transform: rotate(8deg); }
}

/* Drawer slide-in con leve fade */
.amc-drawer {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    opacity: 0;
}
.amc-drawer.amc-open {
    opacity: 1;
}

/* Fondo del área de mensajes con un sutil "aurora" estático muy suave */
.amc-drawer .amc-messages {
    background:
        radial-gradient(circle at 15% 0%, rgba(26, 115, 232, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 90% 100%, rgba(76, 201, 240, 0.06) 0%, transparent 45%),
        var(--surface-dim, #f8f9fa);
}

/* Burbujas: animación de entrada */
.amc-message {
    animation: amc-msg-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.amc-message.amc-user {
    animation-name: amc-msg-in-right;
}
@keyframes amc-msg-in {
    from { opacity: 0; transform: translateY(8px) translateX(-6px); }
    to   { opacity: 1; transform: translateY(0) translateX(0); }
}
@keyframes amc-msg-in-right {
    from { opacity: 0; transform: translateY(8px) translateX(6px); }
    to   { opacity: 1; transform: translateY(0) translateX(0); }
}

/* Burbuja de usuario con gradiente corporativo */
.amc-drawer .amc-message.amc-user .amc-bubble {
    background: linear-gradient(135deg, var(--primary, #1a73e8) 0%, #3f8efc 100%);
    box-shadow: 0 4px 14px rgba(26, 115, 232, 0.25);
}

/* Burbuja de asistente con borde sutil de acento al hover */
.amc-drawer .amc-message.amc-assistant .amc-bubble {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.amc-drawer .amc-message.amc-assistant .amc-bubble:hover {
    border-color: var(--primary, #1a73e8);
    box-shadow: 0 4px 16px rgba(26, 115, 232, 0.10);
}

/* Empty state: título con gradiente */
.amc-drawer .amc-empty-title {
    background: linear-gradient(135deg, var(--primary, #1a73e8) 0%, #4cc9f0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.amc-drawer .amc-empty-icon {
    animation: amc-float-icon 3.5s ease-in-out infinite;
}
@keyframes amc-float-icon {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-4px) scale(1.05); }
}
.amc-drawer .amc-empty .amc-suggestions .amc-suggestion {
    opacity: 0;
    animation: amc-suggestion-in 0.45s ease forwards;
}
.amc-drawer .amc-empty .amc-suggestions .amc-suggestion:nth-child(1) { animation-delay: 0.10s; }
.amc-drawer .amc-empty .amc-suggestions .amc-suggestion:nth-child(2) { animation-delay: 0.18s; }
.amc-drawer .amc-empty .amc-suggestions .amc-suggestion:nth-child(3) { animation-delay: 0.26s; }
.amc-drawer .amc-empty .amc-suggestions .amc-suggestion:nth-child(4) { animation-delay: 0.34s; }
@keyframes amc-suggestion-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.amc-drawer .amc-suggestion {
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.amc-drawer .amc-suggestion:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 115, 232, 0.18);
}

/* Botón enviar con gradiente y micro-animación */
.amc-drawer .amc-send-btn {
    background: linear-gradient(135deg, var(--primary, #1a73e8) 0%, #3f8efc 100%);
    box-shadow: 0 4px 14px rgba(26, 115, 232, 0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.amc-drawer .amc-send-btn:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 6px 18px rgba(26, 115, 232, 0.45);
    filter: brightness(1.05);
}
.amc-drawer .amc-send-btn:active {
    transform: translateY(0) scale(0.97);
}
.amc-drawer .amc-send-btn .material-symbols-outlined {
    transition: transform 0.2s ease;
}
.amc-drawer .amc-send-btn:hover .material-symbols-outlined {
    transform: translateX(2px) translateY(-1px);
}

/* Input con borde animado al focus */
.amc-drawer .amc-input {
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.amc-drawer .amc-input:focus {
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12);
}

/* Iconos del header: micro-rotación al hover */
.amc-drawer .amc-icon-btn .material-symbols-outlined {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.amc-drawer .amc-icon-btn:hover .material-symbols-outlined {
    transform: rotate(-8deg) scale(1.1);
}

/* Indicador de typing con color de acento */
.amc-drawer .amc-typing .amc-dot {
    background: linear-gradient(135deg, var(--primary, #1a73e8), #4cc9f0);
}

/* Dark mode: ajustar gradientes */
[data-theme="dark"] .amc-drawer .amc-header {
    background: linear-gradient(135deg, #1f1f1f 0%, #1a2740 100%);
}
[data-theme="dark"] .amc-drawer .amc-messages {
    background:
        radial-gradient(circle at 15% 0%, rgba(76, 201, 240, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 100%, rgba(26, 115, 232, 0.08) 0%, transparent 45%),
        var(--surface-dim, #1a1a1a);
}

/* ─── AiManagerChatDrawer · Full mode + Artifact pane ───────────────────── */

.amc-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}
.amc-drawer .amc-shell { height: 100vh; }

.amc-shell .amc-chat-pane {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── Full-mode layout: split centrado dentro de #moduleContainer ── */

.amc-full-host {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 16px;
    background: var(--surface-dim, #f8f9fa);
    animation: amc-full-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes amc-full-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.amc-full-shell {
    flex-direction: row !important;
    width: 100%;
    max-width: 1440px;
    height: 100%;
    background: var(--surface, #fff);
    border: 1px solid var(--outline, #dadce0);
    border-radius: var(--radius-md, 16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.amc-full-shell .amc-chat-pane {
    width: 100%;
    max-width: 100%;
    border-right: 1px solid var(--outline, #dadce0);
    transition: max-width 0.3s ease;
}
.amc-full-shell .amc-artifact-pane.amc-artifact-active ~ .amc-chat-pane,
.amc-full-shell:has(.amc-artifact-pane.amc-artifact-active) .amc-chat-pane {
    max-width: 42%;
}

.amc-full-shell .amc-artifact-pane {
    flex: 1;
    display: none;
    flex-direction: column;
    background: var(--surface-dim, #f8f9fa);
    min-width: 0;
    animation: amc-pane-in 0.3s ease;
}
.amc-full-shell .amc-artifact-pane.amc-artifact-active {
    display: flex;
}
@keyframes amc-pane-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.amc-artifact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--outline, #dadce0);
    background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
    flex-shrink: 0;
}
.amc-artifact-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Google Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--on-surface, #202124);
}
.amc-artifact-title .material-symbols-outlined {
    color: var(--primary, #1a73e8);
}
.amc-artifact-actions { display: flex; gap: 4px; }

.amc-artifact-body {
    flex: 1;
    overflow: auto;
    padding: 24px;
}
.amc-artifact-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--on-surface-variant, #5f6368);
    gap: 12px;
}
.amc-artifact-empty p { max-width: 280px; font-size: 13px; }

.amc-artifact-content {
    background: var(--surface, #fff);
    border: 1px solid var(--outline, #dadce0);
    border-radius: var(--radius-sm, 12px);
    padding: 28px 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    animation: amc-artifact-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes amc-artifact-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.amc-artifact-content h1,
.amc-artifact-content h2,
.amc-artifact-content h3,
.amc-artifact-content h4,
.amc-artifact-content .amc-artifact-h {
    font-family: 'Google Sans', sans-serif;
    color: var(--on-surface, #202124);
    margin-top: 0;
}
.amc-artifact-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}
.amc-artifact-content table th,
.amc-artifact-content table td {
    border: 1px solid var(--outline, #dadce0);
    padding: 8px 12px;
    font-size: 13px;
    text-align: left;
}
.amc-artifact-content table th {
    background: var(--surface-dim, #f8f9fa);
    font-weight: 600;
}
.amc-artifact-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 14px 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12.5px;
}
.amc-artifact-content code {
    background: rgba(26, 115, 232, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12.5px;
    color: var(--primary, #1a73e8);
}
.amc-artifact-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Markdown content styling */
.amc-md-content { font-size: 14px; line-height: 1.65; color: var(--on-surface, #202124); }
.amc-md-content p { margin: 0 0 12px 0; }
.amc-md-content ul, .amc-md-content ol { padding-left: 22px; margin: 8px 0 14px 0; }
.amc-md-content li { margin-bottom: 4px; }
.amc-md-content a { color: var(--primary, #1a73e8); }

/* Chip "Ver artifact" debajo del mensaje del asistente */
.amc-artifact-chip {
    margin: 8px 0 0 0;
    padding: 6px 12px;
    border-radius: 9999px;
    border: 1px solid var(--primary, #1a73e8);
    background: var(--surface, #fff);
    color: var(--primary, #1a73e8);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s ease;
    align-self: flex-start;
}
.amc-message.amc-user .amc-artifact-chip { align-self: flex-end; }
.amc-artifact-chip:hover {
    background: var(--primary, #1a73e8);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}
.amc-message {
    display: flex;
    flex-direction: column;
}
.amc-message.amc-user { align-items: flex-end; }
.amc-message.amc-assistant { align-items: flex-start; }

/* Responsive: en pantallas pequeñas el split se vuelve stack */
@media (max-width: 1024px) {
    .amc-full-shell { flex-direction: column !important; }
    .amc-full-shell .amc-chat-pane,
    .amc-full-shell .amc-artifact-pane.amc-artifact-active {
        max-width: 100% !important;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--outline, #dadce0);
    }
}

/* ─── Fix scroll en drawer (flex min-height) ───────────────────────────── */

.amc-drawer { display: flex; flex-direction: column; }
.amc-drawer .amc-shell,
.amc-drawer .amc-chat-pane {
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}
.amc-drawer .amc-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.amc-full-shell .amc-chat-pane,
.amc-full-shell .amc-artifact-pane {
    min-height: 0;
    overflow: hidden;
}
.amc-full-shell .amc-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}
.amc-full-shell .amc-artifact-body {
    min-height: 0;
    overflow-y: auto;
}

/* ─── Animación de entrada del artifact más expresiva ──────────────────── */

.amc-full-shell .amc-artifact-pane.amc-artifact-active {
    animation: amc-pane-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes amc-pane-in {
    0%   { opacity: 0; transform: translateX(40px) scale(0.98); }
    60%  { opacity: 1; }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}
.amc-full-shell .amc-artifact-pane.amc-artifact-active .amc-artifact-content {
    animation: amc-artifact-in 0.55s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes amc-artifact-in {
    0%   { opacity: 0; transform: translateY(16px) scale(0.97); filter: blur(4px); }
    60%  { filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ─── Demo chip + chart wrapper con glow ───────────────────────────────── */

.amc-suggestion-demo {
    background: linear-gradient(135deg, #1a73e8 0%, #4cc9f0 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
    font-weight: 600 !important;
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.35);
    position: relative;
    overflow: hidden;
}
.amc-suggestion-demo::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    animation: amc-demo-shine 2.5s ease-in-out infinite;
}
@keyframes amc-demo-shine {
    0%, 30%  { left: -100%; }
    60%, 100% { left: 100%; }
}
.amc-suggestion-demo:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 10px 28px rgba(26, 115, 232, 0.5) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.amc-chart-wrapper {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: 12px auto 0 auto;
    padding: 24px;
    background: var(--surface, #fff);
    border-radius: 16px;
    border: 1px solid var(--outline, #dadce0);
    box-shadow: 0 10px 40px rgba(26, 115, 232, 0.10);
    animation: amc-chart-in 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}
@keyframes amc-chart-in {
    0%   { opacity: 0; transform: translateY(20px) scale(0.95); filter: blur(8px); }
    50%  { filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.amc-chart-wrapper canvas {
    position: relative;
    z-index: 2;
    animation: amc-canvas-fade 1.2s 0.2s ease both;
}
@keyframes amc-canvas-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.amc-chart-glow {
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at 30% 40%, rgba(26, 115, 232, 0.25) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(76, 201, 240, 0.25) 0%, transparent 50%);
    z-index: 1;
    pointer-events: none;
    animation: amc-glow-rotate 12s linear infinite;
    filter: blur(30px);
}
@keyframes amc-glow-rotate {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ─── AiManagerChatDrawer · File Attachment UI ─────────────────────────────── */

/* Attach button (left of textarea) */
.amc-attach-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--on-surface-variant, #5f6368);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}
.amc-attach-btn:hover {
    background: var(--surface-container, #f1f3f4);
    color: var(--primary, #1a73e8);
}
.amc-attach-btn .material-symbols-outlined { font-size: 20px; }

/* Attached files preview strip (above the input row) */
.amc-attachments-strip {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    padding-bottom: 4px;
}
.amc-attachments-strip.amc-has-files {
    display: flex;
}

/* Individual file chip */
.amc-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 8px;
    border-radius: 9999px;
    background: var(--primary-surface, #e8f0fe);
    color: var(--primary, #1a73e8);
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    max-width: 200px;
    transition: background 0.15s ease;
}
.amc-file-chip .material-symbols-outlined {
    font-size: 14px;
    flex-shrink: 0;
}
.amc-file-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.amc-file-chip-remove {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--on-surface-variant, #5f6368);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}
.amc-file-chip-remove:hover {
    background: var(--error-surface, #fce8e6);
    color: var(--error, #ea4335);
}
.amc-file-chip-remove .material-symbols-outlined { font-size: 14px; }

/* Uploading state */
.amc-file-chip.amc-uploading {
    opacity: 0.65;
    pointer-events: none;
}
.amc-file-chip.amc-uploading::after {
    content: '';
    width: 12px; height: 12px;
    border: 2px solid var(--primary, #1a73e8);
    border-top-color: transparent;
    border-radius: 50%;
    animation: amc-chip-spin 0.6s linear infinite;
    flex-shrink: 0;
}
@keyframes amc-chip-spin {
    to { transform: rotate(360deg); }
}

/* Upload error state */
.amc-file-chip.amc-upload-error {
    background: var(--error-surface, #fce8e6);
    color: var(--error, #ea4335);
}

/* File references shown inside user message bubble */
.amc-msg-files {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.amc-msg-file-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    background: rgba(255,255,255,0.18);
    font-size: 11px;
    font-weight: 500;
}
.amc-msg-file-tag .material-symbols-outlined { font-size: 12px; }

/* Drag-over state on the input area */
.amc-input-area.amc-drag-over {
    background: var(--primary-surface, #e8f0fe);
    border-color: var(--primary, #1a73e8);
}
.amc-input-area.amc-drag-over .amc-attach-btn {
    color: var(--primary, #1a73e8);
}
