/* Chatbot Styles - Neon Midnight Theme */
:root {
    --chat-bg: #1a1a2e;
    --chat-header-bg: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --chat-accent: #00d4ff;
    --chat-accent-glow: rgba(0, 212, 255, 0.4);
    --chat-user-msg-bg: #302b63;
    --chat-bot-msg-bg: #2a2a40;
    --chat-text-color: #e0e0e0;
    --chat-border-radius: 16px;
}

/* Floating Button */
.chatbot-toggler {
    position: fixed;
    bottom: 90px; /* FAB 위에 위치 */
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--chat-header-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--chat-accent-glow), 0 5px 15px rgba(0,0,0,0.3);
    border: 2px solid var(--chat-accent);
    z-index: 9999;
    transition: all 0.3s ease;
    animation: pulse-glow 2s infinite;
}

.chatbot-toggler:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px var(--chat-accent-glow);
}

.chatbot-toggler span {
    position: absolute;
    color: #fff;
    font-size: 28px;
    transition: all 0.3s ease;
}

.chatbot-toggler span:last-child,
.chatbot-toggler.show-chat span:first-child {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.chatbot-toggler.show-chat span:last-child {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 10px var(--chat-accent-glow); }
    50% { box-shadow: 0 0 20px var(--chat-accent-glow), 0 0 10px var(--chat-accent); }
    100% { box-shadow: 0 0 10px var(--chat-accent-glow); }
}

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 160px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: var(--chat-bg);
    border-radius: var(--chat-border-radius);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5);
    transform-origin: bottom right;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.show-chat .chatbot-window {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* Header */
.chat-header {
    background: var(--chat-header-bg);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header-icon {
    width: 35px;
    height: 35px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--chat-accent);
}

.chat-header h2 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.chat-header p {
    color: #aaa;
    font-size: 0.8rem;
    margin: 0;
}

.chat-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.chat-close-btn:hover {
    opacity: 1;
}

/* Chat Box (Messages) */
.chat-box {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(0,0,0,0.2);
}

.chat-box::-webkit-scrollbar {
    width: 6px;
}
.chat-box::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.chat-msg {
    display: flex;
    max-width: 80%;
    align-items: flex-end;
}

.chat-msg.bot {
    align-self: flex-start;
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-icon {
    width: 30px;
    height: 30px;
    background: var(--chat-header-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--chat-accent);
    margin-right: 8px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.1);
}

.chat-msg.user .msg-icon {
    display: none; /* 유저는 아이콘 생략 */
}

.msg-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    word-break: break-word;
}

.chat-msg.bot .msg-content {
    background: var(--chat-bot-msg-bg);
    color: var(--chat-text-color);
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(255,255,255,0.05);
}

.chat-msg.user .msg-content {
    background: var(--chat-accent);
    color: #000;
    font-weight: 500;
    border-bottom-right-radius: 2px;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.2);
}

/* Chat Input */
.chat-input-area {
    padding: 15px;
    background: var(--chat-bg);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    gap: 10px;
}

.chat-input-area textarea {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 10px 15px;
    color: #fff;
    font-size: 0.95rem;
    resize: none;
    height: 45px;
    outline: none;
    transition: all 0.3s;
}

.chat-input-area textarea:focus {
    border-color: var(--chat-accent);
    background: rgba(255,255,255,0.1);
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    background: var(--chat-accent);
    border: none;
    border-radius: 50%;
    color: #000;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--chat-accent-glow);
}

/* Action Buttons inside Bot Message */
.bot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.bot-action-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--chat-accent);
    color: var(--chat-accent);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.bot-action-btn:hover {
    background: var(--chat-accent);
    color: #000;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .chatbot-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    .chatbot-toggler {
        bottom: 80px;
        right: 15px;
    }
}
