/* Stealth Browse - File Converter Power Up */

.file-converter-toggle-container:not([hidden]):not(.appearance-hidden) {
    display: flex !important;
    align-items: center;
    flex-shrink: 0;
    margin: 0;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
}

#file-converter-toggle-container[hidden],
#file-converter-toggle-container.appearance-hidden,
.top-bar #file-converter-toggle-container[hidden],
.top-bar #file-converter-toggle-container.appearance-hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#file-converter-toggle-btn img,
.top-bar #file-converter-toggle-btn img {
    width: 11px !important;
    height: 11px !important;
    max-width: 11px !important;
    max-height: 11px !important;
    display: block !important;
    object-fit: contain !important;
}

#file-converter-toggle-btn.is-open {
    color: #e879f9;
    background: rgba(90, 13, 214, 0.22);
}

.file-converter-window {
    --panel-fill-alpha: 0.28;
    --frost-tint-alpha: 0.18;
    position: fixed !important;
    top: 88px;
    right: 64px;
    left: auto;
    bottom: auto;
    width: 720px;
    height: 520px;
    min-width: 480px;
    min-height: 360px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    z-index: 2147483647 !important;
    border-radius: 16px;
    overflow: hidden !important;
    background: rgba(22, 22, 30, var(--panel-fill-alpha, 0.28)) !important;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
    display: none !important;
    flex-direction: column;
    color: #f2f2f6;
    font-family: inherit;
    pointer-events: auto;
    clip-path: inset(0 round 16px);
    -webkit-clip-path: inset(0 round 16px);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    margin: 0 !important;
    transform: translateZ(0);
    contain: layout style;
}

#file-converter-window.show,
#file-converter-window.page-frost-host {
    border-radius: 16px !important;
    overflow: hidden !important;
    clip-path: inset(0 round 16px) !important;
    -webkit-clip-path: inset(0 round 16px) !important;
}

#file-converter-window .page-frost-layer,
#file-converter-window .page-frost-image,
#file-converter-window .page-frost-layer::after {
    border-radius: 16px !important;
}

.file-converter-window.show {
    display: flex !important;
}

.file-converter-window[hidden] {
    display: none !important;
    pointer-events: none !important;
}

.file-converter-glass-sheen {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, transparent 42%),
        radial-gradient(ellipse at 20% 0%, rgba(90, 13, 214, 0.18), transparent 55%);
}

.file-converter-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    min-height: 28px;
    cursor: grab;
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.file-converter-header:active { cursor: grabbing; }

.file-converter-header-icon {
    width: 16px;
    height: 16px;
    opacity: 0.92;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(62%) sepia(78%) saturate(2200%) hue-rotate(285deg) brightness(1.05);
}

[data-theme="light"] .file-converter-header-icon {
    filter: brightness(0) saturate(100%) invert(42%) sepia(70%) saturate(1800%) hue-rotate(295deg) brightness(0.95);
}

.file-converter-header-title {
    font-size: 13px;
    font-weight: 650;
    flex: 1;
    min-width: 0;
}

.file-converter-icon-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    border-radius: var(--stealth-cut, 12px 2px 2px 2px);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.file-converter-icon-btn:hover {
    background: rgba(90, 13, 214, 0.22);
    border-color: rgba(90, 13, 214, 0.35);
}

.file-converter-body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.file-converter-main {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.file-converter-left {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.file-converter-right {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 10px;
    gap: 10px;
    overflow-y: auto;
}

.file-converter-dropzone {
    margin: 10px;
    padding: 22px 14px;
    border: 1px dashed rgba(90, 13, 214, 0.45);
    border-radius: var(--stealth-cut-panel, 22px 4px 4px 4px);
    background: rgba(90, 13, 214, 0.08);
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.file-converter-dropzone:hover,
.file-converter-dropzone.is-dragover {
    background: rgba(90, 13, 214, 0.16);
    border-color: rgba(167, 139, 250, 0.65);
}

.file-converter-dropzone-title {
    font-size: 12.5px;
    font-weight: 650;
    margin-bottom: 4px;
}

.file-converter-dropzone-hint {
    font-size: 11px;
    opacity: 0.72;
    line-height: 1.35;
}

.file-converter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 10px 8px;
    flex-shrink: 0;
}

.file-converter-action-btn {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    border-radius: var(--stealth-cut-sm, 8px 2px 2px 2px);
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
}

.file-converter-action-btn.primary {
    background: linear-gradient(135deg, #5a0dd6, #4900c2);
    border-color: rgba(167, 139, 250, 0.45);
    color: #fff;
}

.file-converter-action-btn:hover {
    border-color: rgba(90, 13, 214, 0.5);
    background: rgba(90, 13, 214, 0.18);
}

.file-converter-action-btn.primary:hover {
    background: linear-gradient(135deg, #6b1ef0, #5600db);
}

.file-converter-action-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.file-converter-status {
    padding: 0 12px 6px;
    font-size: 11px;
    opacity: 0.75;
    flex-shrink: 0;
    min-height: 16px;
}

.file-converter-file-list {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 8px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(157, 78, 221, 0.55) rgba(255, 255, 255, 0.04);
}

.file-converter-file-list::-webkit-scrollbar { width: 10px; }
.file-converter-file-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}
.file-converter-file-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(107, 30, 240, 0.85), rgba(73, 0, 194, 0.9));
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.file-converter-empty {
    padding: 28px 16px;
    text-align: center;
    opacity: 0.7;
    font-size: 12px;
    line-height: 1.45;
}

.file-converter-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin: 0 0 4px 0;
    border: 1px solid transparent;
    border-radius: var(--stealth-cut, 12px 2px 2px 2px);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    font-size: 11.5px;
}

.file-converter-file-item:hover {
    background: rgba(90, 13, 214, 0.12);
}

.file-converter-file-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.file-converter-file-meta {
    font-size: 10px;
    opacity: 0.65;
    flex-shrink: 0;
}

.file-converter-remove-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: inherit;
    border-radius: var(--stealth-cut-sm, 8px 2px 2px 2px);
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.file-converter-remove-btn:hover {
    border-color: rgba(248, 113, 113, 0.55);
    background: rgba(248, 113, 113, 0.12);
}

.file-converter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-converter-field-label {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.88;
}

.file-converter-field-hint {
    font-size: 10px;
    opacity: 0.62;
    line-height: 1.35;
}

.file-converter-select,
.file-converter-input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--stealth-cut-sm, 8px 2px 2px 2px);
    background: rgba(0, 0, 0, 0.22);
    color: inherit;
    font-size: 12px;
    outline: none;
}

