/* 물레방아하우스 챗봇 스타일 */

/* 플로팅 버튼 */
.chatbot-button {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-pine) 100%);
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(31, 25, 20, 0.18);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    border: none;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 14px 40px rgba(31, 25, 20, 0.22);
}

/* 예약 페이지 특화 위치 (예약하기 버튼 위치로 이동) */
body.reservation-hub-page .chatbot-button {
    bottom: 30px;
}

.chatbot-floating-hint {
    position: fixed;
    right: 88px;
    bottom: 176px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(33, 29, 26, 0.78);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 999;
    box-shadow: 0 8px 24px rgba(31, 25, 20, 0.18);
    transform-origin: right bottom;
    animation: chatbot-hint-wiggle 3.6s ease-in-out infinite;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.chatbot-floating-hint.is-hidden {
    opacity: 0;
    animation: none;
    transform: translateY(6px);
    pointer-events: none;
}

@keyframes chatbot-hint-wiggle {

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

    25% {
        transform: translate3d(-1px, -1px, 0) rotate(-0.8deg);
    }

    50% {
        transform: translate3d(0, -2px, 0) rotate(0.5deg);
    }

    75% {
        transform: translate3d(1px, -1px, 0) rotate(-0.5deg);
    }
}

.chatbot-button svg {
    width: 48px;
    height: 48px;
    display: block;
}

/* 대화창 컨테이너 */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 420px;
    height: 660px;
    background: rgba(255, 255, 255, 0.86);
    border-radius: 20px;
    box-shadow: 0 18px 60px rgba(31, 25, 20, 0.16);
    border: 1px solid rgba(31, 25, 20, 0.14);
    display: none;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-container.open {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* 헤더 */
.chatbot-header {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-pine) 100%);
    color: white;
    padding: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.chatbot-close:hover {
    opacity: 0.8;
}

/* 메시지 영역 */
.chatbot-messages {
    flex: 1;
    padding: 22px;
    overflow-y: auto;
    background: rgba(251, 247, 239, 0.72);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* 메시지 버블 */
.message {
    max-width: 80%;
    padding: 13px 17px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-pine) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.82);
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 8px 18px rgba(31, 25, 20, 0.08);
    border: 1px solid rgba(31, 25, 20, 0.10);
}

/* 타이핑 인디케이터 */
.typing-indicator {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.82);
    padding: 13px 21px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 8px 18px rgba(31, 25, 20, 0.08);
    border: 1px solid rgba(31, 25, 20, 0.10);
    display: none;
}

.typing-indicator.active {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* 입력 영역 */
.chatbot-input-area {
    padding: 16px 22px;
    background: rgba(255, 255, 255, 0.86);
    border-top: 1px solid rgba(31, 25, 20, 0.12);
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    border: 2px solid rgba(31, 25, 20, 0.14);
    border-radius: 25px;
    padding: 11px 18px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: rgba(123, 75, 42, 0.70);
}

.chatbot-send {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-pine) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 26px rgba(31, 25, 20, 0.18);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chatbot-send svg {
    width: 22px;
    height: 22px;
    fill: white;
}

/* 환영 메시지 */
.welcome-message {
    text-align: center;
    color: var(--text-light);
    font-size: 15px;
    padding: 20px;
    margin-top: 20px;
}

.welcome-message h4 {
    margin: 0 0 10px 0;
    color: var(--text-color);
    font-size: 18px;
}

.suggested-questions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.suggested-question {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(123, 75, 42, 0.50);
    color: rgba(123, 75, 42, 0.95);
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    text-align: center;
}

.suggested-question:hover {
    background: rgba(123, 75, 42, 0.95);
    color: white;
}

/* 모바일 반응형 */
@media (max-width: 480px) {
    .chatbot-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chatbot-button {
        bottom: 86px;
        right: 20px;
        width: 60px;
        height: 60px;
    }

    body.reservation-hub-page .chatbot-button {
        bottom: 20px;
    }

    .chatbot-floating-hint {
        right: 62px;
        bottom: 154px;
        min-height: 32px;
        padding: 0 12px;
        font-size: 13px;
    }
}

/* 소스 링크 */
.message-sources {
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.7;
    font-style: italic;
}

.floating-reservation-button {
    position: fixed;
    right: 30px;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(33, 29, 26, 0.9);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(31, 25, 20, 0.18);
    z-index: 999;
    backdrop-filter: blur(2px);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.floating-reservation-button .button-emoji {
    font-size: 26px;
    margin-bottom: 2px;
    line-height: 1;
}

.floating-reservation-button .button-text {
    font-size: 16px;
    font-weight: 700;
}

.floating-reservation-button:hover {
    background: rgba(33, 29, 26, 1);
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    .floating-reservation-button {
        right: 20px;
        bottom: 20px;
        width: 60px;
        height: 60px;
    }

    .floating-reservation-button .button-emoji {
        font-size: 18px;
    }

    .floating-reservation-button .button-text {
        font-size: 13px;
    }
}