/* Colors and layout values inlined (no CSS variables) */


#app {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 20px 56px;
}

/* Topbar */
.topbar {
    margin-bottom: 28px;
    background: linear-gradient(219deg, #FB0E76 0%, #910694 100%);
    padding: 14px 16px !important;
    border-radius: 12px !important;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px !important;
    background: linear-gradient(219deg, #FB0E76 0%, #910694 100%) !important;
    color: #fff;
    font-weight: 800;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 40px rgba(145, 6, 148, 0.12);
}

.brand-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.topbar-sub {
    margin-top: 10px;
    color: rgba(255,255,255,0.95);
    font-size: 14px;
}

/* Converter grid */
.converter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.panel {
    background: #fff;
    border: 1px solid  !important;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
}

.panel-hint {
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 18px;
}

/* Dropzone */
.dropzone {
    position: relative;
    border: 2px dashed #d9c9d6 !important;
    border-radius: 14px;
    background: linear-gradient(219deg, rgba(251, 14, 118, 0.12) 0%, rgba(145, 6, 148, 0.12) 100%) !important;
    padding: 30px 16px !important;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.dropzone:hover {
    border-color: #FB0E76;
}

.dropzone.drag {
    border-color: #FB0E76;
    background: linear-gradient(219deg, rgba(251, 14, 118, 0.18) 0%, rgba(145, 6, 148, 0.18) 100%);
    transform: scale(1.01);
}

.upload-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(219deg, #FB0E76 0%, #910694 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(251, 14, 118, 0.35);
}

.upload-arrow {
    width: 14px;
    height: 14px;
    border-left: 3px solid #fff !important;
    border-top: 3px solid #fff !important;
    transform: rotate(45deg) translate(1px, 4px);
}

.dropzone-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.browse-link {
    color: #FB0E76;
    font-weight: 700;
}

.dropzone-sub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

/* File info */
.file-info {
    display: none;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 12px 14px !important;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #faf8fb;
}

.file-info.show {
    display: flex;
}

.file-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px !important;
    background: linear-gradient(219deg, #FB0E76 0%, #910694 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-meta {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: var(--muted);
}

.file-remove {
    cursor: pointer;
    color: var(--muted);
    font-size: 14px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    transition: background 0.2s, color 0.2s;
}

.file-remove:hover {
    background: #fde9f2;
    color: #FB0E76;
}

/* Options */
.options {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.option-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1320;
}

.option-label span {
    color: var(--pink);
}

.seg {
    display: flex;
    border: 1px solid #ece9ee !important;
    border-radius: 10px !important;
    overflow: hidden;
    background: #faf8fb;
}

.seg-item {
    flex: 1;
    text-align: center;
    padding: 9px 8px !important;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.seg-item.active {
    color: #fff;
    background: linear-gradient(219deg, #FB0E76 0%, #910694 100%);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--line);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(219deg, #FB0E76 0%, #910694 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(251, 14, 118, 0.4);
    border: 2px solid #fff;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FB0E76;
    cursor: pointer;
    border: 2px solid #fff;
}

/* Buttons */
.btn {
    margin-top: 20px;
    border: none !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(219deg, #FB0E76 0%, #910694 100%) !important;
    color: #fff;
    box-shadow: 0 8px 22px rgba(251, 14, 118, 0.32);
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(251, 14, 118, 0.4);
}

.btn-secondary {
    background: #fff !important;
    color: #1a1320 !important;
    border: 1px solid #ece9ee !important;
    display: block;
    width: 100%;
    padding: 14px 18px !important;
    border-radius: 12px !important;
    font-weight: 700;
    text-align: center;
    transition: transform 0.15s, box-shadow 0.2s, background 0.12s, color 0.12s, border-color 0.12s;
    box-shadow: none;
    align-self: stretch;
}

.btn-secondary:not(:disabled):hover {
    border-color: #FB0E76;
    color: #FB0E76;
    background: rgba(251,14,118,0.04);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(251, 14, 118, 0.06);
}

/* Specific tweaks for the download button */
#downloadBtn {
    margin-top: 14px;
}

/* Make sure disabled secondary buttons remain visually distinct */
.btn-secondary:disabled {
    background: #fff !important;
    color: #6b6573 !important;
    border-color: #ece9ee !important;
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: spin 0.7s linear infinite;
}

.spinner.show {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Preview */
.preview {
    flex: 1;
    min-height: 240px;
    max-height: 420px;
    border: 1px solid rgba(145, 6, 148, 0.16) !important;
    border-radius: 18px !important;
    background:
        linear-gradient(135deg, rgba(251, 14, 118, 0.08), rgba(145, 6, 148, 0.08)),
        #fffdfd;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 24px rgba(145, 6, 148, 0.08);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    padding: 16px;
}

.preview-result-box {
    width: 100%;
    min-height: 208px;
    max-height: 100%;
    border-radius: 14px;
    border: 1px solid rgba(145, 6, 148, 0.18);
    background: linear-gradient(135deg, #1c1030 0%, #352456 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 30px rgba(17, 10, 29, 0.26);
    padding: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-result-box pre {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    margin: 0;
    overflow: auto;
    text-align: left;
    font-size: 12px;
    line-height: 1.5;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    background: transparent;
    color: #fceeff;
    white-space: pre-wrap;
    word-break: break-word;
}

.preview-result-box pre::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.preview-result-box pre::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
}

.preview-result-box pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
}

.preview-empty {
    text-align: center;
    color: var(--muted);
}

.preview-empty-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    border-radius: 12px;
    border: 2px dashed #d9c9d6;
    color: #c4b8c9;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-empty-text {
    font-size: 13px;
}

.preview img,
.preview svg {
    max-width: 100%;
    max-height: 320px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

/* Output actions */
.output-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.btn-ghost {
    margin-top: 0;
    padding: 10px 14px;
    border: 1px solid rgba(145, 6, 148, 0.2);
    background: #fff;
    color: #910694;
    box-shadow: none;
}

.btn-ghost:not(:disabled):hover {
    border-color: #FB0E76;
    color: #FB0E76;
    transform: translateY(-1px);
}

/* Output meta */
.output-meta {
    margin-top: 10px;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid rgba(145, 6, 148, 0.14);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(251, 14, 118, 0.08), rgba(145, 6, 148, 0.08));
    box-shadow: 0 6px 16px rgba(145, 6, 148, 0.06);
}

.output-meta.show {
    display: flex;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.meta-row span:first-child {
    color: var(--muted);
}

.meta-row span:last-child {
    font-weight: 700;
    color: #910694;
}

/* Steps */
.steps {
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-text {
    font-size: 13px;
    color: var(--muted);
}

.step-line {
    width: 28px;
    height: 2px;
    background: var(--line);
    border-radius: 2px;
}

.footnote {
    margin-top: 18px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: black;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 50;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: #c0144f;
}

/* Responsive */
@media (max-width: 820px) {
    .converter {
        grid-template-columns: 1fr;
    }

    #app {
        padding: 22px 14px 40px;
    }

    .brand-mark {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .brand-text {
        font-size: 18px;
    }

    .preview {
        min-height: 220px;
        max-height: 360px;
    }
}

@media (max-width: 480px) {
    .steps {
        flex-wrap: wrap;
        gap: 6px;
    }

    .step-line {
        display: none;
    }

    .panel {
        padding: 18px;
    }

    .preview {
        min-height: 200px;
        max-height: 300px;
        padding: 12px;
    }

    .preview-result-box {
        padding: 12px;
    }

    .preview-result-box pre {
        font-size: 11px;
    }
}