body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #93E9BE;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    background-color: #b38b67;
    color: white;
    padding: 15px;
    border-radius: 10px;
}

header h1 {
    font-size: 2em; /* Default font size for desktop */
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
}

.character-card {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.character-card:hover {
    transform: scale(1.05);
}

.character-card img {
    max-width: 100%;
    border-radius: 50%;
    height: 150px;
    width: 150px;
    object-fit: cover;
}

.chat-interface {
    background-color: white;
    border-radius: 10px;
    height: 70vh; /* Default height for desktop */
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    align-items: center;
    background-color: #ff6b6b;
    color: white;
    padding: 10px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.chat-input {
    display: flex;
    padding: 10px;
    background-color: #f0f0f0;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

#userInput {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-right: 10px;
}

#sendButton {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
    max-width: 80%;
}

.user-message {
    background-color: #ff6b6b;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.ai-message {
    background-color: #f0f0f0;
    color: black;
    align-self: flex-start;
}

.miscellaneous-characters {
    margin-top: 30px;
    background-color: #f0f0f0;
    padding: 20px;
    border-radius: 10px;
}

.miscellaneous-characters h2 {
    text-align: center;
    color: #b38b67;
    margin-bottom: 20px;
}

.custom-ai-section {
    text-align: center;
    margin-top: 20px;
}

.custom-ai-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.custom-ai-button:hover {
    background-color: #45a049;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.create-ai-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.create-ai-btn:hover {
    background-color: #ff5252;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-container {
        padding: 10px; /* Adjust padding for smaller screens */
    }

    header h1 {
        font-size: 1.5em; /* Smaller font size for mobile header */
    }

    .characters-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        padding: 10px;
    }
    .character-card {
        padding: 10px;
    }
    .character-card img {
        height: 100px;
        width: 100px;
    }
    
    /* chat-interface height moved to inline style in index.html, keeping it as is */
    /* .chat-interface {
        height: 80vh; 
    } */

    .chat-header {
        padding: 5px;
    }
    .chat-messages {
        padding: 10px;
    }
    .chat-input {
        padding: 5px;
    }
    #userInput {
        padding: 5px;
    }
    #sendButton {
        padding: 5px 10px;
    }
    .message {
        padding: 5px;
    }

    .modal-content {
        width: 95%; /* Make modal nearly full width on small screens */
        margin: 5% auto; /* Adjust margin */
    }
}