* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00d2ff;
    --primary-dark: #3a7bd5;
    --secondary: #3a7bd5;
    --accent: #4ade80;
    --success: #4ade80;
    --danger: #f87171;
    --warning: #fbbf24;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
}

body {
    font-family: 'Noto Sans KR', 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
    color: var(--text-main);
}

.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(100px);
    opacity: 0.15;
    border-radius: 50%;
    animation: blobMove 30s infinite alternate ease-in-out;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    right: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    bottom: -150px;
    left: -100px;
}

@keyframes blobMove {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(50px, 50px) scale(1.1); }
}

.container {
    width: 100%;
    max-width: 1000px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 32px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 92vh;
    max-height: 900px;
    animation: containerIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    padding: 24px 32px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 8px 16px rgba(0, 210, 255, 0.3);
}

.header-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 2px;
}

.header-text p {
    font-size: 13px;
    color: var(--text-dim);
}

.icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 18px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.status-bar {
    padding: 12px 32px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
}

.status-item i { color: var(--primary); }

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    scroll-behavior: smooth;
}

.welcome-screen {
    text-align: center;
    padding: 60px 20px;
    animation: fadeIn 1s ease;
}

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

.welcome-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--primary);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.welcome-title {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 15px;
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--text-dim);
    line-height: 1.6;
    max-width: 450px;
    margin: 0 auto;
}

.welcome-tips {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    text-align: left;
    transition: all 0.3s;
}

.tip-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.tip-item i {
    font-size: 20px;
    color: var(--primary);
}

.tip-text {
    font-size: 14px;
    color: var(--text-dim);
}

.tip-text strong {
    color: white;
    font-weight: 600;
}

.message {
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    animation: msgIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.message.user { flex-direction: row-reverse; }

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.message.user .message-avatar {
    background: var(--primary);
    color: white;
}

.message.assistant .message-avatar {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--accent);
}

.message-content {
    max-width: 75%;
    padding: 14px 20px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 15px;
    position: relative;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}

.message.system .message-content {
    background: rgba(251, 191, 36, 0.1);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
    text-align: center;
    max-width: 100%;
    font-size: 13px;
    border-radius: 12px;
}

.typing-indicator {
    display: none;
    padding: 12px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    gap: 6px;
    margin-bottom: 24px;
}

.typing-indicator.active { display: flex; }

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: typeDot 1.4s infinite;
}

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

@keyframes typeDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-8px); opacity: 1; }
}

.quick-actions {
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.quick-actions::-webkit-scrollbar { height: 0; }

.quick-btn {
    padding: 10px 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.quick-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.input-container {
    padding: 24px 30px;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 12px;
    align-items: center;
}

.input-wrapper { flex: 1; position: relative; }

#messageInput {
    width: 100%;
    padding: 14px 50px 14px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: white;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
}

#messageInput:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
}

.clear-btn.visible { display: flex; }

#sendBtn {
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

#sendBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 210, 255, 0.3);
}

#sendBtn:disabled { opacity: 0.5; cursor: not-allowed; }

.scroll-to-bottom {
    position: absolute;
    bottom: 120px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.scroll-to-bottom.visible { display: flex; }

.chat-container::-webkit-scrollbar { width: 6px; }
.chat-container::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

footer {
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    opacity: 0.7;
}

footer .source-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

footer .source-label {
    font-weight: 600;
    color: var(--text-dim);
}

footer .source-text {
    color: var(--text-dim);
    opacity: 0.8;
}

@media (max-width: 768px) {
    body { padding: 0; }
    .container { height: 100vh; max-height: 100vh; border-radius: 0; }
    .header { padding: 16px 20px; }
    .chat-container { padding: 20px; }
    .input-container { padding: 16px 20px; }
    .message-content { max-width: 85%; }
    footer {
        padding: 15px 20px;
        font-size: 0.75rem;
    }
}
