* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Space Grotesk', sans-serif;
}

body {
    background: linear-gradient(
        45deg,
        #262d4e,
        rgb(36, 69, 73),
        #480685,
        rgb(16, 4, 182)
    );
    background-size: 400% 400%;
    animation: gradientAnimation 10s ease infinite;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.chat-container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(to right, #00eeff, #008b8b);
    color: white;
}

.back-button {
    font-size: 1.5rem;
    margin-right: 15px;
    cursor: pointer;
}

.back-button a {
    text-decoration: none;
    color: white;
}

.chat-title {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.profile-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 10px;
    background-color: white;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-title h1 {
    font-size: 1.2rem;
    font-weight: 600;
}

.menu-button {
    font-size: 1.5rem;
    cursor: pointer;
}

.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #e5e5e5;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.ai-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
}

.message-content {
    padding: 12px 15px;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ai-message .message-content {
    background-color: white;
    border-bottom-left-radius: 5px;
}

.user-message .message-content {
    background-color: #dcf8c6;
    border-bottom-right-radius: 5px;
}

.message-time {
    font-size: 0.7rem;
    color: #999;
    margin-top: 5px;
    align-self: flex-end;
}

.ai-message .message-time {
    margin-left: 5px;
}

.user-message .message-time {
    margin-right: 5px;
}

.chat-input {
    display: flex;
    padding: 15px;
    background-color: #f0f0f0;
    border-top: 1px solid #ddd;
}

#message-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    outline: none;
    background-color: white;
}

#send-button {
    margin-left: 10px;
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(to right, #00eeff, #008b8b);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#send-button:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* モバイル対応のメディアクエリ */
@media (max-width: 767px) {
    .chat-container {
        height: 100vh;
        max-height: none;
        border-radius: 0;
        width: 100%;
    }
    
    body {
        padding: 0;
    }
    
    .message {
        max-width: 90%;
    }
}