/**
 * Standalone translation creator (#createStandaloneTranslationPage) — dark dashboard theme.
 */
body.app-dashboard-home #createStandaloneTranslationPage {
    color-scheme: dark;
}

body.app-dashboard-home #createStandaloneTranslationPage:not(.hidden) {
    background: #000000;
    min-height: calc(100vh - 56px);
    padding: clamp(0.75rem, 3vw, 1.5rem) clamp(0.75rem, 2.5vw, 1.25rem) 2.5rem;
    box-sizing: border-box;
}

body.app-dashboard-home #createStandaloneTranslationPage .translation-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

body.app-dashboard-home #createStandaloneTranslationPage .translation-container h1 {
    text-align: center;
    margin: 0 0 0.5rem 0;
    font-size: clamp(1.35rem, 3.5vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

body.app-dashboard-home #createStandaloneTranslationPage .translation-container .subtitle {
    text-align: center;
    color: #94a3b8;
    margin: 0 0 1.75rem 0;
    font-size: 0.95rem;
    line-height: 1.45;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

body.app-dashboard-home #createStandaloneTranslationPage .input-method-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

body.app-dashboard-home #createStandaloneTranslationPage .tab-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.65rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: #cbd5e1;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.app-dashboard-home #createStandaloneTranslationPage .tab-btn:hover {
    border-color: rgba(61, 214, 140, 0.35);
    background: rgba(61, 214, 140, 0.08);
    color: #f1f5f9;
}

body.app-dashboard-home #createStandaloneTranslationPage .tab-btn.active {
    border-color: rgba(61, 214, 140, 0.55);
    background: linear-gradient(135deg, #2eb574 0%, #3dd68c 100%);
    color: #041208;
    box-shadow: 0 4px 20px rgba(61, 214, 140, 0.22);
}

body.app-dashboard-home #createStandaloneTranslationPage .form-group {
    margin-bottom: 1.25rem;
}

body.app-dashboard-home #createStandaloneTranslationPage .form-group label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #e2e8f0;
}

body.app-dashboard-home #createStandaloneTranslationPage .form-group .optional {
    font-weight: 500;
    color: #64748b;
}

body.app-dashboard-home #createStandaloneTranslationPage .form-input,
body.app-dashboard-home #createStandaloneTranslationPage .form-textarea,
body.app-dashboard-home #createStandaloneTranslationPage .form-select {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    margin-bottom: 0;
}

body.app-dashboard-home #createStandaloneTranslationPage .form-textarea {
    min-height: 180px;
    resize: vertical;
    line-height: 1.5;
}

body.app-dashboard-home #createStandaloneTranslationPage .form-input::placeholder,
body.app-dashboard-home #createStandaloneTranslationPage .form-textarea::placeholder {
    color: #64748b;
}

body.app-dashboard-home #createStandaloneTranslationPage .form-input:focus,
body.app-dashboard-home #createStandaloneTranslationPage .form-textarea:focus,
body.app-dashboard-home #createStandaloneTranslationPage .form-select:focus {
    outline: none;
    border-color: rgba(61, 214, 140, 0.5);
    box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.12);
}

body.app-dashboard-home #createStandaloneTranslationPage input[type="file"].form-input {
    padding: 0.5rem 0.65rem;
    font-size: 0.88rem;
    cursor: pointer;
}

body.app-dashboard-home #createStandaloneTranslationPage input[type="file"].form-input::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(61, 214, 140, 0.35);
    background: rgba(61, 214, 140, 0.12);
    color: #a7f3d0;
    font-weight: 600;
    cursor: pointer;
}

body.app-dashboard-home #createStandaloneTranslationPage input[type="file"].form-input::file-selector-button:hover {
    background: rgba(61, 214, 140, 0.2);
}

body.app-dashboard-home #createStandaloneTranslationPage .form-select {
    cursor: pointer;
    appearance: auto;
}

body.app-dashboard-home #createStandaloneTranslationPage .input-hint {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    color: #64748b;
    font-style: normal;
}

body.app-dashboard-home #createStandaloneTranslationPage .input-method {
    margin-bottom: 0.5rem;
}

body.app-dashboard-home #createStandaloneTranslationPage .file-preview,
body.app-dashboard-home #createStandaloneTranslationPage .photo-preview,
body.app-dashboard-home #createStandaloneTranslationPage .link-preview {
    margin-top: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 0.9rem;
}