.file-converter-select:focus,
.file-converter-input:focus {
    border-color: rgba(90, 13, 214, 0.7);
    box-shadow: 0 0 0 2px rgba(90, 13, 214, 0.25);
}

.file-converter-dimensions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.file-converter-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-converter-slider {
    flex: 1;
    accent-color: #5a0dd6;
}

.file-converter-slider-value {
    font-size: 11px;
    min-width: 36px;
    text-align: right;
    opacity: 0.8;
}

.file-converter-output-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.file-converter-output-row .file-converter-input {
    flex: 1;
    min-width: 0;
}

.file-converter-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.file-converter-progress {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 10px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 140px;
}

.file-converter-progress-title {
    font-size: 11px;
    font-weight: 650;
    padding: 8px 0 6px;
    opacity: 0.85;
}

.file-converter-job {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: var(--stealth-cut-sm, 8px 2px 2px 2px);
    background: rgba(255, 255, 255, 0.03);
    font-size: 11px;
}

.file-converter-job-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-converter-job-status {
    font-size: 10px;
    opacity: 0.72;
    flex-shrink: 0;
}

.file-converter-job.is-running .file-converter-job-status {
    color: #c4b5fd;
}

.file-converter-job.is-done .file-converter-job-status {
    color: #86efac;
}

.file-converter-job.is-error .file-converter-job-status {
    color: #fca5a5;
}

.file-converter-job-bar {
    width: 72px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    flex-shrink: 0;
}

.file-converter-job-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #5a0dd6, #a78bfa);
    transition: width 0.12s linear;
}

.file-converter-resize-handle {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 16px;
    height: 16px;
    z-index: 5;
    cursor: nwse-resize;
}

.file-converter-resize-handle::before {
    content: "";
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(255, 255, 255, 0.35);
    border-bottom: 2px solid rgba(255, 255, 255, 0.35);
}

[data-theme="light"] .file-converter-window {
    color: #1a1b22;
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .file-converter-select,
[data-theme="light"] .file-converter-input,
[data-theme="light"] .file-converter-action-btn,
[data-theme="light"] .file-converter-remove-btn {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a1b22;
}

[data-theme="light"] .file-converter-file-item,
[data-theme="light"] .file-converter-job {
    color: #1a1b22 !important;
}

[data-theme="light"] .file-converter-dropzone {
    background: rgba(90, 13, 214, 0.06);
    border-color: rgba(90, 13, 214, 0.35);
}

[data-theme="stealth"] .file-converter-window {
    color: #e8f4f4;
    border-color: rgba(120, 200, 200, 0.14);
}

[data-theme="stealth"] .file-converter-glass-sheen {
    background:
        linear-gradient(135deg, rgba(120, 200, 200, 0.06) 0%, transparent 42%),
        radial-gradient(ellipse at 20% 0%, rgba(90, 13, 214, 0.14), transparent 55%);
}

[data-theme="stealth-glass"] .file-converter-window {
    color: #f2f2f6;
}

[data-theme="stealth-glass"] .file-converter-glass-sheen {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 42%),
        radial-gradient(ellipse at 20% 0%, rgba(167, 139, 250, 0.2), transparent 55%);
}

[data-theme="stealth-float"] .file-converter-window {
    color: #f2f2f6;
}

[data-theme="stealth-float"] .file-converter-glass-sheen {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, transparent 42%),
        radial-gradient(ellipse at 20% 0%, rgba(90, 13, 214, 0.16), transparent 55%);
}

@media (max-width: 720px) {
    .file-converter-main {
        grid-template-columns: 1fr;
    }

    .file-converter-left {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
}
