/* --- CORE STYLES --- */
* { box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); min-height: 100vh; margin: 0; padding: 20px; display: flex; justify-content: center; align-items: center; }
.container { background: #ffffff; border-radius: 16px; padding: 40px; max-width: 650px; width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
h1 { margin: 0 0 10px 0; color: #1a1a2e; font-size: 28px; }
.subtitle { color: #666; margin-bottom: 30px; font-size: 14px; }
.form-group { margin-bottom: 24px; }
label { display: block; margin-bottom: 8px; font-weight: 600; color: #333; font-size: 14px; }
.required::after { content: ' *'; color: #e74c3c; }
input[type="text"], input[type="email"], input[type="url"], textarea, select { width: 100%; padding: 14px 16px; border: 2px solid #e0e0e0; border-radius: 10px; font-size: 15px; transition: border-color 0.3s, box-shadow 0.3s; background: #fafafa; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1); background: #fff; }
textarea { resize: vertical; min-height: 120px; }

/* --- MODE SELECTOR --- */
.mode-selector { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.mode-option { flex: 1; min-width: 100px; padding: 16px 10px; border: 2px solid #e0e0e0; border-radius: 12px; cursor: pointer; text-align: center; transition: all 0.3s; background: #fafafa; }
.mode-option:hover { border-color: #667eea; background: #f0f3ff; }
.mode-option.active { border-color: #667eea; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.mode-option .icon { font-size: 24px; margin-bottom: 8px; }
.mode-option .label { font-weight: 600; font-size: 13px; }

.conditional-section { display: none; }
.conditional-section.visible { display: block; }

/* --- LAYOUT UTILS --- */
.row { display: flex; gap: 16px; }
.row .form-group { flex: 1; }

/* --- TOGGLE --- */
.toggle-group { display: flex; align-items: center; gap: 12px; }
.toggle { position: relative; width: 50px; height: 26px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .3s; border-radius: 26px; }
.toggle-slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
.toggle input:checked + .toggle-slider { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.toggle input:checked + .toggle-slider:before { transform: translateX(24px); }

/* --- BUTTONS --- */
button[type="submit"] { width: 100%; padding: 16px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
button[type="submit"]:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4); }
button[type="submit"]:disabled { background: #ccc; cursor: not-allowed; transform: none; box-shadow: none; }

/* --- STATUS MESSAGES --- */
.status { margin-top: 20px; padding: 16px; border-radius: 10px; display: none; }
.status.visible { display: block; }
.status.loading { background: #fff3cd; color: #856404; }
.status.success { background: #d4edda; color: #155724; }
.status.error { background: #f8d7da; color: #721c24; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #856404; border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; margin-right: 8px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- HELPERS --- */
.help-text { font-size: 12px; color: #888; margin-top: 6px; }
.info-box { background: #e3f2fd; border-left: 4px solid #2196f3; padding: 12px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; color: #1565c0; }

/* --- CHARACTER SECTION --- */
.character-section { background: #f8f9fa; border-radius: 10px; padding: 16px; margin-bottom: 24px; }
.character-section h3 { margin: 0 0 12px 0; font-size: 14px; color: #333; }
.character-inputs { display: flex; flex-direction: column; gap: 8px; }
.character-inputs input { padding: 10px 12px; font-size: 14px; }
.add-character-btn { background: none; border: 2px dashed #ccc; padding: 10px; border-radius: 8px; cursor: pointer; color: #666; font-size: 14px; transition: all 0.3s; width: 100%; margin-top: 8px; }
.add-character-btn:hover { border-color: #667eea; color: #667eea; }

/* --- EXAMPLE IMAGES --- */
.example-images { background: #f0f3ff; border-radius: 8px; padding: 12px; margin-top: 12px; }
.example-images h4 { margin: 0 0 8px 0; font-size: 13px; color: #333; }
.example-images a { color: #667eea; font-size: 12px; display: block; margin: 4px 0; text-decoration: none; word-break: break-all; }
.example-images a:hover { text-decoration: underline; }

/* --- MEDIA RESULT --- */
.media-result {
    margin-top: 25px;
    display: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    background: #000;
}
.media-result video,
.media-result img {
    width: 100%;
    display: block;
}
.download-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #4CAF50;
    color: white;
    padding: 12px;
    text-decoration: none;
    font-weight: bold;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.download-btn:hover {
    background: #45a049;
}

/* --- VIDEO SPECIFIC SETTINGS --- */
.video-settings { display: none; }
.video-settings.visible { display: block; }

/* --- IMAGE SOURCE TOGGLE --- */
.image-source-toggle { display: flex; gap: 8px; margin-bottom: 12px; }
.image-source-toggle button { flex: 1; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; background: #fafafa; cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.3s; }
.image-source-toggle button.active { border-color: #667eea; background: #667eea; color: white; }
.image-source-toggle button:hover:not(.active) { border-color: #667eea; background: #f0f3ff; }

/* --- DRAG & DROP ZONE --- */
.upload-zone { border: 2px dashed #ccc; border-radius: 10px; padding: 30px 20px; text-align: center; cursor: pointer; transition: all 0.3s; background: #fafafa; }
.upload-zone:hover, .upload-zone.dragover { border-color: #667eea; background: #f0f3ff; }
.upload-zone .icon { font-size: 40px; margin-bottom: 10px; }
.upload-zone .text { color: #666; font-size: 14px; }
.upload-zone .text span { color: #667eea; font-weight: 600; }
.upload-zone input[type="file"] { display: none; }
.upload-preview { margin-top: 12px; display: none; }
.upload-preview img { max-width: 100%; max-height: 200px; border-radius: 8px; }
.upload-preview .filename { font-size: 12px; color: #666; margin-top: 8px; }
.upload-preview .remove-btn { background: #e74c3c; color: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; margin-top: 8px; }