body.app-dashboard-home #createStandaloneTranslationPage .file-preview.error,
body.app-dashboard-home #createStandaloneTranslationPage .link-preview .error {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.35);
}

body.app-dashboard-home #createStandaloneTranslationPage .photo-preview img {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Primary actions — fix squished / vertical Cancel (flex + explicit button layout) */
body.app-dashboard-home #createStandaloneTranslationPage .form-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem 1rem;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.app-dashboard-home #createStandaloneTranslationPage .form-actions .btn-secondary,
body.app-dashboard-home #createStandaloneTranslationPage .form-actions .btn-primary {
    flex: 0 1 auto;
    min-width: 7.5rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    padding: 0.65rem 1.25rem;
    box-sizing: border-box;
}

body.app-dashboard-home #createStandaloneTranslationPage .form-actions .btn-secondary {
    background: transparent;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

body.app-dashboard-home #createStandaloneTranslationPage .form-actions .btn-secondary:hover {
    border-color: rgba(61, 214, 140, 0.45);
    background: rgba(61, 214, 140, 0.08);
    color: #f1f5f9;
}

body.app-dashboard-home #createStandaloneTranslationPage .form-actions .btn-primary {
    color: #041208;
    background: linear-gradient(135deg, #2eb574 0%, #3dd68c 100%);
    border: 1px solid rgba(61, 214, 140, 0.45);
    box-shadow: 0 4px 20px rgba(61, 214, 140, 0.22);
}

body.app-dashboard-home #createStandaloneTranslationPage .form-actions .btn-primary:hover {
    filter: brightness(1.06);
}

body.app-dashboard-home #createStandaloneTranslationPage .form-actions .btn-large {
    padding: 0.7rem 1.35rem;
    font-size: 0.95rem;
}

/* Result panel */
body.app-dashboard-home #createStandaloneTranslationPage .translation-result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.app-dashboard-home #createStandaloneTranslationPage .translation-result h3 {
    margin: 0 0 1rem 0;
    color: #f1f5f9;
    font-size: 1.1rem;
}

body.app-dashboard-home #createStandaloneTranslationPage .translated-text {
    padding: 1rem 1.1rem;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

body.app-dashboard-home #createStandaloneTranslationPage .result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

body.app-dashboard-home #createStandaloneTranslationPage .result-actions .btn-secondary {
    background: transparent;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    padding: 0.55rem 1rem;
    font-weight: 600;
}

body.app-dashboard-home #createStandaloneTranslationPage .result-actions .btn-secondary:hover {
    border-color: rgba(61, 214, 140, 0.45);
    background: rgba(61, 214, 140, 0.08);
}

body.app-dashboard-home #createStandaloneTranslationPage .result-actions .btn-primary {
    color: #041208;
    background: linear-gradient(135deg, #2eb574 0%, #3dd68c 100%);
    border: 1px solid rgba(61, 214, 140, 0.45);
    border-radius: 10px;
    padding: 0.55rem 1rem;
    font-weight: 600;
}

@media (max-width: 520px) {
    body.app-dashboard-home #createStandaloneTranslationPage .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    body.app-dashboard-home #createStandaloneTranslationPage .form-actions .btn-secondary,
    body.app-dashboard-home #createStandaloneTranslationPage .form-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* Loading modal */
body.app-dashboard-home #createStandaloneTranslationPage .translation-loading-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

body.app-dashboard-home #createStandaloneTranslationPage .translation-loading-modal.hidden {
    display: none;
}

body.app-dashboard-home #createStandaloneTranslationPage .translation-loading-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

body.app-dashboard-home #createStandaloneTranslationPage .translation-loading-modal__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.75rem 2rem;
    background: #0f172a;
    border: 1px solid rgba(61, 214, 140, 0.35);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    min-width: 220px;
}

body.app-dashboard-home #createStandaloneTranslationPage .translation-loading-modal__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(61, 214, 140, 0.2);
    border-top-color: #3dd68c;
    border-radius: 50%;
    animation: translation-spin 0.75s linear infinite;
}

@keyframes translation-spin {
    to {
        transform: rotate(360deg);
    }
}

body.app-dashboard-home #createStandaloneTranslationPage .translation-loading-modal__text {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
}

body.app-dashboard-home #createStandaloneTranslationPage .translated-text--error {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.35);
}
