:root {
    --md-sys-color-primary: #6750A4;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #EADDFF;
    --md-sys-color-on-primary-container: #21005D;
    --md-sys-color-error: #B3261E;
    --md-sys-color-error-container: #F9DEDC;
    --md-sys-color-on-error-container: #410E0B;
    --md-sys-color-background: #FFFBFE;
    --md-sys-color-on-background: #1C1B1F;
    --md-sys-color-surface: #FFFBFE;
    --md-sys-color-surface-variant: #E7E0EC;
    --md-sys-color-outline: #79747E;
    --md-sys-color-surface-container-low: #F7F2FA;
    --border-radius: 16px;
    --border-radius-small: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Assistant', sans-serif; background-color: var(--md-sys-color-background); color: var(--md-sys-color-on-background); line-height: 1.6; }
.container { max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem; }
.card { background-color: var(--md-sys-color-surface-container-low); border-radius: var(--border-radius); padding: 2rem; border: 1px solid var(--md-sys-color-surface-variant); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
header { padding-bottom: 1.5rem; text-align: center; }
h1, h2 { font-weight: 700; color: var(--md-sys-color-primary); }
h1 { font-size: 2.5rem; display: flex; align-items: center; justify-content: center; gap: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--md-sys-color-primary-container); padding-bottom: 0.5rem; }
.material-symbols-outlined { font-size: inherit; vertical-align: middle; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 10px 24px; font-family: 'Assistant', sans-serif; font-size: 1rem; font-weight: 600; border-radius: 99px; border: none; cursor: pointer; transition: all 0.2s ease-in-out; text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; background-color: var(--md-sys-color-outline); }
.btn-primary { background-color: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.btn-secondary { background-color: var(--md-sys-color-surface-variant); color: var(--md-sys-color-on-surface-variant); }
.btn-primary:hover:not(:disabled) { background-color: #5a3f92; box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.input-group { margin-bottom: 1.5rem; }
.input-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--md-sys-color-on-background); }
.input-group input[type="password"], .input-group input[type="text"], .input-group select, .input-group textarea { width: 100%; padding: 12px; border: 1px solid var(--md-sys-color-outline); border-radius: var(--border-radius-small); font-size: 1rem; background-color: var(--md-sys-color-surface); font-family: 'Assistant', sans-serif; }
.input-group textarea { resize: vertical; min-height: 80px; }
#model-custom-input { margin-top: 0.5rem; }
.file-input-wrapper { border: 2px dashed var(--md-sys-color-outline); border-radius: var(--border-radius); padding: 2rem; text-align: center; cursor: pointer; transition: all 0.2s; }
.file-input-wrapper:hover, .file-input-wrapper.drag-over { background-color: var(--md-sys-color-primary-container); border-color: var(--md-sys-color-primary); }
.file-input-wrapper.disabled { opacity: 0.6; cursor: not-allowed; background-color: var(--md-sys-color-surface-container-low); border-color: var(--md-sys-color-outline); }
.file-input-wrapper.disabled:hover { background-color: var(--md-sys-color-surface-container-low); border-color: var(--md-sys-color-outline); }
.file-input-wrapper input[type="file"] { display: none; }
.file-name { margin-top: 1rem; font-weight: 600; color: var(--md-sys-color-secondary); }
#results-section { display: none; margin-top: 2rem; }
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 1rem; }
.results-header h2 { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.view-toggle { display: flex; border: 1px solid var(--md-sys-color-outline); border-radius: 99px; overflow: hidden; }
.view-btn { background: transparent; border: none; padding: 6px 16px; cursor: pointer; font-weight: 600; font-family: 'Assistant', sans-serif; font-size: 0.9rem; color: var(--md-sys-color-primary); transition: all 0.2s ease-in-out; }
.view-btn.active { background-color: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.textarea-container { position: relative; margin-bottom: 1rem; }
#results-output { width: 100%; height: 300px; padding: 1rem; border: 1px solid var(--md-sys-color-outline); border-radius: var(--border-radius-small); font-family: monospace; background-color: var(--md-sys-color-surface); font-size: 0.9rem; resize: vertical; direction: rtl; text-align: right; }
#copy-button {
    position: absolute;
    bottom: 18px;
    left: 12px;
    padding: 8px;
    min-width: auto;
    width: 40px;
    height: 40px;
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface-variant);
    border-radius: 50%;
    z-index: 10;
    transition: left 0.2s ease-in-out;
}

#copy-button.has-scrollbar {
    left: 28px;
}
#copy-button .material-symbols-outlined { font-size: 20px; }
.buttons-container { display: flex; gap: 1rem; margin-top: 1rem; justify-content: center; flex-wrap: wrap; }
#status-container { margin-top: 1.5rem; display: none; }
#status-message { text-align: center; padding: 1rem; font-weight: 600; border-radius: var(--border-radius-small) var(--border-radius-small) 0 0; }
#status-message.loading { background-color: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
#status-message.error { background-color: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
#progress-bar-container { width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 0 0 var(--border-radius-small) var(--border-radius-small); overflow: hidden; height: 8px; }
#progress-bar { width: 0%; height: 100%; background-color: var(--md-sys-color-primary); transition: width 0.3s ease-in-out; }
#progress-bar.error { background-color: var(--md-sys-color-error); }
footer { text-align: center; margin-top: 1rem; padding: 1rem; color: var(--md-sys-color-outline); font-size: 0.9rem; }
footer a { color: var(--md-sys-color-primary); text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; }
.github-link { margin-left: 8px; vertical-align: middle; display: inline-flex; align-items: center; justify-content: center; }
.github-link i { font-size: 18px; color: var(--md-sys-color-primary); transition: color 0.2s ease-in-out; vertical-align: middle; }
.github-link:hover i { color: #5a3f92; }
.srt-only { display: none; }
.format-toggle-group { display: flex; border: 1px solid var(--md-sys-color-outline); border-radius: var(--border-radius-small); overflow: hidden; width: 100%; }
.format-toggle-btn { flex: 1; background: transparent; border: none; padding: 12px 16px; cursor: pointer; font-weight: 600; font-family: 'Assistant', sans-serif; font-size: 1rem; color: var(--md-sys-color-primary); transition: all 0.2s ease-in-out; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.format-toggle-btn:not(:first-child) { border-right: 1px solid var(--md-sys-color-outline); }
.format-toggle-btn.active { background-color: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.format-toggle-btn:hover:not(.active) { background-color: var(--md-sys-color-surface-variant); }
