body {
    font-family: sans-serif;
    background-color: #212121;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 800px;
}

h1, h2 {
    color: #444;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; /* Important for padding not to affect width */
}

textarea {
    resize: vertical;
}

/* Model Selector Styles */
.model-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.model-option {
    position: relative;
}

.model-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.model-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9f9f9;
    position: relative;
}

.model-label:hover {
    border-color: #9900FF;
    background: #f5f0ff;
}

.model-option input[type="radio"]:checked + .model-label {
    border-color: #9900FF;
    background: #f5f0ff;
    box-shadow: 0 2px 8px rgba(153, 0, 255, 0.2);
}

.model-option input[type="radio"]:checked + .model-label::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 15px;
    color: #9900FF;
    font-weight: bold;
    font-size: 18px;
}

.model-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.model-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    margin-bottom: 0;
}

.model-id {
    font-size: 12px;
    color: #666;
    font-family: monospace;
    margin-bottom: 0;
}

.model-price {
    font-weight: bold;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.model-price.free {
    background: #4CAF50;
    color: white;
}

.model-price.paid {
    background: #f44336;
    color: white;
}

.model-price.custom {
    background: #FF9800;
    color: white;
}

.stagetime-logo {
    display: block;
    margin: 0 auto 20px auto;
    max-width: 180px;
    height: auto;
}
.logo-header {
    text-align: center;
    margin-bottom: 10px;
}

button {
    width: 100%;
    padding: 12px;
    background-color: #9900FF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

button:hover {
    background-color: #7a00cc;
}

#script-details {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

#script-details h3 {
    margin-top: 0;
    color: #9900FF;
}

#script-details ul, #script-details ol {
    margin: 0 0 10px 20px;
}

#script-details .section {
    margin-bottom: 18px;
}

#output-container {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

#script-output {
    background-color: #f8f9fa;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    white-space: pre-wrap; /* Allows text to wrap */
    word-wrap: break-word; /* Breaks long words */
    min-height: 100px;
}

.hidden {
    display: none;
}

#loading {
    text-align: center;
    font-style: italic;
    color: #555;
    padding: 20px;
}

.audience-tag {
    color: #fff;
    background: #9900FF;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
    margin: 0 2px;
    display: inline-block;
}

.sfx-tag {
    color: #fff;
    background: #222;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
    margin: 0 2px;
    display: inline-block;
}
.audience-tag-script {
    color: #fff;
    background: #00B8D9;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
    margin: 0 2px;
    display: inline-block;
}
.audience-tag-value {
    color: #fff;
    background: #43A047;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
    margin: 0 2px;
    display: inline-block;
}
.character-tag {
    color: #fff;
    background: #607D8B;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
    margin: 0 2px;
    display: inline-block;
}
.character-location {
    color: #fff;
    background: #8BC34A;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
    margin: 0 2px;
    display: inline-block;
}
.character-assigned {
    color: #fff;
    background: #9C27B0;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
    margin: 0 2px;
    display: inline-block;
}
.audience-prompt {
    color: #333;
    background: #E1F5FE;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    margin: 0 2px;
    display: inline-block;
}
.audience-examples {
    color: #333;
    background: #FFFDE7;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    margin: 0 2px;
    display: inline-block;
}
.audience-example {
    color: #fff;
    background: #00B8D9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    margin: 0 2px;
    cursor: pointer;
    display: inline-block;
    transition: background 0.2s;
}
.audience-example:hover {
    background: #008C9E;
}

/* Load Script Section Styles */
.load-script-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
}

.load-script-section h3 {
    margin-top: 0;
    color: #9900FF;
    text-align: center;
}

#load-script-btn, #view-stats-btn {
    width: auto;
    padding: 8px 16px;
    margin-left: 10px;
    font-size: 14px;
    display: inline-block;
}

#script-id {
    display: inline-block;
    width: calc(100% - 150px);
    margin-right: 10px;
}

.script-id {
    background: #e8f5e8;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #4CAF50;
}

.script-id-value {
    font-family: monospace;
    font-weight: bold;
    color: #2e7d32;
}

#stats-display {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
}

.stats-info {
    margin-bottom: 15px;
    font-weight: bold;
}

.script-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.script-item {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: background-color 0.2s;
}

.script-item:hover {
    background: #e8f5e8;
    border-color: #4CAF50;
}

.script-item-id {
    font-family: monospace;
    font-weight: bold;
    color: #333;
}

.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h2 {
    margin-top: 0;
}