@charset "utf-8";
/* CSS Document */
/* ===================================
   LILY CHATBOT - SPEOLOGY THEMED
   =================================== */

:root {
    /* ISER Website Colors - exact match */
    --iser-orange: #f03c02;
    --iser-orange-hover: #fd541e;
    --iser-orange-dark: #581601;
    --iser-brown-dark: #2b2320;
    --iser-brown-medium: #65534c;
    --iser-brown-light: #4d4643;
    --iser-beige-light: #f8f6f5;
    --iser-beige: #f6f3f2;
    --iser-gray: #c8bab5;
    
    /* UI Colors matching ISER */
    --bg-gradient-start: #ffffff;
    --bg-gradient-end: #f8f6f5;
    --text-primary: #4d4643;
    --text-secondary: #65534c;
    --white: #ffffff;
    --shadow: rgba(88, 22, 1, 0.1);
    --shadow-strong: rgba(88, 22, 1, 0.15);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    /* Animation */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;
    --transition-slow: 0.6s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Font fallback matching ISER website */
.chatbot-container {
    font-family: 'Open Sans', sans-serif;
}

.header-text h3 {
    font-family: 'Muli', 'Crimson Pro', serif;
}

/* ===================================
   CHATBOT TOGGLE BUTTON
   =================================== */

.chatbot-toggle {
    position: fixed;
    bottom: 2rem;
    right: calc(2rem + 30px);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--iser-orange) 0%, var(--iser-orange-dark) 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--shadow-strong),
                0 0 0 0 rgba(240, 60, 2, 0.4);
    z-index: 999;
    transition: transform var(--transition-medium),
                box-shadow var(--transition-medium);
    animation: pulse-glow 3s ease-in-out infinite;
}

.chatbot-toggle:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 12px 32px var(--shadow-strong),
                0 0 0 8px rgba(240, 60, 2, 0.2);
}

.chatbot-toggle:active {
    transform: scale(0.95);
}

.lily-icon {
    width: 45px;
    height: 45px;
    animation: float 3s ease-in-out infinite;
    object-fit: contain;
}

/* Remove SVG-specific animations for toggle button */

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 8px 24px var(--shadow-strong), 0 0 0 0 rgba(240, 60, 2, 0.4); }
    50% { box-shadow: 0 8px 24px var(--shadow-strong), 0 0 0 12px rgba(240, 60, 2, 0); }
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--iser-orange);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    animation: bounce-in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(240, 60, 2, 0.4);
}

@keyframes bounce-in {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ===================================
   CHATBOT CONTAINER
   =================================== */

.chatbot-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 420px;
    max-width: calc(100vw - 2rem);
    height: 650px;
    max-height: calc(100vh - 4rem);
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 20px 60px var(--shadow-strong),
                0 0 0 1px rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity var(--transition-medium),
                transform var(--transition-medium);
    z-index: 1000;
    overflow: hidden;
}

.chatbot-container.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ===================================
   HEADER
   =================================== */

.chatbot-header {
    background: linear-gradient(135deg, var(--iser-brown-dark) 0%, var(--iser-orange-dark) 100%);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

/* Decorative cave texture */
.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.header-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    position: relative;
    z-index: 1;
}

.lily-avatar {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lily-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

/* Lily Character Animations - Office Assistant Style */
.lily-character {
    animation: lily-idle 6s ease-in-out infinite;
    display: block;
    transition: transform 0.3s ease;
}

/* Idle animation - gentle breathing and occasional movements like Clippy */
@keyframes lily-idle {
    0%, 100% { transform: translateY(0px) scale(1); }
    10% { transform: translateY(-3px) scale(1.02); }
    20% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-2px) scale(1.01); }
    60% { transform: translateY(0px) scale(1); }
}

/* Talking animation - energetic like Clippy when speaking */
.lily-character.talking {
    animation: lily-talk 0.4s ease-in-out infinite, lily-bounce 0.8s ease-in-out infinite;
}

@keyframes lily-talk {
    0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
    25% { transform: translateY(-5px) scale(1.08) rotate(-3deg); }
    50% { transform: translateY(-2px) scale(1.05) rotate(0deg); }
    75% { transform: translateY(-5px) scale(1.08) rotate(3deg); }
}

@keyframes lily-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Thinking animation - scratching head, looking around like Wizard */
.lily-character.thinking {
    animation: lily-think 1.2s ease-in-out infinite;
}

@keyframes lily-think {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    15% { transform: translateY(-3px) rotate(-8deg) scale(1.03); }
    30% { transform: translateY(-2px) rotate(8deg) scale(1.03); }
    45% { transform: translateY(-3px) rotate(-5deg) scale(1.02); }
    60% { transform: translateY(0) rotate(5deg) scale(1.02); }
    75% { transform: translateY(-2px) rotate(0deg) scale(1.01); }
}

