/* Basic Wrapper */
.fal-ai-creator-studio-wrapper { max-width: 1200px; margin: 20px auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; }
.fal-cs-header { display: flex; justify-content: flex-end; margin-bottom: 20px; }
.fal-cs-credits { background-color: #f0f8ff; padding: 10px 15px; border-radius: 5px; border: 1px solid #d1eaff; font-size: 16px; }
.fal-cs-tab-nav { display: flex; border-bottom: 1px solid #ddd; margin-bottom: 25px; }
.fal-cs-tab-link { color: #555; padding: 10px 20px; border: none; background-color: transparent; cursor: pointer; font-size: 16px; margin-bottom: -1px; border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s; }
.fal-cs-tab-link:hover { color: #0073aa; }
.fal-cs-tab-link.active { border-bottom: 2px solid #0073aa; font-weight: 600; color: #0073aa; }
.fal-cs-tab-content { display: none; }
.fal-cs-tab-content.active { display: block; animation: fadeIn 0.5s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Form Styles */
.fal-cs-single-column-form { max-width: 700px; margin: 0 auto; }
.fal-cs-form-group { margin-bottom: 20px; }
.fal-cs-form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: #333; }
.fal-cs-form-group textarea, .fal-cs-form-group select, .fal-cs-form-group input[type="range"] { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; font-size: 15px; }
.fal-cs-form-group textarea { resize: vertical; }
.fal-cs-radio-group { display: flex; gap: 20px; }
.fal-cs-radio-group label { display: flex; align-items: center; gap: 5px; font-weight: normal; }
.fal-cs-submit-area { margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.fal-cs-cost-display { font-size: 16px; color: #555; }
.fal-cs-button-primary { background-color: #0073aa; color: white; border: none; padding: 12px 25px; border-radius: 5px; font-size: 16px; cursor: pointer; transition: background-color 0.2s; }
.fal-cs-button-primary:hover { background-color: #005a87; }
.fal-cs-button-primary:disabled { background-color: #ccc; cursor: not-allowed; }
.fal-cs-textarea-wrapper { position: relative; }
.fal-cs-char-counter { position: absolute; bottom: 10px; right: 10px; font-size: 12px; color: #888; }
.fal-cs-settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Image & Audio Upload */
.fal-cs-upload-box { border: 1px dashed #dcdfe6; border-radius: 8px; background-color: #f7faff; padding: 20px; text-align: center; cursor: pointer; transition: all 0.2s ease; min-height: 120px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.fal-cs-upload-box:hover { border-color: #0073aa; background-color: #f0f7ff; }
.fal-cs-upload-prompt { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.fal-cs-upload-icon svg { width: 40px; height: 40px; fill: #0073aa; margin-bottom: 10px; }
.fal-cs-upload-text-main { color: #333; font-weight: 500; }
.fal-cs-upload-text-hint { color: #777; font-size: 13px; margin-top: 4px; }
.fal-cs-upload-box .fal-cs-upload-preview { position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 6px; }
.fal-cs-upload-preview.has-image { background-size: contain; background-repeat: no-repeat; background-position: center; }
.fal-cs-upload-preview.has-audio { display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: #f0f7ff; font-size: 14px; padding: 10px; }
.fal-cs-upload-preview.has-audio p { margin: 0; padding: 0 10px; word-break: break-all; }
.fal-cs-upload-preview.has-audio audio { margin-top: 10px; max-width: 100%; }
.fal-cs-upload-box.has-file .fal-cs-upload-prompt { opacity: 0; }

/* Result & Notification Area */
.fal-cs-result-notification { margin-top: 15px; font-size: 14px; color: #666; }
.fal-cs-result-notification audio { width: 100%; margin-top: 10px; }

/* History Styles */
#fal-cs-history-list-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.fal-cs-history-item { background-color: #fff; border: 1px solid #eee; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.fal-cs-history-item-preview { background-color: #e9e9e9; min-height: 180px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; color: #666; }
.fal-cs-history-item-preview video, .fal-cs-history-item-preview audio { width: 100%; height: auto; display: block; }
.fal-cs-history-item-details { padding: 15px; }
.fal-cs-history-prompt { font-weight: 500; color: #333; margin-top: 0; margin-bottom: 10px; max-height: 60px; overflow: hidden; word-break: break-all; }
.fal-cs-history-meta { font-size: 12px; color: #777; margin: 0; text-transform: capitalize; }
.fal-cs-history-actions { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
.fal-cs-history-btn { background-color: #f0f2f5; border: 1px solid #dcdfe6; border-radius: 4px; padding: 5px 12px; font-size: 13px; cursor: pointer; transition: background-color 0.2s; text-decoration: none; color: #333; display: inline-flex; align-items: center; gap: 5px; }
.fal-cs-history-btn:hover { background-color: #e4e6eb; }

/* Load More Button */
#fal-cs-load-more-container { text-align: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee; }
.fal-cs-load-more-btn { background-color: #0073aa; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; }
.fal-cs-load-more-btn:disabled { background-color: #ccc; cursor: not-allowed; }

/* Loader Animation */
.fal-cs-loader { border: 4px solid #f3f3f3; border-radius: 50%; border-top: 4px solid #0073aa; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

@media (max-width: 768px) { .fal-cs-form-grid { grid-template-columns: 1fr; } .fal-cs-settings-row { grid-template-columns: 1fr; } }