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

body {
    background-color: #f0f5ff;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }
}

.chat-section {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.waifu-container {
    position: relative;
    text-align: center;
    background: linear-gradient(135deg, #ffd1dc, #ffb6c1);
    padding-top: 20px;
}

.waifu-image-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

#waifu-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

#regenerate-image {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

#regenerate-image:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.character-name {
    padding: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    background: rgba(255, 255, 255, 0.8);
    margin-top: 10px;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 400px;
    padding: 20px;
}

.transcript {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
    background: #f9f9f9;
}

.message {
    margin-bottom: 15px;
    border-radius: 10px;
    padding: 10px 15px;
    max-width: 85%;
    position: relative;
    line-height: 1.4;
}

.user-message {
    align-self: flex-end;
    background-color: #e1f5fe;
    margin-left: auto;
    border-radius: 18px 18px 0 18px;
}

.bot-message {
    align-self: flex-start;
    background-color: #ffebee;
    margin-right: auto;
    border-radius: 18px 18px 18px 0;
}

.input-container {
    display: flex;
    margin-top: auto;
    gap: 10px;
}

textarea {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 12px 20px;
    resize: none;
    font-size: 1rem;
    height: 50px;
    outline: none;
    transition: border-color 0.3s;
}

textarea:focus {
    border-color: #ffb6c1;
}

button {
    background: #ffb6c1;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
}

button:hover {
    background: #ff8da1;
    transform: scale(1.05);
}

.retry-button {
    width: auto;
    border-radius: 10px;
    padding: 8px 15px;
    margin-top: 10px;
    background: #ffb6c1;
    color: white;
    height: auto;
    font-size: 0.9rem;
}

.retry-button:hover {
    background: #ff8da1;
}

.typing-indicator {
    display: flex;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

.typing-indicator span {
    height: 10px;
    width: 10px;
    margin: 0 2px;
    background-color: #ffb6c1;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.5s infinite ease-in-out;
}

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

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

.hidden {
    display: none;
}

@keyframes bounce {
    0%, 80%, 100% { 
        transform: scale(0);
    }
    40% { 
        transform: scale(1);
    }
}

.character-section {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.traits-container {
    margin-bottom: 20px;
}

#traits-input {
    width: 100%;
    height: 100px;
    margin-bottom: 10px;
    border-radius: 10px;
}

#generate-traits {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
    height: 40px;
}

.suggestions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.suggestion {
    background: #f0f5ff;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.suggestion:hover {
    background: #d4e4ff;
}

.save-character {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#character-name-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 10px;
    outline: none;
}

#save-character {
    width: auto;
    border-radius: 10px;
    padding: 0 20px;
}

.saved-characters-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.saved-character {
    background: #f0f5ff;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.saved-character:hover {
    background: #d4e4ff;
}

.saved-character h5 {
    margin-bottom: 5px;
    color: #333;
}

.saved-character p {
    color: #666;
    font-size: 0.9rem;
}