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

:root {
    --toss-blue: #1F4EF5;
    --toss-blue-light: #4880EE;
    --toss-blue-lighter: #83B4F9;
    --toss-gray: #F5F5F7;
    --toss-gray-dark: #E5E5EA;
    --toss-text: #333333;
    --toss-text-light: #8E8E93;
    --toss-white: #FFFFFF;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--toss-gray);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    background: var(--toss-white);
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 90vh;
    max-height: 800px;
}

header {
    background: var(--toss-white);
    color: var(--toss-text);
    padding: 28px 20px 20px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--toss-text);
    letter-spacing: -0.3px;
}

.subtitle {
    color: var(--toss-text-light);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

.chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background: var(--toss-white);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--toss-white);
}

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

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.message {
    display: flex;
    animation: fadeIn 0.25s ease-out;
}

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

.user-message {
    justify-content: flex-end;
}

.bot-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
    position: relative;
    font-size: 15px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.user-message .message-content {
    background: var(--toss-blue);
    color: var(--toss-white);
    font-weight: 400;
    box-shadow: 0 2px 4px rgba(31, 78, 245, 0.15);
}

.bot-message .message-content {
    background: var(--toss-gray-dark);
    color: var(--toss-text);
    font-weight: 400;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}


.chat-input-container {
    display: flex;
    padding: 16px 20px 20px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    gap: 12px;
    align-items: flex-end;
    background: var(--toss-white);
}

#user-input {
    flex: 1;
    border: 1px solid var(--toss-gray-dark);
    border-radius: 22px;
    padding: 12px 18px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    transition: all 0.2s ease;
    background: var(--toss-gray);
    color: var(--toss-text);
}

#user-input:focus {
    outline: none;
    border-color: var(--toss-blue);
    background: var(--toss-white);
    box-shadow: 0 0 0 3px rgba(31, 78, 245, 0.1);
}

#user-input::placeholder {
    color: var(--toss-text-light);
}

.send-button {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--toss-blue);
    color: var(--toss-white);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(31, 78, 245, 0.25);
}

.send-button:hover {
    background: var(--toss-blue-light);
    box-shadow: 0 4px 12px rgba(31, 78, 245, 0.35);
    transform: translateY(-1px);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: var(--toss-blue);
}

.send-button svg {
    stroke: var(--toss-white);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--toss-gray-dark);
    border-radius: 18px;
    width: fit-content;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}


.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--toss-text-light);
    animation: typing 1.4s infinite ease-in-out;
}

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

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

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

@media (max-width: 600px) {
    body {
        padding: 0;
    }

    .container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }
    
    header {
        padding: 20px 16px 16px 16px;
    }
    
    header h1 {
        font-size: 20px;
    }

    .subtitle {
        font-size: 13px;
    }
    
    .message-content {
        max-width: 85%;
        font-size: 14px;
    }

    .chat-messages {
        padding: 16px;
    }

    .chat-input-container {
        padding: 12px 16px;
    }

    #user-input {
        font-size: 14px;
        padding: 10px 14px;
    }

    .send-button {
        width: 40px;
        height: 40px;
    }
}
