.upload-zone {
    border: 2px dashed rgba(114, 164, 242, 0.4);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
    background: rgba(20, 30, 60, 0.3);
    overflow: hidden;
}

.upload-zone.drag-over {
    border-color: rgba(114, 164, 242, 0.9);
    background: rgba(30, 50, 100, 0.4);
    transform: scale(1.01);
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.upload-label:hover .upload-text {
    color: rgba(114, 164, 242, 1);
}

.upload-icon {
    width: 64px;
    height: 64px;
    opacity: 0.65;
    margin-bottom: 0.25rem;
}

.upload-icon img {
    width: 100%;
    height: 100%;
}

.upload-text {
    color: var(--text-white);
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    transition: color 0.2s ease;
}

.upload-hint {
    color: rgba(184, 193, 219, 0.6);
    font-size: 0.82rem;
    margin: 0;
}

#file-input {
    display: none;
}

/* Preview state */
.upload-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.picker-hint {
    color: rgba(184, 193, 219, 0.75);
    font-size: 0.85rem;
    margin: 0;
}

#picker-canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(114, 164, 242, 0.3);
    cursor: crosshair;
    display: block;
}

.preview-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.file-name {
    color: var(--text-white);
    font-size: 0.88rem;
    font-weight: 500;
    word-break: break-all;
    margin: 0;
}

.btn-change {
    background: transparent;
    border: 1px solid rgba(114, 164, 242, 0.45);
    border-radius: 20px;
    color: rgba(114, 164, 242, 0.9);
    padding: 0.35rem 1rem;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: var(--font-family);
    font-weight: 500;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    align-self: flex-start;
}

.btn-change:hover {
    border-color: #72a4f2;
    color: white;
    background: rgba(114, 164, 242, 0.12);
}

#options-section {
    margin-top: 1.5rem;
}

.strength-group {
    margin-bottom: 1.5rem;
}

.strength-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.75rem 0 0.75rem;
}

.strength-bound {
    font-size: 0.82rem;
    color: rgba(184, 193, 219, 0.6);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 52px;
}

.strength-bound:last-child {
    text-align: right;
}

.range-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(58, 85, 140, 0.6);
    outline: none;
    cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gradient-blue);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 0 3px rgba(114, 164, 242, 0.2);
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 5px rgba(114, 164, 242, 0.25);
}

.range-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a7fd9, #72a4f2);
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease;
}

.fisheye-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2.5rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(114, 164, 242, 0.2);
    border-top-color: #72a4f2;
    border-radius: 50%;
    animation: fisheye-spin 0.8s linear infinite;
}

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

.fisheye-loading p {
    color: var(--text-white);
    font-size: 1rem;
    margin: 0;
}

#result-section {
    margin-top: 1.5rem;
}

.result-canvas {
    max-width: min(100%, 420px);
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid rgba(114, 164, 242, 0.45);
    border-radius: 25px;
    color: rgba(114, 164, 242, 0.9);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease, transform 0.3s ease;
    font-family: var(--font-family);
}

.btn-secondary:hover {
    border-color: #72a4f2;
    color: white;
    background: rgba(114, 164, 242, 0.12);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-download {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #1e6b2a 0%, #3da84a 100%);
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    font-family: var(--font-family);
}

.btn-download:hover {
    background: linear-gradient(135deg, #27883a 0%, #4fc75e 100%);
    transform: scale(1.05);
}

.btn-download:active {
    transform: scale(0.98);
}

@media (max-width: 768px) {
    .upload-zone {
        padding: 1.5rem;
    }

    .strength-bound {
        display: none;
    }
}

@media (max-width: 480px) {
    .upload-zone {
        padding: 1.2rem;
    }

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    .upload-text {
        font-size: 0.9rem;
    }

    .preview-info {
        flex-wrap: wrap;
        justify-content: center;
    }

    .result-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-secondary,
    .btn-download {
        width: 100%;
        text-align: center;
    }
}
