* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f7f4;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: linear-gradient(135deg, #e6f7f0 0%, #f0f7f4 100%);
}

.chat-container {
    width: 100%;
    max-width: 600px;
    height: 80vh;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    margin: 20px;
    overflow: hidden;
    border: 1px solid rgba(22, 163, 74, 0.1);
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid rgba(22, 163, 74, 0.2);
    background-color: #16a34a;
    color: white;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 4px 6px rgba(22, 163, 74, 0.1);
    position: relative;
    z-index: 1;
}

.chat-header h1 {
    font-size: 1.5rem;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #f8fdfb;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2316a34a' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.message {
    display: flex;
    align-items: flex-start;
    max-width: 80%;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.received {
    align-self: flex-start;
}

.message.sent {
    align-self: flex-end;
}

.message-content {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    position: relative;
}

.message.received .message-content {
    background-color: white;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(22, 163, 74, 0.1);
}

.message.received .message-content::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: -8px;
    width: 16px;
    height: 16px;
    background-color: white;
    border-left: 1px solid rgba(22, 163, 74, 0.1);
    border-bottom: 1px solid rgba(22, 163, 74, 0.1);
    transform: rotate(45deg);
    z-index: -1;
}

.message.sent .message-content {
    background-color: #16a34a;
    color: white;
    border-bottom-right-radius: 4px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.message.sent .message-content::before {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -8px;
    width: 16px;
    height: 16px;
    background-color: #16a34a;
    transform: rotate(45deg);
    z-index: -1;
}

.message.received.error .message-content {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid rgba(185, 28, 28, 0.2);
}

.message.received.error .message-content::before {
    background-color: #fee2e2;
    border-left: 1px solid rgba(185, 28, 28, 0.2);
    border-bottom: 1px solid rgba(185, 28, 28, 0.2);
}

.chat-input {
    padding: 20px;
    border-top: 1px solid rgba(22, 163, 74, 0.2);
    display: flex;
    gap: 12px;
    background-color: white;
    position: relative;
    z-index: 1;
    box-shadow: 0 -4px 6px rgba(22, 163, 74, 0.05);
}

input[type="text"] {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid rgba(22, 163, 74, 0.3);
    border-radius: 24px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.05);
}

input[type="text"]:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

button {
    padding: 14px 24px;
    background-color: #16a34a;
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    background-color: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(22, 163, 74, 0.3);
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(22, 163, 74, 0.2);
}

button:disabled {
    background-color: #86efac;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* スクロールバーのカスタマイズ */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(22, 163, 74, 0.05);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(22, 163, 74, 0.3);
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background-color: rgba(22, 163, 74, 0.5);
}

/* レスポンシブデザイン */
@media (max-width: 480px) {
    .chat-container {
        height: 100vh;
        margin: 0;
        border-radius: 0;
        border: none;
    }

    .chat-header {
        border-radius: 0;
    }

    .message {
        max-width: 90%;
    }
} 