@charset "utf-8";
@import url("https://cdn.jsdelivr.net/gh/fonts-archive/Paperlogy/subsets/Paperlogy-dynamic-subset.css");
/* [1. CSS Variables] */
:root {
    --main-blue: #00479d;
    --light-blue: #166bd3;
    --bg-blue: #ebf2fb;
    --border-color: #cfdbe9;
    --text-dark: #565656;
    --text-gray: #999;
    --scroll-thumb: #b3c7ff;
    --scroll-track: #f1f4f9;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Pretendard', sans-serif; line-height: 1.6em; }
.wrapper { background: #fff; color: var(--text-dark); display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* [2. Scrollbar] - 커스텀 블루 스크롤바 */
.main-wrapper::-webkit-scrollbar { width: 8px; }
.main-wrapper::-webkit-scrollbar-track { background: var(--scroll-track); }
.main-wrapper::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 10px; }
.main-wrapper::-webkit-scrollbar-thumb:hover { background: #80a4ff; }

/* [3. Header] - 100px 고정 헤더 */
.header { background:url("../img/bg-header.webp") no-repeat center top / cover; color: white; height: 100px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.header-content { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.header-content img { max-height: 60px; width: auto; object-fit: contain; }

/* [4. Layout] */
.main-wrapper { flex-grow: 1; overflow-y: auto; padding: 40px 20px; scroll-behavior: smooth; }
.container { max-width: 1200px; margin: 0 auto; }

/* [5. Landing Section] */
#landing-section { text-align: center; margin-bottom: 50px; }

.mascot { width: 278px; height: 200px; margin: 0 auto 30px; display: flex; align-items: center; justify-content: center; background-color: #e0f0ff; }
.mascot-video { width: 100%; height: 100%;  object-fit: cover; /* 영상을 영역에 꽉 채움 */}

.main-title { font-family: "Paperlogy"; letter-spacing: 0.02em; font-size: 2.6rem; margin-bottom: 40px; font-weight: 600; color: #1a1a1a; }
.main-title span { font-family: inherit; color: var(--light-blue);}

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding:30px 35px; cursor: pointer; transition: 0.3s; text-align: left; display: flex; flex-direction: column; gap: 20px; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); border-color: var(--light-blue); }
.card-icon { width: 44px; height: 44px; background: var(--bg-blue); color: var(--light-blue); border-radius: 50px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem;}
.card p { font-size: 1.0625rem; font-weight: 300; word-break: keep-all; }

/* [6. Chat UI] */
#chat-history { display: flex; flex-direction: column; gap: 30px; }
.chat-row { display: flex; flex-direction: column; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* User Message */
.user-msg-wrapper { align-self: flex-end; display: flex; flex-direction: column; align-items: flex-end; max-width: 80%; }
.user-bubble { background: #eef4ff; padding: 12px 20px; border-radius: 20px 20px 0 20px; font-size: 1rem; }

/* Bot Message & Loading Animation */
.bot-msg-wrapper { align-self: flex-start; display: flex; gap: 12px; width: 100%; }
.bot-avatar { width: 52px; height: 52px; background: var(--bg-blue); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bot-avatar img { width: 40px;}
.bot-content { flex-grow: 1; max-width: 85%; text-align: left; }

/* [추가됨] 점 세개 로딩 애니메이션 / Three-dot Loading Animation */
.dots { display: flex; gap: 4px; padding: 10px 0; }
.dot { width: 6px; height: 6px; background: #ccc; border-radius: 50%; animation: dotBounce 1.4s infinite ease-in-out both; }
.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes dotBounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }

.bot-text { margin-bottom: 15px; }
.bot-text .p-title { color: #000; font-size: 1.25rem; font-weight: 600;}

/* Markdown Styling */
.markdown-body p { margin-bottom: 10px; }
.markdown-body p:last-child { margin-bottom: 0; }
.markdown-body ul, .markdown-body ol { margin: 10px 0 10px 20px; }
.markdown-body li { margin-bottom: 5px; }
.markdown-body strong { font-weight: 700; color: #000; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 15px 0 10px; font-weight: 600; color: #000; }
.markdown-body h1 { font-size: 1.4rem; }
.markdown-body h2 { font-size: 1.25rem; }
.markdown-body h3 { font-size: 1.1rem; }
.markdown-body blockquote { border-left: 4px solid var(--border-color); padding-left: 15px; color: #666; font-style: italic; margin: 10px 0; }
.markdown-body code { background: #f0f0f0; padding: 2px 4px; border-radius: 4px; font-family: monospace; font-size: 0.9em; }
.markdown-body pre { background: #f0f0f0; padding: 10px; border-radius: 8px; overflow-x: auto; margin: 10px 0; }
.markdown-body pre code { background: none; padding: 0; }
.bot-link { color: var(--light-blue); text-decoration: none; border-bottom: 1px solid var(--light-blue); font-weight: 600; display: inline-block; transition: 0.3s;}
.bot-link i { font-size: 1.125rem; font-weight: normal;}
.bot-link:hover { color: var(--main-blue); border-bottom: 1px solid var(--main-blue);}

/* Action Buttons */
.action-row { display: flex; align-items: center; gap: 15px; margin-top: 15px; color: var(--text-gray); }
.action-btn { background: none; border: none; cursor: pointer; color: var(--text-gray); position: relative; display: inline-flex; align-items: center; justify-content: center; font-size: 1.125rem; transition: 0.2s; }
.action-btn:hover { color: var(--main-blue); }
.action-btn.active { color: var(--light-blue) !important;}

/* 툴팁 공통 스타일 */
.action-btn::after { content: attr(data-tooltip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background-color: #333; color: #fff; padding: 2px 10px; border-radius: 4px; font-size: 0.75rem; white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 10;}
.action-btn:hover::after,.action-btn:hover::before { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(-5px); }

.timestamp { font-size: 0.75rem; color: #bbb; }

/* Suggestion Cards */
.suggest-grid { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.suggest-card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 11px; flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: 0.2s; }
.suggest-card:hover { background: #f8fbff;}

/* [7. Bottom Input] */
.bottom-section { background: white; padding: 20px; border-top: 1px solid #f0f0f0; flex-shrink: 0; }
.search-container { max-width: 990px; margin: 0 auto; }
.disclaimer { font-family: "Paperlogy"; letter-spacing: 0.02em; font-size: .9375rem; color: var(--main-blue); margin-bottom: 12px; text-align: center; font-weight: 500; }
.disclaimer i { font-size: 1.125rem; font-weight: normal;}
.search-bar { display: flex; align-items: center; background: var(--bg-blue); border-radius: 40px; padding: 12px 16px 12px 36px; }
.search-bar input { width: 100%; padding: 10px; border: none; background: transparent; outline: none; font-size: 1.125rem; }
.search-bar input ::placeholder { color: var(--text-gray);}
.send-btn { flex-shrink: 0; width: 48px; height: 48px; background: var(--main-blue); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.3s;}
.send-btn i { color: white; font-size: 1.75rem; font-weight: normal;}
.send-btn:hover { background: var(--light-blue);}

@media (max-width: 900px) { 
    * { line-height: 1.4em; }
    .header { height: 60px; }
    .header-content img { max-height: 35px; }
    .main-wrapper { padding: 20px 15px; }
    .mascot { width: 168px; height: 120px; margin: 0 auto 10px; }
    .main-title { font-size: 1.1rem; letter-spacing: 0; margin-bottom: 20px; }

    .card-grid { grid-template-columns: 1fr; gap: 8px;} 
    .card { border-radius: 8px; padding:12px; gap: 10px; flex-direction: row; }
    .card-icon { width: 24px; height: 24px; font-size: 0.875rem; flex-shrink: 0;}
    .card p { font-size: 0.875rem;}

    .user-bubble { padding: 8px 16px; border-radius: 16px 16px 0 16px; font-size: .875rem; }

    .bot-text { font-size: .875rem; }
    .bot-text .p-title { font-size: 1.05rem;}
    .bot-link { font-size: .875rem;}
    .bot-link i { font-size: 1.05rem;}
    
    .suggest-grid { margin-top: 20px; flex-direction: column; gap: 8px;}
    .suggest-card {border-radius: 8px; padding:8px; gap: 6px; font-size: 0.875rem;}

    .disclaimer { font-size: .6875rem; letter-spacing: 0;}    
    .disclaimer i { font-size: .8125rem;}  
    .search-bar { padding: 6px 8px 6px 16px; }
    .search-bar input { padding: 8px; font-size: 0.95rem; letter-spacing: 0;}
    .send-btn { width: 36px; height: 36px;}
    .send-btn i { font-size: 1.4rem;}
}