/* UAEH COURSE CHAT WIDGET - INDEX.CSS */
:root {
    --color-primary: #7A0C0E;        /* UAEH Dark Red / Burgundy */
    --color-primary-hover: #961214;  /* Hover Red */
    --color-bg-bot: #faf8f6;         /* Warm Beige Bot Bubble */
    --color-text-bot: #2d2d2d;       /* Dark Charcoal Text */
    --color-bg-user: #7A0C0E;        /* User Burgundy Bubble */
    --color-text-user: #ffffff;      /* User White Text */
    --color-border: #e8e2dc;         /* Light warm border */
    --color-shadow: rgba(122, 12, 14, 0.12);
    --font-sans: 'Outfit', sans-serif;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


/* FLOATING LAUNCHER BUTTON */
.chat-launcher {
    bottom: 80px;
    right: 13px;
    background: #800101;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 9999;
    position: fixed;
  
}

.chat-launcher i {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.chat-launcher:hover {
    transform: scale(1.08) translateY(-3px);
    background-color: var(--color-primary-hover);
    box-shadow: 0 10px 28px rgba(122, 12, 14, 0.25);
}

.chat-launcher.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5);
}

/* FLOATING CHAT WINDOW */
.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 380px;
    height: 500px;
    max-height: calc(100vh - 130px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: visible; /* Required for mascot overlapping */
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-widget.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* WIDGET HEADER */
.widget-header {
    background-color: var(--color-primary);
    color: #ffffff;
    padding: 16px 20px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 10;
}

.widget-title {
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.3px;
}

/* MESSAGE AREA */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(122, 12, 14, 0.2) transparent;
}

/* Custom scrollbar for Webkit */
.chat-messages::-webkit-scrollbar {
    width: 5px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(122, 12, 14, 0.15);
    border-radius: 10px;
}

/* MESSAGE BUBBLES */
.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: messageAppear 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.message-wrapper.bot {
    align-self: flex-start;
}

.message-wrapper.user {
    align-self: flex-end;
}

.msg-avatar {
    display: none; /* Hide avatars for a cleaner look matching the mockups */
}

.msg-bubble {
    padding: 12px 16px;
    line-height: 1.5;
    font-size: 14.5px;
}

.bot .msg-bubble {
    background-color: var(--color-bg-bot);
    color: var(--color-text-bot);
    border-radius: 18px 18px 18px 4px;
    border: 1px solid #f0ebe4;
}

.user .msg-bubble {
    background-color: var(--color-bg-user);
    color: var(--color-text-user);
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 12px rgba(122, 12, 14, 0.1);
}

.msg-time {
    display: block;
    font-size: 10px;
    margin-top: 4px;
}

.bot .msg-time {
    color: #999999;
    align-self: flex-start;
}

.user .msg-time {
    color: rgba(255, 255, 255, 0.7);
    align-self: flex-end;
    text-align: right;
}

/* TYPING INDICATOR */
.typing-indicator-wrapper {
    align-self: flex-start;
}
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    align-items: center;
}
.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--color-primary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
    opacity: 0.6;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* SUGGESTION PILLS */
.suggestion-pills-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 14px 10px 14px;
    background-color: #ffffff;
    border-top: 1px solid #f4efe9;
    max-height: 110px;
    overflow-y: auto;
    flex-shrink: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(122, 12, 14, 0.2) transparent;
}

.sugg-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: #ffffff;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 5px 10px;
    border-radius: 16px;
    font-family: var(--font-sans);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.sugg-pill:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    transform: translateY(-1px);
}


/* INPUT PANEL */
.chat-input-panel {
    padding: 15px 20px;
    background-color: #ffffff;
    border-top: 1px solid var(--color-border);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    z-index: 10;
}

.input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

#chat-input {
    flex: 1;
    background-color: #faf8f5;
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: 10px 18px;
    font-family: var(--font-sans);
    font-size: 14px;
    color: #333333;
    outline: none;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

#chat-input::placeholder {
    color: #9c958e;
}

#chat-input:focus {
    border-color: var(--color-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(122, 12, 14, 0.06);
}

.send-btn {
    background-color: var(--color-primary);
    color: #ffffff;
    border: none;
    border-radius: 24px;
    padding: 10px 20px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    outline: none;
}

.send-btn:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

.send-btn:active {
    transform: translateY(1px);
}


/* ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes bounceGentle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

/* RESPONSIVE DESIGN */
@media (max-width: 480px) {
    .chat-widget-container {
        bottom: 15px;
        right: 15px;
    }
    
    .chat-widget {
        bottom: 85px;
        right: 15px;
        width: calc(100vw - 30px);
        height: 460px;
    }

}

/* COURSE LINKS IN CHAT */
.chat-course-link {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.chat-course-link:hover {
    color: var(--color-primary-hover);
    text-decoration: none;
}

/* ICONOS EN CHATBOT */
.chat-inline-icon {
    margin-right: 6px;
    color: var(--color-primary, #a9191f);
}

.sugg-pill i {
    margin-right: 0;
    font-size: 0.92em;
    flex-shrink: 0;
}


