/* Tailwind CSS 커스텀 스타일 */

/* CSS 변수 정의 */
:root {
    --scrollbar-width: 8px;
    --scrollbar-track: #f1f1f1;
    --scrollbar-thumb: #bdc3c7;
    --scrollbar-thumb-hover: #95a5a6;
    --animation-duration: 0.3s;
}

/* 전체 높이 제한 */
html,
body {
    height: 100%;
    overflow: hidden;
}

/* 스크롤바 스타일링 - 기본적으로 숨김, hover/스크롤 시 표시 */
#chat-messages {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s ease;
}

#chat-messages::-webkit-scrollbar {
    width: var(--scrollbar-width);
}

#chat-messages::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
    transition: background 0.3s ease, opacity 0.3s ease;
}

/* CSS :hover로 기본 hover 효과 제공 */
#chat-messages:hover::-webkit-scrollbar-thumb {
    background: rgba(189, 195, 199, 0.5);
}

#chat-messages:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(149, 165, 166, 0.7);
}

/* JavaScript로 제어하는 스크롤바 표시 클래스 */
#chat-messages.scrolling::-webkit-scrollbar-thumb,
#chat-messages.show-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(189, 195, 199, 0.5);
    opacity: 1;
}

#chat-messages.scrolling::-webkit-scrollbar-thumb:hover,
#chat-messages.show-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(149, 165, 166, 0.7);
}

/* Firefox 스크롤바 */
#chat-messages:hover,
#chat-messages.scrolling,
#chat-messages.show-scrollbar {
    scrollbar-color: rgba(189, 195, 199, 0.5) transparent;
}

/* 메시지 말풍선 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: fadeIn var(--animation-duration) ease-in;
    will-change: opacity, transform;
}

/* 로딩 인디케이터 스타일 */
.loading-dots {
    display: inline-block;
    min-width: 1em;
    text-align: left;
}

/* 마인드맵 스타일 */
#mindmap-container svg {
    width: 100%;
    height: 100%;
    cursor: move;
    display: block;
}

#mindmap-container .node {
    cursor: pointer;
    transition: transform 0.2s ease;
}

#mindmap-container .node:hover circle {
    r: 10 !important;
    transition: r 0.2s ease;
}

#mindmap-container .link {
    transition: stroke-opacity 0.2s ease;
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    .message,
    #mindmap-container .node,
    #mindmap-container .link {
        animation: none;
        transition: none;
    }
}

/* 포커스 스타일 개선 */
#chat-input:focus-visible,
#send-button:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Textarea 스타일 */
#chat-input {
    min-height: 48px !important;
    max-height: 120px !important; /* 4줄 최대 높이 강제 제한 */
    line-height: 1.5em;
    transition: height 0.2s ease, border-color 0.2s ease;
    vertical-align: bottom;
    overflow-y: auto !important;
    resize: none !important;
    /* 스크롤바 완전히 숨김 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

#chat-input::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
    width: 0;
    height: 0;
}

#chat-input::placeholder {
    line-height: 1.5;
    opacity: 0.6;
}