/* Excited animation - when greeting or new message arrives */
.lily-character.excited {
    animation: lily-excited 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes lily-excited {
    0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
    20% { transform: translateY(-12px) scale(1.15) rotate(-10deg); }
    40% { transform: translateY(-8px) scale(1.1) rotate(10deg); }
    60% { transform: translateY(-12px) scale(1.15) rotate(-5deg); }
    80% { transform: translateY(-6px) scale(1.08) rotate(5deg); }
}

/* Sleeping animation - when idle for long time */
.lily-character.sleeping {
    animation: lily-sleep 3s ease-in-out infinite;
}

@keyframes lily-sleep {
    0%, 100% { transform: translateY(2px) rotate(-5deg) scale(0.98); opacity: 0.8; }
    50% { transform: translateY(5px) rotate(-7deg) scale(0.97); opacity: 0.7; }
}

/* Surprised animation - when user opens chat */
.lily-character.surprised {
    animation: lily-surprise 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes lily-surprise {
    0% { transform: scale(0.8) rotate(-20deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(10deg); }
    70% { transform: scale(0.95) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Wave hello animation - when first opened */
.lily-character.wave {
    animation: lily-wave 1s ease-in-out;
}

@keyframes lily-wave {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-15deg) translateY(-5px); }
    20%, 40%, 60%, 80% { transform: rotate(15deg) translateY(-8px); }
}

/* Error/confused animation */
.lily-character.confused {
    animation: lily-confused 1s ease-in-out infinite;
}

@keyframes lily-confused {
    0%, 100% { transform: rotate(0deg) translateX(0); }
    25% { transform: rotate(-10deg) translateX(-5px); }
    50% { transform: rotate(0deg) translateX(0) translateY(-3px); }
    75% { transform: rotate(10deg) translateX(5px); }
}

/* Remove old SVG-specific animations */

.header-text {
    color: var(--white);
}

.header-text h3 {
    font-family: 'Crimson Pro', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    letter-spacing: -0.5px;
}

.status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 400;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.close-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* ===================================
   CHAT MESSAGES
   =================================== */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    background: var(--iser-beige-light);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(240, 60, 2, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--iser-orange);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--iser-orange-hover);
}

.message {
    display: flex;
    gap: var(--space-sm);
    animation: message-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes message-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    max-width: 85%;
    padding: var(--space-md) var(--space-lg);
    border-radius: 18px;
    line-height: 1.5;
    font-size: 0.9375rem;
}

.bot-message .message-content {
    background: linear-gradient(135deg, var(--iser-orange) 0%, var(--iser-orange-hover) 100%);
    color: var(--white);
    border-bottom-left-radius: 6px;
    box-shadow: 0 4px 12px rgba(240, 60, 2, 0.2);
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content {
    background: var(--white);
    color: var(--text-primary);
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--iser-gray);
}

.message-content p {
    margin: 0;
}

.message-content p + p {
    margin-top: var(--space-sm);
}

/* Search Result Links (in bot messages) */
.chat-search-link {
    display: inline-block;
    color: var(--white);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.2s;
}

.chat-search-link:hover {
    opacity: 0.8;
    color: var(--white);
}

/* Quick Topics */
.quick-topics {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.topic-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    padding: var(--space-sm) var(--space-md);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.topic-btn:hover {
    background: var(--iser-orange);
    border-color: var(--iser-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(240, 60, 2, 0.2);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: var(--space-md);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* ===================================
   QUICK SUGGESTIONS
   =================================== */

.quick-suggestions {
    padding: var(--space-md) var(--space-lg);
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    background: var(--iser-beige);
    border-top: 1px solid var(--iser-gray);
}

.quick-suggestions::-webkit-scrollbar {
    height: 4px;
}

.quick-suggestions::-webkit-scrollbar-track {
    background: transparent;
}

.quick-suggestions::-webkit-scrollbar-thumb {
    background: var(--iser-orange);
    border-radius: 10px;
}

.suggestion-btn {
    flex-shrink: 0;
    background: var(--white);
    border: 1px solid var(--iser-gray);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-md);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.suggestion-btn:hover {
    background: var(--iser-orange);
    color: var(--white);
    border-color: var(--iser-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 60, 2, 0.3);
}

/* ===================================
   INPUT AREA
   =================================== */

.chat-input-area {
    padding: var(--space-lg);
    background: var(--white);
    border-top: 1px solid var(--iser-gray);
}

.input-wrapper {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-end;
    background: var(--iser-beige-light);
    border: 2px solid var(--iser-gray);
    border-radius: 16px;
    padding: var(--space-sm);
    transition: all var(--transition-fast);
}

.input-wrapper:focus-within {
    border-color: var(--iser-orange);
    box-shadow: 0 0 0 4px rgba(240, 60, 2, 0.1);
}

#chat-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.9375rem;
    color: var(--text-primary);
    padding: var(--space-sm);
    max-height: 120px;
    outline: none;
}

#chat-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.send-button {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: none;
    background: linear-gradient(135deg, #f03c02 0%, #fd541e 100%);
    color: var(--white);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    padding: 0;
    position: relative;
}

.send-button svg {
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
    transform: rotate(45deg);
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(240, 60, 2, 0.4);
    background: linear-gradient(135deg, #fd541e 0%, #f03c02 100%);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.input-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-xs);
}

.char-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 480px) {
    .chatbot-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 60px;
        height: 60px;
    }
    
    .lily-icon {
        width: 38px;
        height: 38px;
    }
    
    .chatbot-container {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .lily-avatar {
        width: 60px;
        height: 60px;
    }
    
    .lily-avatar img {
        width: 100%;
        height: 100%;
    }
    
    .header-text h3 {
        font-size: 1.25rem;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}