/* ============================================
   Rygen AI Chatbot Widget Styles
   ============================================ */

/* Toggle Button */
#rygen-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

#rygen-toggle .rygen-btn-inner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00BCD4, #0097A7);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 188, 212, 0.4);
    transition: all 0.3s ease;
}

#rygen-toggle:hover .rygen-btn-inner {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0, 188, 212, 0.55);
}

#rygen-toggle .rygen-btn-inner svg {
    width: 28px;
    height: 28px;
    color: #fff;
    transition: all 0.3s ease;
}

#rygen-toggle .rygen-icon-close {
    display: none;
}

#rygen-toggle.active .rygen-icon-chat {
    display: none;
}

#rygen-toggle.active .rygen-icon-close {
    display: block;
}

#rygen-toggle .rygen-btn-label {
    background: #0A1628;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 1;
    transition: opacity 0.3s ease;
    font-family: 'Inter', sans-serif;
}

#rygen-toggle.active .rygen-btn-label {
    opacity: 0;
    pointer-events: none;
}

/* Chat Window */
#rygen-window {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 380px;
    max-height: 560px;
    height: calc(100vh - 140px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

#rygen-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.rygen-header {
    background: linear-gradient(135deg, #0A1628 0%, #142240 100%);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.rygen-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rygen-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00BCD4, #0097A7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    font-family: 'DM Serif Display', serif;
    flex-shrink: 0;
}

.rygen-name {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.rygen-status {
    color: #00BCD4;
    font-size: 12px;
    margin-top: 1px;
}

.rygen-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 26px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}

.rygen-close:hover {
    color: #fff;
}

/* Messages Area */
.rygen-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f5f7fa;
}

.rygen-messages::-webkit-scrollbar {
    width: 5px;
}

.rygen-messages::-webkit-scrollbar-track {
    background: transparent;
}

.rygen-messages::-webkit-scrollbar-thumb {
    background: #c5cdd8;
    border-radius: 3px;
}

/* Message Bubbles */
.rygen-msg {
    display: flex;
    gap: 8px;
    max-width: 88%;
    animation: none;
}

.rygen-msg-animate {
    animation: rygenSlideIn 0.3s ease;
}

.rygen-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.rygen-msg-bot {
    align-self: flex-start;
}

.rygen-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00BCD4, #0097A7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    font-family: 'DM Serif Display', serif;
}

.rygen-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
}

.rygen-msg-bot .rygen-msg-bubble {
    background: #fff;
    color: #1a2332;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.rygen-msg-user .rygen-msg-bubble {
    background: linear-gradient(135deg, #00BCD4, #0097A7);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.rygen-typing .rygen-msg-bubble {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 14px 18px;
}

.rygen-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00BCD4;
    animation: rygenBounce 1.4s infinite ease-in-out both;
}

.rygen-dot:nth-child(1) { animation-delay: -0.32s; }
.rygen-dot:nth-child(2) { animation-delay: -0.16s; }
.rygen-dot:nth-child(3) { animation-delay: 0s; }

/* Suggestions */
.rygen-suggestions {
    padding: 8px 16px 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #f5f7fa;
    flex-shrink: 0;
}

.rygen-suggestion {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #00BCD4;
    background: #fff;
    color: #00838f;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.rygen-suggestion:hover {
    background: #00BCD4;
    color: #fff;
}

/* Input Area */
.rygen-input-area {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    gap: 8px;
    border-top: 1px solid #e8ecf0;
    background: #fff;
    flex-shrink: 0;
}

#rygen-input {
    flex: 1;
    border: 1px solid #dce2e8;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'Inter', sans-serif;
    color: #1a2332;
    background: #f5f7fa;
}

#rygen-input::placeholder {
    color: #8896a6;
}

#rygen-input:focus {
    border-color: #00BCD4;
    background: #fff;
}

#rygen-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #00BCD4, #0097A7);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#rygen-send svg {
    width: 18px;
    height: 18px;
}

#rygen-send:hover {
    transform: scale(1.06);
    box-shadow: 0 2px 12px rgba(0, 188, 212, 0.4);
}

/* Animations */
@keyframes rygenSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rygenBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #rygen-window {
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    #rygen-toggle .rygen-btn-label {
        display: none;
    }

    #rygen-toggle {
        bottom: 20px;
        right: 20px;
    }

    #rygen-toggle .rygen-btn-inner {
        width: 54px;
        height: 54px;
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    #rygen-window {
        width: 340px;
        right: 16px;
        bottom: 90px;
        max-height: 480px;
    }

    #rygen-toggle {
        bottom: 20px;
        right: 16px;
    }
}
