:root {
    --sysman-primary: #3b82f6;
    --sysman-primary-dark: #2563eb;
    --sysman-bg: #ffffff;
    --sysman-surface: #f8fafc;
    --sysman-text: #1e293b;
    --sysman-text-muted: #64748b;
    --sysman-border: #e2e8f0;
    --sysman-shadow: rgba(0, 0, 0, 0.1);
    --sysman-shadow-lg: rgba(0, 0, 0, 0.15);
}

/* Estilos generales para SVG */
#sysman-chatbot-container svg {
    display: inline-block;
    vertical-align: middle;
}

/* Estilos para iconos SVG embebidos */
.sysman-svg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
}

.sysman-svg-icon svg {
    stroke: currentColor;
    fill: none;
    display: block;
}

/* Tamaños específicos para cada ubicación */
#sysman-chat-button .sysman-svg-icon {
    width: 28px;
    height: 28px;
}

#sysman-chat-button .sysman-svg-icon svg {
    width: 28px;
    height: 28px;
    stroke: white;
}

#sysman-chat-button .sysman-chat-icon svg {
    width: 28px;
    height: 28px;
    stroke: white;
}

#sysman-chat-button .sysman-close-icon svg {
    width: 28px;
    height: 28px;
    stroke: white;
}

.sysman-chat-avatar .sysman-svg-icon {
    width: 36px;
    height: 36px;
}

.sysman-chat-avatar .sysman-svg-icon svg {
    width: 36px;
    height: 36px;
    stroke: white;
}

.sysman-chat-avatar svg {
    width: 36px;
    height: 36px;
    stroke: white;
}

#sysman-chat-send .sysman-svg-icon {
    width: 18px;
    height: 18px;
}

#sysman-chat-send .sysman-svg-icon svg {
    width: 18px;
    height: 18px;
    stroke: white;
}

#sysman-chat-send svg {
    width: 18px;
    height: 18px;
    stroke: white;
	margin-top: -3px;
}

/* Estilos para imágenes personalizadas */
.sysman-custom-icon {
    object-fit: contain;
}

#sysman-chat-button .sysman-custom-icon {
    filter: brightness(0) invert(1); /* Hacer las imágenes blancas */
}

.sysman-chat-avatar .sysman-custom-icon {
    filter: none; /* Mantener color original en el avatar */
}

#sysman-chat-send .sysman-custom-icon {
    filter: brightness(0) invert(1); /* Hacer la imagen blanca */
}

/* Botón principal del chat */
#sysman-chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    background: var(--sysman-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--sysman-shadow-lg);
    display: grid;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: float 3s ease-in-out infinite;
}

#sysman-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px var(--sysman-shadow-lg);
}

#sysman-chat-button.sysman-chat-button-close {
    animation: none;
}

#sysman-chat-button svg {
    width: 28px;
    height: 28px;
    color: white;
    stroke: currentColor;
    fill: none;
}

#sysman-chat-button .sysman-online-indicator {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #10b981;
    border: 3px solid white;
    border-radius: 50%;
    animation: pulse-ring 2s infinite;
}

/* Saludo emergente */
#sysman-chat-greeting {
    position: fixed;
    bottom: 112px;
    right: 24px;
    z-index: 999998;
    display: none;
    animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
}

.sysman-greeting-content {
    background: white;
    padding: 16px 20px;
    border-radius: 16px;
    border-bottom-right-radius: 4px;
    box-shadow: 0 12px 32px var(--sysman-shadow-lg);
    max-width: 260px;
    border: 1px solid var(--sysman-border);
    position: relative;
}

.sysman-greeting-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--sysman-text);
}

.sysman-greeting-wave {
    display: inline-block;
    animation: wave 1s ease-in-out infinite;
    margin-right: 4px;
}

#sysman-close-greeting {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--sysman-surface);
    border: 1px solid var(--sysman-border);
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#sysman-close-greeting:hover {
    background: var(--sysman-border);
}

#sysman-close-greeting svg {
    width: 12px;
    height: 12px;
    color: var(--sysman-text-muted);
    stroke: currentColor;
    fill: none;
	margin-top: -3px;
}

