/* Stu Helper Widget - Floating Help Chat */

.stu-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Nunito', 'Inter', sans-serif;
}

/* Speech Bubble that appears on page load */
.stu-bubble {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: white;
    border-radius: 16px 16px 4px 16px;
    padding: 14px 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d1b4e;
    white-space: nowrap;
    animation: bubble-appear 0.4s ease-out;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.stu-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

.stu-bubble.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes bubble-appear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Jiggle/Bounce animation for the button */
@keyframes stu-jiggle {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    10% {
        transform: rotate(-8deg) scale(1.05);
    }

    20% {
        transform: rotate(8deg) scale(1.05);
    }

    30% {
        transform: rotate(-8deg) scale(1.05);
    }

    40% {
        transform: rotate(8deg) scale(1.05);
    }

    50% {
        transform: rotate(0deg) scale(1.1);
    }

    60% {
        transform: scale(1);
    }
}

.stu-button.jiggle {
    animation: stu-jiggle 0.6s ease-in-out;
}

/* Floating Button */
.stu-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9500, #ff6b9d);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(255, 149, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.stu-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(255, 149, 0, 0.5);
}

.stu-button .suite-coin-btn {
    font-size: 2rem;
    font-weight: 900;
    color: white;
    font-family: 'Nunito', sans-serif;
}

.stu-button .suite-coin-btn-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.stu-button .stu-close {
    display: none;
    font-size: 1.5rem;
    color: white;
}

.stu-widget.open .stu-button .stu-close {
    display: block;
}

.stu-widget.open .stu-button .suite-coin-btn,
.stu-widget.open .stu-button .suite-coin-btn-img {
    display: none;
}

/* Coin icon in header */
.suite-coin-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
}

/* Chat Panel */
.stu-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 340px;
    max-height: 480px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: none;
    flex-direction: column;
    animation: stu-slide-up 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stu-widget.open .stu-panel {
    display: flex;
}

/* Header */
.stu-header {
    background: linear-gradient(135deg, #ff9500, #ff6b9d);
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stu-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.stu-header-text h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.stu-header-text p {
    margin: 2px 0 0;
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Messages Area */
.stu-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    max-height: 280px;
}

.stu-message {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 90%;
}

.stu-message.stu {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.1), rgba(255, 107, 157, 0.1));
    color: #2d1b4e;
    border-bottom-left-radius: 4px;
}

.stu-message.user {
    background: #f3f4f6;
    color: #374151;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

/* Quick Questions */
.stu-quick {
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.stu-quick-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9ca3af;
    margin-bottom: 10px;
}

.stu-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stu-pill {
    padding: 8px 14px;
    background: white;
    border: 1px solid rgba(255, 149, 0, 0.3);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ff9500;
    cursor: pointer;
    transition: all 0.2s;
}

.stu-pill:hover {
    background: linear-gradient(135deg, #ff9500, #ff6b9d);
    color: white;
    border-color: transparent;
}

/* Discord Link */
.stu-discord {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #5865F2;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.stu-discord:hover {
    background: #4752c4;
}

/* Input Area */
.stu-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: #fafafa;
}

.stu-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 100px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.stu-input-area input:focus {
    border-color: #ff9500;
}

.stu-input-area button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#stuSend {
    background: linear-gradient(135deg, #ff9500, #ff6b9d);
    color: white;
}

#stuSend:hover {
    transform: scale(1.1);
}

#stuExplain {
    background: #f3f4f6;
    color: #666;
}

#stuExplain:hover {
    background: #ff9500;
    color: white;
}

/* Typing Indicator */
.stu-typing {
    display: flex;
    gap: 4px;
    padding: 16px !important;
}

.stu-typing span {
    width: 8px;
    height: 8px;
    background: #ff9500;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.stu-typing span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .stu-panel {
        width: calc(100vw - 48px);
        right: -12px;
    }
}