* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-image: url('assets/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    width: 100%;
}

/* AI Assistant Widget */
.assistant-widget {
    position: fixed;
    bottom: 30px;
    right: 30px; /* keep on right as before */
    transform: none;
    width: auto;
    display: flex;
    flex-direction: column; /* Avatar above input */
    align-items: flex-end; /* right-align children */
    gap: 0; /* no space between gif and input */
    z-index: 1000;
}

.gif-container {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    width: 320px;   /* Larger avatar */
    height: 520px;  /* Ensure container has height for absolutely positioned layers */
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    overflow: hidden; /* prevent image from overflowing over the input */
    position: relative; /* allow overlay for crossfade */
}

.gif-container:hover {
    transform: scale(1.05);
}

.gif-container img,
.gif-container .gif-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    display: block;
    transition: opacity 700ms ease-in-out;
    will-change: opacity;
}

/* State-based visibility so both layers transition simultaneously */
.gif-container.idle #gif-idle { opacity: 1; }
.gif-container.idle #gif-speaking { opacity: 0; }
.gif-container.speaking #gif-idle { opacity: 0; }
.gif-container.speaking #gif-speaking { opacity: 1; }

.input-container {
    display: flex;
    gap: 10px;
    background: white;
    padding: 15px 18px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    align-items: center;
    width: 420px; /* Keep input narrower than GIF */
    margin: 0; /* remove extra spacing */
}

#question-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 15px;
    font-size: 0.95rem;
    color: #333;
}

#question-input::placeholder {
    color: #999;
}

#send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#send-btn:active {
    transform: scale(0.95);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .assistant-widget {
        bottom: 20px;
        right: 20px;
    }
    
    .gif-container {
        width: 400px; /* Big avatar on mobile */
        height: 400px;
    }

    .input-container {
        width: 300px; /* Keep input compact on mobile */
    }
}