/* Ventana del chat */
#sysman-chat-window {
    position: fixed;
    bottom: 112px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 0;
    opacity: 0;
    visibility: hidden;
    z-index: 999998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

#sysman-chat-window.sysman-chat-window-open {
    height: -webkit-fill-available;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    animation: slide-up 0.3s ease-out;
}

.sysman-chat-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 48px var(--sysman-shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--sysman-border);
}

/* Header del chat */
.sysman-chat-header {
    background: linear-gradient(135deg, var(--sysman-primary) 0%, var(--sysman-primary-dark) 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sysman-chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sysman-chat-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.sysman-chat-header-info p {
    margin: 4px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 4px;
}

.sysman-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
}

/* Mensajes */
#sysman-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--sysman-surface);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#sysman-chat-messages::-webkit-scrollbar {
    width: 6px;
}

#sysman-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#sysman-chat-messages::-webkit-scrollbar-thumb {
    background: var(--sysman-border);
    border-radius: 3px;
}

#sysman-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--sysman-text-muted);
}

.sysman-chat-message {
    display: flex;
    margin-bottom: 4px;
}

.sysman-chat-message-bot {
    justify-content: flex-start;
}

.sysman-chat-message-user {
    justify-content: flex-end;
}

.sysman-chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-line;
}

.sysman-chat-message-bot .sysman-chat-bubble {
    background: white;
    color: var(--sysman-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sysman-chat-message-user .sysman-chat-bubble {
    background: var(--sysman-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Estilos para enlaces dentro de mensajes */
.sysman-chat-bubble a[href="/contact"] {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 22px;
  background-color: #9b1c1c;
  color: #ffffff !important;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none !important;
}

.sysman-chat-bubble a[href="/contact"]:hover {
	background-color: #1C0D0A;
}
/* Opciones de respuesta */
.sysman-chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.sysman-chat-option-btn {
    padding: 8px 16px;
    background: var(--sysman-surface);
    border: 1px solid var(--sysman-border);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--sysman-text);
    font-weight: 500;
}

.sysman-chat-option-btn:hover {
    background: var(--sysman-primary);
    color: white;
    border-color: var(--sysman-primary);
    transform: translateY(-1px);
}

/* Indicador de escritura */
#sysman-chat-typing {
    display: none;
    justify-content: flex-start;
}

.sysman-typing-indicator {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 4px;
}

.sysman-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--sysman-text-muted);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite;
}

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

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

/* Input de mensaje */
.sysman-chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid var(--sysman-border);
}

.sysman-chat-input-wrapper {
    display: flex;
    gap: 8px;
}

#sysman-chat-input {
    flex: 1;
    background: var(--sysman-surface);
    border: 1px solid var(--sysman-border);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--sysman-text);
    outline: none;
    transition: all 0.2s;
}

#sysman-chat-input:focus {
    border-color: var(--sysman-primary);
    background: white;
}

#sysman-chat-input::placeholder {
    color: var(--sysman-text-muted);
}

#sysman-chat-send {
    width: 40px;
    height: 40px;
    background: var(--sysman-primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: grid;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#sysman-chat-send:hover {
    background: var(--sysman-primary-dark);
    transform: scale(1.05);
}

#sysman-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sysman-chat-footer-text {
    text-align: center;
    font-size: 11px;
    color: var(--sysman-text-muted);
    margin-top: 8px;
}

/* Animaciones */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(20deg);
    }
    75% {
        transform: rotate(-20deg);
    }
}

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

/* Responsive */
@media (max-width: 480px) {
    #sysman-chat-window {
        right: 12px;
        bottom: 96px;
        width: calc(100vw - 24px);
    }
    
    #sysman-chat-window.sysman-chat-window-open {
        height: calc(100vh - 120px);
    }
    
    #sysman-chat-button {
        right: 12px;
        bottom: 12px;
        width: 56px;
        height: 56px;
    }
    
    #sysman-chat-greeting {
        right: 12px;
        bottom: 80px;
        max-width: calc(100vw - 48px);
    }
}
