body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    color: #333;
    overflow: hidden;
}

#app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

#designer-panel {
    width: 400px;
    padding: 20px;
    background-color: #fff;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

h1, h2 {
    color: #1a1a1a;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-top: 0;
}

h2 {
    font-size: 1.2em;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

#dialogue-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 5px;
    font-weight: 600;
}

select, textarea, button {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

textarea {
    resize: vertical;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    flex-basis: auto;
    margin-right: 5px; /* Add some space between buttons */
}

button:hover {
    background-color: #0056b3;
}

#scene-controls {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

#scene-controls button {
    flex: 1;
    margin: 0;
}

#play-scene-button {
    background-color: #28a745;
}

#play-scene-button:hover {
    background-color: #218838;
}

#play-scene-button:disabled, #live-chat-button:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

#live-chat-button {
    background-color: #ffc107;
    color: #212529;
}

#live-chat-button:hover {
    background-color: #e0a800;
}

#live-chat-button.live {
    background-color: #dc3545;
    color: white;
}

#live-chat-button.live:hover {
    background-color: #c82333;
}

#generate-ai-button {
    background-color: #17a2b8;
}

#generate-ai-button:hover {
    background-color: #138496;
}

#generate-ai-button:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

#script-container {
    flex-grow: 1;
}

#conversation-script {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#conversation-script li {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    border-left: 4px solid #007bff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#conversation-script li .dialogue-text {
    flex-grow: 1;
    margin-right: 10px;
}

#conversation-script li strong {
    color: #0056b3;
}

#conversation-script li .controls {
    display: flex;
    align-items: center;
}

#conversation-script li .delete-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px;
}

#preview-panel {
    flex-grow: 1;
    position: relative;
    background: #e0e0e0;
}

#scene-container {
    width: 100%;
    height: 100%;
}

#subtitles {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.2em;
    max-width: 80%;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

#loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5em;
}

#loading-overlay.hidden {
    display: none;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#ai-settings {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #eee;
}

#ai-settings h2 {
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}