/* static/chat.css */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
    --main-bg: #161f2e;
    --card-bg: #1e2a3d;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #4fffb0;
    --accent-dim: rgba(79, 255, 176, 0.14);
    --user-bubble: #4fffb0;
    --bot-bubble: #243044;
    --text-primary: #ecf0f7;
    --text-secondary: #7a90aa;
    --text-muted: #3d5068;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', 'DM Sans', sans-serif;
    background: var(--main-bg);
    background-image:
        radial-gradient(ellipse 60% 40% at 20% 0%, rgba(79, 255, 176, 0.07) 0%, transparent 60%),
        radial-gradient(ellipse 40% 60% at 80% 100%, rgba(56, 120, 255, 0.07) 0%, transparent 60%);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: var(--text-primary);
}

#chat-container {
    width: 90%;
    max-width: 860px;
    height: 88vh;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 0 1px rgba(79, 255, 176, 0.04),
        0 40px 80px -20px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    position: relative;
}

/* 상단 미세 라인 포인트 */
#chat-container::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
}

/* 헤더 */
.header {
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: rgba(22, 31, 46, 0.8);
}

.header h1 {
    font-family: 'DM Mono', monospace;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.08em;
    color: var(--accent);
    text-transform: uppercase;
}

.header .status {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 7px;
    letter-spacing: 0.02em;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* 채팅창 */
#chat-window {
    flex: 1;
    padding: 28px 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#chat-window::-webkit-scrollbar { width: 4px; }
#chat-window::-webkit-scrollbar-track { background: transparent; }
#chat-window::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

/* 메시지 버블 */
.message {
    max-width: 72%;
    padding: 13px 18px;
    border-radius: 16px;
    font-size: 0.925rem;
    line-height: 1.65;
    animation: fadeUp 0.25s ease forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.user-message {
    align-self: flex-end;
    background: var(--user-bubble);
    color: #050d0a;
    font-weight: 600;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 20px rgba(79, 255, 176, 0.2);
}

.bot-message {
    align-self: flex-start;
    background: var(--bot-bubble);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

/* 입력 영역 */
#input-area {
    padding: 20px 28px;
    background: rgba(22, 31, 46, 0.9);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    align-items: center;
}

#user-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 18px;
    color: var(--text-primary);
    font-family: 'Pretendard', 'DM Sans', sans-serif;
    font-size: 0.925rem;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

#user-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

#user-input:focus {
    border-color: rgba(79, 255, 176, 0.35);
    background: rgba(79, 255, 176, 0.03);
}

#send-btn {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(79, 255, 176, 0.25);
    border-radius: 12px;
    padding: 0 22px;
    height: 46px;
    font-family: 'Pretendard', 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
    white-space: nowrap;
}

#send-btn:hover {
    background: rgba(79, 255, 176, 0.18);
    border-color: rgba(79, 255, 176, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(79, 255, 176, 0.15);
}

#send-btn:active {
    transform: translateY(0);
}
